Skip to contentSkip to conversation

drivers/message/i2o/i2o_block.c unsigned comparison

PATCH In review Gabriel A. Devenyi 2 participants 3 messages Nov 12, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/message/i2o/i2o_block.c unsigned comparison

In i2o_block_ioctl, the parameter arg is declared an unsigned long, but then compared < 0, which is meaningless. This redefines arg as a long, so that comparison is meaningful.

Thanks to LinuxICC (http://linuxicc.sf.net)

drivers/message/i2o/i2o_block.c +1 -1
index f283b5b..6bd8083 100644
@@ -670,7 +670,7 @@ static int i2o_block_release(struct inod
  *	Return 0 on success or negative error on failure.
  */
 static int i2o_block_ioctl(struct inode *inode, struct file *file,
-			   unsigned int cmd, unsigned long arg)
+			   unsigned int cmd, long arg)
 {
 	struct gendisk *disk = inode->i_bdev->bd_disk;
 	struct i2o_block_device *dev = disk->private_data;
Signature · 2 lines
Gabriel A. Devenyi
[email protected]
#1 lore raw

drivers/message/i2o/i2o_block.c static int i2o_block_release(struct inod · line 674

Quoted 7 lines · Gabriel A. Devenyi
drivers/message/i2o/i2o_block.c +1 -1
 
 static int i2o_block_ioctl(struct inode *inode, struct file *file,
-			   unsigned int cmd, unsigned long arg)
+			   unsigned int cmd, long arg)
 {

Don't you see this?

CC drivers/message/i2o/i2o_block.o
drivers/message/i2o/i2o_block.c:961: warning: initialization from incompatible pointer type

->ioctl method takes "unsigned long arg".

#2 lore raw
Quoted 1 line · Alexey Dobriyan

Don't you see this?

*turns red* I just checked for a compile error, sorry.

Quoted 4 lines

CC drivers/message/i2o/i2o_block.o
drivers/message/i2o/i2o_block.c:961: warning: initialization from incompatible pointer type

->ioctl method takes "unsigned long arg".

So should this comparasion arg < 0 simply be removed? Its meaningless if arg is unsigned.

Signature · 2 lines
Gabriel A. Devenyi
[email protected]