diff mbox

bridge: return value for br_stp_recalculate_bridge_id()

Message ID 1301466207-16770-1-git-send-email-dongdong.deng@windriver.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Dongdong Deng March 30, 2011, 6:23 a.m. UTC
Return 'false' for "user has set a mac addr" case in
br_stp_recalculate_bridge_id() function.

and this could address the following build warning:

net/bridge/br_stp_if.c: In function br_stp_recalculate_bridge_id:
net/bridge/br_stp_if.c:216: warning: return with no value, in function
returning non-void

Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
---
 net/bridge/br_stp_if.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

stephen hemminger March 30, 2011, 6:27 a.m. UTC | #1
On Wed, 30 Mar 2011 14:23:27 +0800
Dongdong Deng <dongdong.deng@windriver.com> wrote:

> Return 'false' for "user has set a mac addr" case in
> br_stp_recalculate_bridge_id() function.
> 
> and this could address the following build warning:
> 
> net/bridge/br_stp_if.c: In function br_stp_recalculate_bridge_id:
> net/bridge/br_stp_if.c:216: warning: return with no value, in function
> returning non-void
> 
> Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>

Patch has already been submitted and acke'd for this.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger March 31, 2011, 5:38 p.m. UTC | #2
Reported 3 times and already fixed.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andrew Morton March 31, 2011, 10:31 p.m. UTC | #3
On Thu, 31 Mar 2011 10:38:22 -0700
Stephen Hemminger <shemminger@vyatta.com> wrote:

> Reported 3 times and already fixed.

Four times!

Heaven knows why gcc treats that as a warning and not an error.  It's a
guaranteed runtime bug.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 5593f5a..9b61d09 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -213,7 +213,7 @@  bool br_stp_recalculate_bridge_id(struct net_bridge *br)
 
 	/* user has chosen a value so keep it */
 	if (br->flags & BR_SET_MAC_ADDR)
-		return;
+		return false;
 
 	list_for_each_entry(p, &br->port_list, list) {
 		if (addr == br_mac_zero ||