net: netprio_cgroup: make net_prio_subsys static
Subsystems (2)
PATCH 1/1 net: netprio_cgroup: make net_prio_subsys static
net_prio_subsys can be made static this removes the sparse warning it was throwing.
---
net/core/netprio_cgroup.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/core/netprio_cgroup.c +1 -1
@@ -28,7 +28,7 @@ static struct cgroup_subsys_state *cgrp_create(struct cgroup_subsys *ss,static void cgrp_destroy (struct cgroup_subsys *ss,struct cgroup *cgrp);static int cgrp_populate (struct cgroup_subsys *ss,struct cgroup *cgrp); -struct cgroup_subsys net_prio_subsys = { +static struct cgroup_subsys net_prio_subsys = { .name ="net_prio" , .create = cgrp_create, .destroy = cgrp_destroy,
Quoted 16 lines · John Fastabend
net_prio_subsyscan be made static this removes the sparse warning it was throwing.Signed-off-by John Fastabend <[email protected]>---
net/core/netprio_cgroup.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)net/core/netprio_cgroup.c +0
-0
net/core/netprio_cgroup.c static struct cgroup_subsys_state *cgrp_create(struct cgroup_subsys *ss, · line 34
Quoted 8 lines
net/core/netprio_cgroup.c +1
-1@@ -28,7 +28,7 @@ static struct cgroup_subsys_state *cgrp_create(struct cgroup_subsys *ss,static void cgrp_destroy (struct cgroup_subsys *ss,struct cgroup *cgrp);static int cgrp_populate (struct cgroup_subsys *ss,struct cgroup *cgrp); -struct cgroup_subsys net_prio_subsys = { +static struct cgroup_subsys net_prio_subsys = { .name ="net_prio" , .create = cgrp_create, .destroy = cgrp_destroy,
Thanks John.
From: Neil Horman <[email protected]>
Date: Thu, 8 Dec 2011 06:45:55 -0500
Quoted 5 lines · John Fastabend
Quoted 4 lines
net_prio_subsyscan be made static this removes the sparse warning it was throwing.Signed-off-by John Fastabend <[email protected]>
...
Quoted 1 line
Acked-by Neil Horman <[email protected]>
Applied.
Quoted 7 lines · David Miller
From: Neil Horman <[email protected]>
Date: Thu, 8 Dec 2011 06:45:55 -0500Quoted 4 lines · John Fastabend
Quoted 3 lines
net_prio_subsyscan be made static this removes the sparse warning it was throwing.
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Signed-off-by John Fastabend <[email protected]>...
Quoted 1 line
Acked-by Neil Horman <[email protected]>Applied.
--
But it trivialy breaks the build ? Or am I mistaken ?
$ grep CONFIG_NETPRIO_CGROUP .config CONFIG_NETPRIO_CGROUP=y
$ make net/core/netprio_cgroup.o CC net/core/netprio_cgroup.o net/core/netprio_cgroup.c:31:29: error: static declaration of ‘net_prio_subsys’ follows non-static declaration include/linux/cgroup_subsys.h:71:1: note: previous declaration of ‘net_prio_subsys’ was here make[1]: *** [net/core/netprio_cgroup.o] Error 1 make: *** [net/core/netprio_cgroup.o] Error 2
Quoted 8 lines · Eric Dumazet
Quoted 7 lines · David Miller
From: Neil Horman <[email protected]>
Date: Thu, 8 Dec 2011 06:45:55 -0500Quoted 4 lines · John Fastabend
Quoted 3 lines
net_prio_subsyscan be made static this removes the sparse warning it was throwing.
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Signed-off-by John Fastabend <[email protected]>...
Quoted 1 line
Acked-by Neil Horman <[email protected]>Applied.
--But it trivialy breaks the build ? Or am I mistaken ?
Dang. No your right. When its not built as a module it breaks. Sorry I'll revert it.
Quoted 13 lines
$ grep CONFIG_NETPRIO_CGROUP .config CONFIG_NETPRIO_CGROUP=y$ make net/core/netprio_cgroup.o CC net/core/netprio_cgroup.o net/core/netprio_cgroup.c:31:29: error: static declaration of ‘net_prio_subsys’ follows non-static declaration include/linux/cgroup_subsys.h:71:1: note: previous declaration of ‘net_prio_subsys’ was here make[1]: *** [net/core/netprio_cgroup.o] Error 1 make: *** [net/core/netprio_cgroup.o] Error 2
Quoted 13 lines · John Fastabend
Quoted 12 lines · Eric Dumazet
Quoted 11 lines · David Miller
From: Neil Horman <[email protected]>
Date: Thu, 8 Dec 2011 06:45:55 -0500Quoted 5 lines · John Fastabend
Quoted 4 lines
net_prio_subsyscan be made static this removes the sparse warning it was throwing.Signed-off-by John Fastabend <[email protected]>...
Quoted 1 line
Acked-by Neil Horman <[email protected]>
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
Applied.
--But it trivialy breaks the build ? Or am I mistaken ?
Dang. No your right. When its not built as a module it breaks. Sorry I'll revert it.
Yeah, I'd say revert it for now, but I think the real problem is that the SUBSYS macro in the cgroup core code automatically defines a subsys structure as extern. We should look into fixing that properly instead long term.
Quoted 15 lines
Quoted 13 lines
$ grep CONFIG_NETPRIO_CGROUP .config CONFIG_NETPRIO_CGROUP=y$ make net/core/netprio_cgroup.o CC net/core/netprio_cgroup.o net/core/netprio_cgroup.c:31:29: error: static declaration of ‘net_prio_subsys’ follows non-static declaration include/linux/cgroup_subsys.h:71:1: note: previous declaration of ‘net_prio_subsys’ was here make[1]: *** [net/core/netprio_cgroup.o] Error 1 make: *** [net/core/netprio_cgroup.o] Error 2