From: Jesse Millan <jessem@cs.pdx.edu>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [PATCH] GCC4 sched.c (x86_64) warning: control may reach end
Date: Fri, 08 Jul 2005 18:21:15 +0000 [thread overview]
Message-ID: <42CEC41B.1090309@cs.pdx.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 2 bytes --]
[-- Attachment #2: bitops.patch --]
[-- Type: text/x-diff, Size: 1022 bytes --]
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>
---
diff -puN include/asm-x86_64/bitops.h~bitops include/asm-x86_64/bitops.h
--- linux-2.6.13-rc2/include/asm-x86_64/bitops.h~bitops 2005-07-08 10:21:55.646887616 -0700
+++ linux-2.6.13-rc2-jessem/include/asm-x86_64/bitops.h 2005-07-08 10:22:37.738488720 -0700
@@ -348,8 +348,7 @@ static inline int sched_find_first_bit(c
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;
}
/**
_
[-- Attachment #3: Type: text/plain, Size: 168 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors
reply other threads:[~2005-07-08 18:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42CEC41B.1090309@cs.pdx.edu \
--to=jessem@cs.pdx.edu \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.