[PATCH] wifi: ath11k: Fix NULL pointer check in ath11k_ce_rx_post_pipe()
Mihai Moldovan
ionic at ionic.de
Sun Nov 24 21:33:57 PST 2024
* On 11/25/24 06:08, Baichuan Qi wrote:
> - if (!(pipe->dest_ring || pipe->status_ring))
> + if (!(pipe->dest_ring && pipe->status_ring))
> return 0;
Wouldn't the expanded form, i.e., if (!pipe->dest_ring || !pipe->status_ring)
show the intention more clearly (return if any of these pointers is NULL) and
avoid the whole confusion in the first place?
We all know that !(a && b) ~= !a || !b, so your expression is obviously
functionally equivalent, but it's not exactly obvious at first glance.
Mihai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/ath11k/attachments/20241125/b4a6387c/attachment.sig>
More information about the ath11k
mailing list