diff mbox

[v2,09/10] cgroup: net_prio: Simplify ifdef logic

Message ID 1345816904-21745-10-git-send-email-wagi@monom.org
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Daniel Wagner Aug. 24, 2012, 2:01 p.m. UTC
From: Daniel Wagner <daniel.wagner@bmw-carit.de>

Signed-off-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Gao feng <gaofeng@cn.fujitsu.com>
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: John Fastabend <john.r.fastabend@intel.com>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: netdev@vger.kernel.org
Cc: cgroups@vger.kernel.org
---
 include/net/netprio_cgroup.h | 14 +++++++-------
 net/core/sock.c              |  2 ++
 2 files changed, 9 insertions(+), 7 deletions(-)

Comments

Tejun Heo Aug. 24, 2012, 11:42 p.m. UTC | #1
On Fri, Aug 24, 2012 at 04:01:43PM +0200, Daniel Wagner wrote:
> From: Daniel Wagner <daniel.wagner@bmw-carit.de>

Okay, for a few trivial patches, $SUBJ as description is fine but this
series is pushing it too far.  Is this equivalent conversion?  Why
does sock_update_netprioidx() earn an addition ifdef around it?  :(
diff mbox

Patch

diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index 66241c6..ab22019 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -18,14 +18,14 @@ 
 #include <linux/rcupdate.h>
 #include <linux/jump_label.h>
 
+#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
+
 struct netprio_map {
 	struct rcu_head rcu;
 	u32 priomap_len;
 	u32 priomap[];
 };
 
-#ifdef CONFIG_CGROUPS
-
 struct cgroup_netprio_state {
 	struct cgroup_subsys_state css;
 	u32 prioidx;
@@ -69,17 +69,17 @@  static inline u32 task_netprioidx(struct task_struct *p)
 	return idx;
 }
 
-#else
+#endif
+
+#else  /* !CONFIG_NETPRIO_CGROUP */
 
 static inline u32 task_netprioidx(struct task_struct *p)
 {
 	return 0;
 }
 
-#endif /* CONFIG_NETPRIO_CGROUP */
-
-#else
 #define sock_update_netprioidx(sk, task)
-#endif
+
+#endif  /* CONFIG_NETPRIO_CGROUP */
 
 #endif  /* _NET_CLS_CGROUP_H */
diff --git a/net/core/sock.c b/net/core/sock.c
index b1fadfd..115cd59 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1237,6 +1237,7 @@  void sock_update_classid(struct sock *sk)
 EXPORT_SYMBOL(sock_update_classid);
 #endif
 
+#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
 void sock_update_netprioidx(struct sock *sk, struct task_struct *task)
 {
 	if (in_interrupt())
@@ -1246,6 +1247,7 @@  void sock_update_netprioidx(struct sock *sk, struct task_struct *task)
 }
 EXPORT_SYMBOL_GPL(sock_update_netprioidx);
 #endif
+#endif
 
 /**
  *	sk_alloc - All socket objects are allocated here