From: Joe Perches <joe@perches.com>
To: LKML <linux-kernel@vger.kernel.org>
Subject: suspect & tests
Date: Mon, 14 Dec 2009 11:22:57 -0800 [thread overview]
Message-ID: <1260818577.18538.35.camel@Joe-Laptop.home> (raw)
A grep for possibly misused & tests
grep -rP --include=*.[ch] -n -e "[^\&]\&[\=]*\s*\!" *
shows some possible cases where && should
have been used instead:
arch/powerpc/platforms/pseries/lpar.c:309: if ((rflags & _PAGE_NO_CACHE) & !(rflags & _PAGE_WRITETHRU))
arch/arm/mach-mxc91231/clock.c:265: if (acs & !ads)
arch/arm/mach-s3c2440/mach-osiris-dvs.c:72: if (old_dvs & !new_dvs ||
arch/arm/mach-s3c2440/mach-osiris-dvs.c:73: cur_dvs & !new_dvs) {
arch/arm/mach-davinci/board-da850-evm.c:183: if (ui_card_detected & !HAS_MMC) {
drivers/scsi/libiscsi_tcp.c:423: if (conn->datadgst_en &
!(conn->session->tt->caps & CAP_DIGEST_OFFLOAD))
drivers/media/video/omap24xxcam-dma.c:509: if ((sglen < 0) || ((sglen > 0) & !sglist))
drivers/net/dm9000.c:615: else if (dm->wake_state & !opts)
drivers/net/myri10ge/myri10ge.c:2845: rdma_count += chop & !next_is_first;
fs/nilfs2/the_nilfs.c:516: nilfs->ns_prot_seq = le64_to_cpu(sbp[valid[1] & !swp]->s_last_seq);
sound/soc/codecs/stac9766.c:233: vra &= !0x04;
next reply other threads:[~2009-12-14 19:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-14 19:22 Joe Perches [this message]
2009-12-15 13:11 ` Clemens Ladisch
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=1260818577.18538.35.camel@Joe-Laptop.home \
--to=joe@perches.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®