From: Eric Sesterhenn <snakebyte@gmx.de>
To: linux-kernel@vger.kernel.org
Cc: brking@us.ibm.com
Subject: [Patch] Signedness issue in drivers/scsi/ipr.c
Date: Sat, 19 Aug 2006 21:13:55 +0200 [thread overview]
Message-ID: <1156014835.19657.3.camel@alice> (raw)
hi,
gcc 4.1 with some extra warnings show the following:
drivers/scsi/ipr.c:6361: warning: comparison of unsigned expression < 0 is always false
drivers/scsi/ipr.c:6385: warning: comparison of unsigned expression < 0 is always false
drivers/scsi/ipr.c:6415: warning: comparison of unsigned expression < 0 is always false
The problem is that rc is of the type u32, which can never be smaller than zero,
therefore all three error handling checks get useless. This patch changes it to
a normal int, because all usages / all functions it get used with expect an int.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
--- linux-2.6.18-rc4/drivers/scsi/ipr.c.orig 2006-08-19 21:10:18.000000000 +0200
+++ linux-2.6.18-rc4/drivers/scsi/ipr.c 2006-08-19 21:10:25.000000000 +0200
@@ -6324,7 +6324,7 @@ static int __devinit ipr_probe_ioa(struc
struct Scsi_Host *host;
unsigned long ipr_regs_pci;
void __iomem *ipr_regs;
- u32 rc = PCIBIOS_SUCCESSFUL;
+ int rc = PCIBIOS_SUCCESSFUL;
volatile u32 mask, uproc;
ENTER;
next reply other threads:[~2006-08-19 19:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-19 19:13 Eric Sesterhenn [this message]
2006-08-20 18:20 ` [Patch] Signedness issue in drivers/scsi/ipr.c Alan Cox
2006-08-20 18:56 ` Brian King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1156014835.19657.3.camel@alice \
--to=snakebyte@gmx.de \
--cc=brking@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox