public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian King <brking@us.ibm.com>
To: Eric Sesterhenn <snakebyte@gmx.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [Patch] Signedness issue in drivers/scsi/ipr.c
Date: Sun, 20 Aug 2006 13:56:26 -0500	[thread overview]
Message-ID: <44E8B05A.1090105@us.ibm.com> (raw)
In-Reply-To: <1156014835.19657.3.camel@alice>

Eric Sesterhenn wrote:
> 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

Acked-by: Brian King <brking@us.ibm.com>

> 
> 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;
> 
> 


      parent reply	other threads:[~2006-08-20 18:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-19 19:13 [Patch] Signedness issue in drivers/scsi/ipr.c Eric Sesterhenn
2006-08-20 18:20 ` Alan Cox
2006-08-20 18:56 ` Brian King [this message]

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=44E8B05A.1090105@us.ibm.com \
    --to=brking@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=snakebyte@gmx.de \
    /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