All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian King <brking@us.ibm.com>
To: akpm@osdl.org
Cc: James.Bottomley@steeleye.com, linux-scsi@vger.kernel.org,
	snakebyte@gmx.de
Subject: Re: [patch 21/28] Signedness issue in drivers/scsi/ipr.c
Date: Tue, 26 Sep 2006 08:10:41 -0500	[thread overview]
Message-ID: <451926D1.2070309@us.ibm.com> (raw)
In-Reply-To: <200609252359.k8PNx7vJ003518@shell0.pdx.osdl.net>

ACK

akpm@osdl.org wrote:
> From: Eric Sesterhenn <snakebyte@gmx.de>
> 
> 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>
> Cc: James Bottomley <James.Bottomley@steeleye.com>
> Cc: Brian King <brking@us.ibm.com>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> ---
> 
>  drivers/scsi/ipr.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -puN drivers/scsi/ipr.c~signedness-issue-in-drivers-scsi-iprc drivers/scsi/ipr.c
> --- a/drivers/scsi/ipr.c~signedness-issue-in-drivers-scsi-iprc
> +++ a/drivers/scsi/ipr.c
> @@ -6352,7 +6352,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;
> _
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Brian King
eServer Storage I/O
IBM Linux Technology Center

      reply	other threads:[~2006-09-26 13:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-25 23:59 [patch 21/28] Signedness issue in drivers/scsi/ipr.c akpm
2006-09-26 13:10 ` 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=451926D1.2070309@us.ibm.com \
    --to=brking@us.ibm.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=akpm@osdl.org \
    --cc=linux-scsi@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.