[3/4] batman-adv: Use {} braces consistent on the arms of a statement

Message ID 1331419491-21333-4-git-send-email-lindner_marek@yahoo.de (mailing list archive)
State Not Applicable, archived
Headers

Commit Message

Marek Lindner March 10, 2012, 10:44 p.m. UTC
  From: Sven Eckelmann <sven@narfation.org>

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
 net/batman-adv/routing.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
  

Comments

David Laight March 12, 2012, 1:16 p.m. UTC | #1
> diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
> index 01b66d4..7f8e158 100644
> --- a/net/batman-adv/routing.c
> +++ b/net/batman-adv/routing.c
> @@ -237,8 +237,9 @@ int window_protected(struct bat_priv 
> *bat_priv, int32_t seq_num_diff,
>  				"old packet received, start
protection\n");
>  
>  			return 0;
> -		} else
> +		} else {
>  			return 1;
> +		}
>  	}
>  	return 0;
>  }

Doesn't this one fail on the "don't use 'else' after return/break" ?
Also look like it would read better if the condition (not quoted)
were inverted and the 'return 1' put first.

	David
  

Patch

diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 01b66d4..7f8e158 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -237,8 +237,9 @@  int window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff,
 				"old packet received, start protection\n");
 
 			return 0;
-		} else
+		} else {
 			return 1;
+		}
 	}
 	return 0;
 }