Skip to content

Commit

Permalink
drivers/net/bonding: fix sparse warning: symbol shadows an earlier one
Browse files Browse the repository at this point in the history
Impact: Rename function scope variable.

Fix this sparse warning:
  drivers/net/bonding/bond_main.c:4704:13: warning: symbol 'mode' shadows an earlier one
  drivers/net/bonding/bond_main.c:95:13: originally declared here

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Hannes Eder authored and David S. Miller committed Feb 18, 2009
1 parent 1f78d9f commit 54b8732
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4732,7 +4732,7 @@ static void bond_free_all(void)
*/
int bond_parse_parm(const char *buf, const struct bond_parm_tbl *tbl)
{
int mode = -1, i, rv;
int modeint = -1, i, rv;
char *p, modestr[BOND_MAX_MODENAME_LEN + 1] = { 0, };

for (p = (char *)buf; *p; p++)
Expand All @@ -4742,13 +4742,13 @@ int bond_parse_parm(const char *buf, const struct bond_parm_tbl *tbl)
if (*p)
rv = sscanf(buf, "%20s", modestr);
else
rv = sscanf(buf, "%d", &mode);
rv = sscanf(buf, "%d", &modeint);

if (!rv)
return -1;

for (i = 0; tbl[i].modename; i++) {
if (mode == tbl[i].mode)
if (modeint == tbl[i].mode)
return tbl[i].mode;
if (strcmp(modestr, tbl[i].modename) == 0)
return tbl[i].mode;
Expand Down

0 comments on commit 54b8732

Please sign in to comment.