public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] staging: comedi: comedi_bond: silence a shift wrapping warning
@ 2013-08-21  8:27 Dan Carpenter
  2013-08-21 10:50 ` Ian Abbott
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Dan Carpenter @ 2013-08-21  8:27 UTC (permalink / raw)
  To: kernel-janitors

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) {

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-08-22 19:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-21  8:27 [patch] staging: comedi: comedi_bond: silence a shift wrapping warning Dan Carpenter
2013-08-21 10:50 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox