2018-01-18 23:39:21

by Gustavo A. R. Silva

[permalink] [raw]
Subject: [PATCH] bridge: return boolean instead of integer in br_multicast_is_router

Return statements in functions returning bool should use
true/false instead of 1/0.

This issue was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <[email protected]>
---
net/bridge/br_private.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 80559fd..8e13a64 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -760,7 +760,7 @@ static inline void br_multicast_flood(struct net_bridge_mdb_entry *mdst,

static inline bool br_multicast_is_router(struct net_bridge *br)
{
- return 0;
+ return false;
}

static inline bool br_multicast_querier_exists(struct net_bridge *br,
--
2.7.4



2018-01-19 00:23:52

by Stephen Hemminger

[permalink] [raw]
Subject: Re: [PATCH] bridge: return boolean instead of integer in br_multicast_is_router

On Thu, 18 Jan 2018 17:37:45 -0600
"Gustavo A. R. Silva" <[email protected]> wrote:

> Return statements in functions returning bool should use
> true/false instead of 1/0.
>
> This issue was detected with the help of Coccinelle.
>
> Signed-off-by: Gustavo A. R. Silva <[email protected]>

LGTM

Fixes: 85b352693264 ("bridge: Fix build error when IGMP_SNOOPING is not enabled")
Reviewed-by: Stephen Hemminger <[email protected]>

2018-01-19 01:17:53

by Gustavo A. R. Silva

[permalink] [raw]
Subject: Re: [PATCH] bridge: return boolean instead of integer in br_multicast_is_router


Quoting Stephen Hemminger <[email protected]>:

> On Thu, 18 Jan 2018 17:37:45 -0600
> "Gustavo A. R. Silva" <[email protected]> wrote:
>
>> Return statements in functions returning bool should use
>> true/false instead of 1/0.
>>
>> This issue was detected with the help of Coccinelle.
>>
>> Signed-off-by: Gustavo A. R. Silva <[email protected]>
>
> LGTM
>
> Fixes: 85b352693264 ("bridge: Fix build error when IGMP_SNOOPING is
> not enabled")
> Reviewed-by: Stephen Hemminger <[email protected]>

Thanks Stephen.
--
Gustavo





2018-01-22 21:15:32

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] bridge: return boolean instead of integer in br_multicast_is_router

From: "Gustavo A. R. Silva" <[email protected]>
Date: Thu, 18 Jan 2018 17:37:45 -0600

> Return statements in functions returning bool should use
> true/false instead of 1/0.
>
> This issue was detected with the help of Coccinelle.
>
> Signed-off-by: Gustavo A. R. Silva <[email protected]>

Applied to net-next.