Messages in this thread | | | Date | Fri, 24 Feb 2012 17:50:06 -0500 (EST) | Subject | Re: [PATCH 2/2] enic: Silence Sparse Warning: "dubious: x | !y" | From | David Miller <> |
| |
From: santosh nayak <santoshprasadnayak@gmail.com> Date: Fri, 24 Feb 2012 22:27:34 +0530
> From: Santosh Nayak <santoshprasadnayak@gmail.com> > > Sparse is giving the following warning: > "warning: dubious: x | !y" > > "enic_are_pp_different" is static and expected to return true or false. > Logical or is indended here. With logical or, in best case, execution will be > faster because if leftmost operand is true then no need to check other operands. > > Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
As others have explained, this code is intentional. It's faster because the resulting code has less branches and therefore less potential branch mispredictions.
| |