[PATCH] bonding: fix sparse warning

STALE5647d

3 messages, 3 authors, 2011-02-28 · open the first message on its own page

[PATCH] bonding: fix sparse warning

From: Stephen Hemminger <hidden>
Date: 2011-02-23 17:40:35

Fix use of zero where NULL expected. And wrap long line.

Signed-off-by: Stephen Hemminger <redacted>
--- a/drivers/net/bonding/bonding.h	2011-02-23 09:33:39.493248155 -0800
+++ b/drivers/net/bonding/bonding.h	2011-02-23 09:33:48.825356637 -0800
@@ -265,7 +265,8 @@ struct bonding {
  *
  * Caller must hold bond lock for read
  */
-static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev)
+static inline struct slave *bond_get_slave_by_dev(struct bonding *bond,
+						  struct net_device *slave_dev)
 {
 	struct slave *slave = NULL;
 	int i;
@@ -276,7 +277,7 @@ static inline struct slave *bond_get_sla
 		}
 	}
 
-	return 0;
+	return NULL;
 }
 
 static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)

Re: [PATCH] bonding: fix sparse warning

From: Jay Vosburgh <hidden>
Date: 2011-02-23 22:29:07

Stephen Hemminger [off-list ref] wrote:
Fix use of zero where NULL expected. And wrap long line.

Signed-off-by: Stephen Hemminger <redacted>
Signed-off-by: Jay Vosburgh <redacted>

quoted hunk
--- a/drivers/net/bonding/bonding.h	2011-02-23 09:33:39.493248155 -0800
+++ b/drivers/net/bonding/bonding.h	2011-02-23 09:33:48.825356637 -0800
@@ -265,7 +265,8 @@ struct bonding {
 *
 * Caller must hold bond lock for read
 */
-static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct net_device *slave_dev)
+static inline struct slave *bond_get_slave_by_dev(struct bonding *bond,
+						  struct net_device *slave_dev)
{
	struct slave *slave = NULL;
	int i;
@@ -276,7 +277,7 @@ static inline struct slave *bond_get_sla
		}
	}

-	return 0;
+	return NULL;
}

static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)

Re: [PATCH] bonding: fix sparse warning

From: David Miller <davem@davemloft.net>
Date: 2011-02-28 20:39:49

From: Stephen Hemminger <redacted>
Date: Wed, 23 Feb 2011 09:40:33 -0800
Fix use of zero where NULL expected. And wrap long line.

Signed-off-by: Stephen Hemminger <redacted>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help