diff mbox

[net-next,5/6] sched: add missing curly braces in else branch in tc_ctl_tfilter

Message ID 1486647540-14656-6-git-send-email-jiri@resnulli.us
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Jiri Pirko Feb. 9, 2017, 1:38 p.m. UTC
From: Jiri Pirko <jiri@mellanox.com>

Curly braces need to be there, for stylistic reasons.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
 net/sched/cls_api.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jamal Hadi Salim Feb. 9, 2017, 6:27 p.m. UTC | #1
On 17-02-09 08:38 AM, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@mellanox.com>
>
> Curly braces need to be there, for stylistic reasons.
>
> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
> ---
>  net/sched/cls_api.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> index f44378c..48864ad 100644
> --- a/net/sched/cls_api.c
> +++ b/net/sched/cls_api.c
> @@ -315,8 +315,9 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n)
>  					err = -EINVAL;
>  					goto errout;
>  				}
> -			} else
> +			} else {
>  				tp = NULL;
> +			}
>  			break;
>  		}
>  	}
>

Jiri, shall we engage in a long discussion about which rule says that
you can put braces around one line branching? ;->

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal
Jiri Pirko Feb. 9, 2017, 9:45 p.m. UTC | #2
Thu, Feb 09, 2017 at 07:27:10PM CET, jhs@mojatatu.com wrote:
>On 17-02-09 08:38 AM, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@mellanox.com>
>> 
>> Curly braces need to be there, for stylistic reasons.
>> 
>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>> ---
>>  net/sched/cls_api.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
>> index f44378c..48864ad 100644
>> --- a/net/sched/cls_api.c
>> +++ b/net/sched/cls_api.c
>> @@ -315,8 +315,9 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n)
>>  					err = -EINVAL;
>>  					goto errout;
>>  				}
>> -			} else
>> +			} else {
>>  				tp = NULL;
>> +			}
>>  			break;
>>  		}
>>  	}
>> 
>
>Jiri, shall we engage in a long discussion about which rule says that
>you can put braces around one line branching? ;->

scripts/checkpatch.pl :)


>
>Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
>
>cheers,
>jamal
diff mbox

Patch

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index f44378c..48864ad 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -315,8 +315,9 @@  static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n)
 					err = -EINVAL;
 					goto errout;
 				}
-			} else
+			} else {
 				tp = NULL;
+			}
 			break;
 		}
 	}