netdev
[Top] [All Lists]

[PATCH] PKT_SCHED: remove c99ism

To: Andrew Morton <akpm@xxxxxxxx>
Subject: [PATCH] PKT_SCHED: remove c99ism
From: Thomas Graf <tgraf@xxxxxxx>
Date: Sun, 16 Jan 2005 00:40:56 +0100
Cc: davem@xxxxxxxxxxxxx, netdev@xxxxxxxxxxx
In-reply-to: <20050115153202.2f7f81c6.akpm@osdl.org>
References: <20050115144010.33182075.akpm@osdl.org> <20050115232554.GS26856@postel.suug.ch> <20050115153202.2f7f81c6.akpm@osdl.org>
Sender: netdev-bounce@xxxxxxxxxxx
* Andrew Morton <20050115153202.2f7f81c6.akpm@xxxxxxxx> 2005-01-15 15:32
> An uglier but more efficient approach is to whack braces around the whole
> thing.

Fine with me as well. The code isn't used that often and not deep in the
calling stack which is why I preferred the cleaner way first.

Signed-off-by: Thomas Graf <tgraf@xxxxxxx>

--- linux-2.6.11-rc1-bk2.orig/net/sched/cls_api.c       2005-01-16 
00:04:40.000000000 +0100
+++ linux-2.6.11-rc1-bk2/net/sched/cls_api.c    2005-01-16 00:34:53.000000000 
+0100
@@ -486,24 +486,26 @@
        memset(exts, 0, sizeof(*exts));
        
 #ifdef CONFIG_NET_CLS_ACT
-       int err;
-       struct tc_action *act;
+       {
+               int err;
+               struct tc_action *act;
 
-       if (map->police && tb[map->police-1]) {
-               act = tcf_action_init_1(tb[map->police-1], rate_tlv, "police",
-                       TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err);
-               if (act == NULL)
-                       return err;
-
-               act->type = TCA_OLD_COMPAT;
-               exts->action = act;
-       } else if (map->action && tb[map->action-1]) {
-               act = tcf_action_init(tb[map->action-1], rate_tlv, NULL,
-                       TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err);
-               if (act == NULL)
-                       return err;
+               if (map->police && tb[map->police-1]) {
+                       act = tcf_action_init_1(tb[map->police-1], rate_tlv, 
"police",
+                               TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err);
+                       if (act == NULL)
+                               return err;
+
+                       act->type = TCA_OLD_COMPAT;
+                       exts->action = act;
+               } else if (map->action && tb[map->action-1]) {
+                       act = tcf_action_init(tb[map->action-1], rate_tlv, NULL,
+                               TCA_ACT_NOREPLACE, TCA_ACT_BIND, &err);
+                       if (act == NULL)
+                               return err;
 
-               exts->action = act;
+                       exts->action = act;
+               }
        }
 #elif defined CONFIG_NET_CLS_POLICE
        if (map->police && tb[map->police-1]) {

<Prev in Thread] Current Thread [Next in Thread>