* [Patch] Signdness issue in drivers/scsi/osst.c
@ 2006-08-19 19:19 Eric Sesterhenn
2006-08-20 18:18 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: Eric Sesterhenn @ 2006-08-19 19:19 UTC (permalink / raw)
To: linux-kernel; +Cc: osst
Hi,
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>
--- linux-2.6.18-rc4/drivers/scsi/osst.c.orig 2006-08-19 21:16:48.000000000 +0200
+++ linux-2.6.18-rc4/drivers/scsi/osst.c 2006-08-19 21:16:56.000000000 +0200
@@ -4843,8 +4843,7 @@ static int os_scsi_tape_close(struct ino
static int osst_ioctl(struct inode * inode,struct file * file,
unsigned int cmd_in, unsigned long arg)
{
- int i, cmd_nr, cmd_type, retval = 0;
- unsigned int blk;
+ int i, cmd_nr, cmd_type, blk, retval = 0;
struct st_modedef * STm;
struct st_partstat * STps;
struct osst_request * SRpnt = NULL;
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [Patch] Signdness issue in drivers/scsi/osst.c
2006-08-19 19:19 [Patch] Signdness issue in drivers/scsi/osst.c Eric Sesterhenn
@ 2006-08-20 18:18 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2006-08-20 18:18 UTC (permalink / raw)
To: Eric Sesterhenn; +Cc: linux-kernel, osst
Ar Sad, 2006-08-19 am 21:19 +0200, ysgrifennodd Eric Sesterhenn:
> Hi,
>
> 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.
Acked-by: Alan Cox <alan@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-20 17:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-19 19:19 [Patch] Signdness issue in drivers/scsi/osst.c Eric Sesterhenn
2006-08-20 18:18 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome