]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pktcdvd: silence static checker warning
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 16 May 2013 08:11:08 +0000 (11:11 +0300)
committerJiri Kosina <jkosina@suse.cz>
Wed, 29 May 2013 13:36:22 +0000 (15:36 +0200)
Static checkers complain about widening the binary "not" operations here
because sectors are u64 and "(pd)->settings.size" is unsigned int.
It unintentionally clears the high 32 bits of the sector.  This means
that the driver won't work for devices with over 2TB of space.  Since
this is a DVD drive, we're unlikely to reach that limit, but we may as
well silence the warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/block/pktcdvd.c

index 3c08983e600a0a15e1380e9de1e6f50714fe3976..f5d0ea11d9fda8a4f1b8ad3f23d285bb7887250b 100644 (file)
@@ -83,7 +83,8 @@
 
 #define MAX_SPEED 0xffff
 
-#define ZONE(sector, pd) (((sector) + (pd)->offset) & ~((pd)->settings.size - 1))
+#define ZONE(sector, pd) (((sector) + (pd)->offset) & \
+                       ~(sector_t)((pd)->settings.size - 1))
 
 static DEFINE_MUTEX(pktcdvd_mutex);
 static struct pktcdvd_device *pkt_devs[MAX_WRITERS];