Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] Signdness issue in drivers/scsi/osst.c

another signdness warning from gcc 4.1

drivers/scsi/osst.c:5154: warning: comparison of unsigned expression < 0 is always false

The problem is that blk is defined as unsigned, but all usages of it are
normal int cases. osst_get_frame_position() and osst_get_sector() return ints
and can return negative values. If blk stays an unsigned int, the error check
is useless.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by

Eric Sesterhenn and committed by
James Bottomley
45223fd7 53aefd3f

+1 -2
+1 -2
drivers/scsi/osst.c
··· 4843 4843 static int osst_ioctl(struct inode * inode,struct file * file, 4844 4844 unsigned int cmd_in, unsigned long arg) 4845 4845 { 4846 - int i, cmd_nr, cmd_type, retval = 0; 4847 - unsigned int blk; 4846 + int i, cmd_nr, cmd_type, blk, retval = 0; 4848 4847 struct st_modedef * STm; 4849 4848 struct st_partstat * STps; 4850 4849 struct osst_request * SRpnt = NULL;