From patch 2.1.83

C. Scott Ananian (cananian@lcs.mit.edu)
Sat, 31 Jan 1998 15:39:11 -0500 (EST)


On Sat, 31 Jan 1998 Trever Adams <arabian@onramp.net> wrote:

> Referring to the below patch couldn't/shouldn't the line be
>
> if (local_irq_count[this_cpu] || local_bh_count[this_cpu])
> goto scheduling_in_interrupt;
>
> instead of...
[...]
> if (local_irq_count[this_cpu])
> goto scheduling_in_interrupt;
> + if (local_bh_count[this_cpu])
> + goto scheduling_in_interrupt;

Note tha both of these code fragments generate *identical* code, due to
the way that short-circuit logical operators work in C. We generally
value clarity over all else in kernel code; separating the two clauses in
the if makes the statement just a little more clear.
--Scott
@ @
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-oOO-(_)-OOo-=-=-=-=-=
C. Scott Ananian: cananian@lcs.mit.edu / Declare the Truth boldly and
Laboratory for Computer Science/Crypto / without hindrance.
Massachusetts Institute of Technology /META-PARRESIAS AKOLUTOS:Acts 28:31
-.-. .-.. .. ..-. ..-. --- .-. -.. ... -.-. --- - - .- -. .- -. .. .- -.
PGP key available via finger and from http://www.pdos.lcs.mit.edu/~cananian