From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: [patch] staging: comedi: comedi_bond: silence a shift wrapping warning
Date: Wed, 21 Aug 2013 08:27:27 +0000 [thread overview]
Message-ID: <20130821082727.GB5240@elgon.mountain> (raw)
We set this using:
devs_closed |= (0x1 << bdev->minor)
Since 0x1 is an int then only the lower 32 bits are usable before we hit
a shift wrapping bug. There are some static checkers which complain
about this. I've silenced the warning by making devs_closed a 32 bit
number.
32 bits should be enough for anybody.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/staging/comedi/drivers/comedi_bond.c b/drivers/staging/comedi/drivers/comedi_bond.c
index 7e20bf0..8f6c942 100644
--- a/drivers/staging/comedi/drivers/comedi_bond.c
+++ b/drivers/staging/comedi/drivers/comedi_bond.c
@@ -335,7 +335,7 @@ static int bonding_attach(struct comedi_device *dev,
static void bonding_detach(struct comedi_device *dev)
{
struct comedi_bond_private *devpriv = dev->private;
- unsigned long devs_closed = 0;
+ unsigned int devs_closed = 0;
if (devpriv) {
while (devpriv->ndevs-- && devpriv->devs) {
next reply other threads:[~2013-08-21 8:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-21 8:27 Dan Carpenter [this message]
2013-08-21 10:50 ` [patch] staging: comedi: comedi_bond: silence a shift wrapping warning Ian Abbott
2013-08-21 12:45 ` Dan Carpenter
2013-08-21 16:44 ` Ian Abbott
2013-08-21 20:08 ` Dan Carpenter
2013-08-22 19:21 ` Ian Abbott
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=20130821082727.GB5240@elgon.mountain \
--to=dan.carpenter@oracle.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox