netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Jay Vousburgh <fubar@us.ibm.com>
Cc: bonding-devel@lists.sourceforge.net, netdev@vger.kernel.org
Subject: [PATCH 2/6] bonding: fix sparse warnings
Date: Fri, 17 Oct 2008 21:32:54 -0700	[thread overview]
Message-ID: <20081018043323.468786924@vyatta.com> (raw)
In-Reply-To: 20081018043252.968940967@vyatta.com

[-- Attachment #1: bonding-sparse.patch --]
[-- Type: text/plain, Size: 1997 bytes --]

This fixes sparse warnings due to normal locking, and shadowed variable.
There is still one warning but it is valid, and caused by some dubious locking
in the failover MAC assignment.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/drivers/net/bonding/bond_main.c	2008-10-17 15:45:13.000000000 -0700
+++ b/drivers/net/bonding/bond_main.c	2008-10-17 18:59:11.000000000 -0700
@@ -3173,6 +3173,7 @@ out:
 #ifdef CONFIG_PROC_FS
 
 static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
+	__acquires(dev_base_lock) __acquires(bond->lock)
 {
 	struct bonding *bond = seq->private;
 	loff_t off = 0;
@@ -3212,6 +3213,7 @@ static void *bond_info_seq_next(struct s
 }
 
 static void bond_info_seq_stop(struct seq_file *seq, void *v)
+	__releases(dev_base_lock) __releases(bond->lock)
 {
 	struct bonding *bond = seq->private;
 
@@ -4662,7 +4664,7 @@ static void bond_free_all(void)
  */
 int bond_parse_parm(const char *buf, struct bond_parm_tbl *tbl)
 {
-	int mode = -1, i, rv;
+	int newmode = -1, i, rv;
 	char *p, modestr[BOND_MAX_MODENAME_LEN + 1] = { 0, };
 
 	for (p = (char *)buf; *p; p++)
@@ -4672,13 +4674,13 @@ int bond_parse_parm(const char *buf, str
 	if (*p)
 		rv = sscanf(buf, "%20s", modestr);
 	else
-		rv = sscanf(buf, "%d", &mode);
+		rv = sscanf(buf, "%d", &newmode);
 
 	if (!rv)
 		return -1;
 
 	for (i = 0; tbl[i].modename; i++) {
-		if (mode == tbl[i].mode)
+		if (newmode == tbl[i].mode)
 			return tbl[i].mode;
 		if (strcmp(modestr, tbl[i].modename) == 0)
 			return tbl[i].mode;
--- a/drivers/net/bonding/bonding.h	2008-10-17 15:45:13.000000000 -0700
+++ b/drivers/net/bonding/bonding.h	2008-10-17 16:48:26.000000000 -0700
@@ -336,6 +336,7 @@ void bond_register_arp(struct bonding *)
 void bond_unregister_arp(struct bonding *);
 
 /* exported from bond_main.c */
+extern struct bond_params bonding_defaults;
 extern struct list_head bond_dev_list;
 extern struct bond_parm_tbl bond_lacp_tbl[];
 extern struct bond_parm_tbl bond_mode_tbl[];

-- 


  parent reply	other threads:[~2008-10-18  4:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-18  4:32 [PATCH 0/6] bonding related patches Stephen Hemminger
2008-10-18  4:32 ` [PATCH 1/6] bonding: allow configuration without sysfs Stephen Hemminger
2008-10-18  4:32 ` Stephen Hemminger [this message]
2008-10-18  4:32 ` [PATCH 3/6] bonding: event driven carrier detection Stephen Hemminger
2008-10-18  4:32 ` [PATCH 4/6] netdev: allow rejecting MTU changes from notifiers Stephen Hemminger
2008-10-18  4:32 ` [PATCH 5/6] bonding: prevent MTU changes in slave devices Stephen Hemminger
2008-10-18  4:32 ` [PATCH 6/6] bonding: remove change name TODO Stephen Hemminger

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=20081018043323.468786924@vyatta.com \
    --to=shemminger@vyatta.com \
    --cc=bonding-devel@lists.sourceforge.net \
    --cc=fubar@us.ibm.com \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).