All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sesterhenn / snakebyte <snakebyte@gmx.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [Patch] Check unsigned < 0 in /drivers/net/acenic.c
Date: Mon, 09 Jan 2006 14:25:21 +0000	[thread overview]
Message-ID: <1136816722.14848.1.camel@alice> (raw)
In-Reply-To: <1134691549.14588.3.camel@alice>

[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]

On Mon, 2006-01-09 at 00:15 +0300, Alexey Dobriyan wrote:
> Looks like there are two different tmps: one for read_eeprom_byte,
> another for writing to PCI state.

guess, this patch is better then. but maybe you can suggest
a better variable name then tmp2... :)

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.15/drivers/net/acenic.c.orig	2006-01-09 15:22:53.000000000 +0100
+++ linux-2.6.15/drivers/net/acenic.c	2006-01-09 15:23:55.000000000 +0100
@@ -906,7 +906,7 @@ static int __devinit ace_init(struct net
 	unsigned long myjif;
 	u64 tmp_ptr;
 	u32 tig_ver, mac1, mac2, tmp, pci_state;
-	int board_idx, ecode = 0;
+	int board_idx, tmp2, ecode = 0;
 	short i;
 	unsigned char cache_size;
 
@@ -1003,22 +1003,22 @@ static int __devinit ace_init(struct net
 	mac1 = 0;
 	for(i = 0; i < 4; i++) {
 		mac1 = mac1 << 8;
-		tmp = read_eeprom_byte(dev, 0x8c+i);
-		if (tmp < 0) {
+		tmp2 = read_eeprom_byte(dev, 0x8c+i);
+		if (tmp2 < 0) {
 			ecode = -EIO;
 			goto init_error;
 		} else
-			mac1 |= (tmp & 0xff);
+			mac1 |= (tmp2 & 0xff);
 	}
 	mac2 = 0;
 	for(i = 4; i < 8; i++) {
 		mac2 = mac2 << 8;
-		tmp = read_eeprom_byte(dev, 0x8c+i);
-		if (tmp < 0) {
+		tmp2 = read_eeprom_byte(dev, 0x8c+i);
+		if (tmp2 < 0) {
 			ecode = -EIO;
 			goto init_error;
 		} else
-			mac2 |= (tmp & 0xff);
+			mac2 |= (tmp2 & 0xff);
 	}
 
 	writel(mac1, &regs->MacAddrHi);



[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2006-01-09 14:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-16  0:05 [KJ] [Patch] Check unsigned < 0 in /drivers/net/acenic.c Eric Sesterhenn / snakebyte
2006-01-08 21:15 ` Alexey Dobriyan
2006-01-09 14:25 ` Eric Sesterhenn / snakebyte [this message]
2006-01-11 15:55 ` Alexey Dobriyan

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=1136816722.14848.1.camel@alice \
    --to=snakebyte@gmx.de \
    --cc=kernel-janitors@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 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.