batman-adv: fix boolreturn.cocci warnings

Message ID 20160706024929.GA25250@lkp-nex05 (mailing list archive)
State Accepted, archived
Commit 36e731685be1c754612d57d1b375623147544492
Delegated to: Marek Lindner
Headers

Commit Message

kbuild test robot July 6, 2016, 2:49 a.m. UTC
  net/batman-adv/bridge_loop_avoidance.c:1105:9-10: WARNING: return of 0/1 in function 'batadv_bla_process_claim' with return type bool

 Return statements in functions returning bool should use
 true/false instead of 1/0.
Generated by: scripts/coccinelle/misc/boolreturn.cocci

CC: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 bridge_loop_avoidance.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Sven Eckelmann July 6, 2016, 6:12 a.m. UTC | #1
On Wednesday 06 July 2016 10:49:29 kbuild test robot wrote:
> net/batman-adv/bridge_loop_avoidance.c:1105:9-10: WARNING: return of 0/1 in function 'batadv_bla_process_claim' with return type bool
> 
>  Return statements in functions returning bool should use
>  true/false instead of 1/0.
> Generated by: scripts/coccinelle/misc/boolreturn.cocci
> 
> CC: Sven Eckelmann <sven@narfation.org>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---

Reviewed-by: Sven Eckelmann <sven@narfation.org>

The problematic commit is in batman-adv.git (next):

Fixes: a998bf5dfbd7 ("batman-adv: add detection for complex bridge loops")

And in net-next.git (due to some reordering)

Fixes: 4b426b108ac8 ("batman-adv: Use bool as return type for boolean functions")


Thanks,
	Sven
> 
>  bridge_loop_avoidance.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/net/batman-adv/bridge_loop_avoidance.c
> +++ b/net/batman-adv/bridge_loop_avoidance.c
> @@ -1102,7 +1102,7 @@ static bool batadv_bla_process_claim(str
>  
>  	/* Let the loopdetect frames on the mesh in any case. */
>  	if (bla_dst->type == BATADV_CLAIM_TYPE_LOOPDETECT)
> -		return 0;
> +		return false;
>  
>  	/* check if it is a claim frame. */
>  	ret = batadv_check_claim_group(bat_priv, primary_if, hw_src, hw_dst,
  
Sven Eckelmann July 6, 2016, 7:26 a.m. UTC | #2
On Wednesday 06 July 2016 08:12:09 Sven Eckelmann wrote:
> On Wednesday 06 July 2016 10:49:29 kbuild test robot wrote:
> > net/batman-adv/bridge_loop_avoidance.c:1105:9-10: WARNING: return of 0/1 in function 'batadv_bla_process_claim' with return type bool
> > 
> >  Return statements in functions returning bool should use
> >  true/false instead of 1/0.
> > Generated by: scripts/coccinelle/misc/boolreturn.cocci
> > 
> > CC: Sven Eckelmann <sven@narfation.org>
> > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> > ---
> 
> Reviewed-by: Sven Eckelmann <sven@narfation.org>
> 
> The problematic commit is in batman-adv.git (next):
> 
> Fixes: a998bf5dfbd7 ("batman-adv: add detection for complex bridge loops")

Sorry, I meant maint and not next. It was already part of v2016.2

@Marek not sure where you want to apply it. It should have no effect
on the actual functionality.

Kind regards,
	Sven
  
Marek Lindner July 6, 2016, 1:44 p.m. UTC | #3
On Wednesday, July 06, 2016 10:49:29 kbuild test robot wrote:
> net/batman-adv/bridge_loop_avoidance.c:1105:9-10: WARNING: return of 0/1 in
> function 'batadv_bla_process_claim' with return type bool
> 
>  Return statements in functions returning bool should use
>  true/false instead of 1/0.
> Generated by: scripts/coccinelle/misc/boolreturn.cocci
> 
> CC: Sven Eckelmann <sven@narfation.org>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
> 
>  bridge_loop_avoidance.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied in revision 36e7316.

Thanks,
Marek
  

Patch

--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1102,7 +1102,7 @@  static bool batadv_bla_process_claim(str
 
 	/* Let the loopdetect frames on the mesh in any case. */
 	if (bla_dst->type == BATADV_CLAIM_TYPE_LOOPDETECT)
-		return 0;
+		return false;
 
 	/* check if it is a claim frame. */
 	ret = batadv_check_claim_group(bat_priv, primary_if, hw_src, hw_dst,