Skip to content

Commit

Permalink
[PATCH] x86_64: Fix gcc 4 warning in sched_find_first_bit
Browse files Browse the repository at this point in the history
This patch eliminates the GCC4 warning on the x86_64 platform:

kernel/sched.c:1824: warning: control may reach end of non-void function
'sched_find_first_bit' being inlined.

The change follows the lead of others, i.e.  it is guaranteed that at least
one of b[0], b[1], or b[2] will have a bit set and evaluate to true.  That
being said, GCC4.0.0 notices that the code flow does not return anything if
b[0], b[1] and b[2] are not true.  Since we know better, if it's not b[0] or
b[1], it has to be b[2].

Signed-off-by: Jesse Millan <jessem@cs.pdx.edu>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jesse Millan authored and Linus Torvalds committed Jul 29, 2005
1 parent 07291d4 commit 8d224d3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions include/asm-x86_64/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ static inline int sched_find_first_bit(const unsigned long *b)
return __ffs(b[0]);
if (b[1])
return __ffs(b[1]) + 64;
if (b[2])
return __ffs(b[2]) + 128;
return __ffs(b[2]) + 128;
}

/**
Expand Down

0 comments on commit 8d224d3

Please sign in to comment.