Skip to contentSkip to conversation

linux-next: build warning after merge of the cgroup tree

PATCH New Stephen Rothwell 2 participants 2 messages May 1, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Tejun,

After merging the cgroup tree, today's linux-next build (arm multi_v7_defconfig) produced this warning:

kernel/cgroup/cgroup.c:439:13: warning: 'cgroup_get' defined but not used [-Wunused-function]
static void cgroup_get(struct cgroup *cgrp)

             ^

Introduced by commit

a590b90d472f ("cgroup: fix spurious warnings on cgroup_is_dead() from cgroup_sk_alloc()")

CONFIG_SOCK_CGROUP_DATA is not set for this build.

Signature · 2 lines
Cheers,
Stephen Rothwell
maintainer
#1 lore raw

PATCH 1/1 cgroup: mark cgroup_get() with __maybe_unused

From 310b4816a5d8082416b4ab83e5a7b3cb92883a4d Mon Sep 17 00:00:00 2001
From: Tejun Heo <[email protected]>
Date: Mon, 1 May 2017 15:24:14 -0400

a590b90d472f ("cgroup: fix spurious warnings on cgroup_is_dead() from cgroup_sk_alloc()") converted most cgroup_get() usages to cgroup_get_live() leaving cgroup_sk_alloc() the sole user of cgroup_get(). When !CONFIG_SOCK_CGROUP_DATA, this ends up triggering unused warning for cgroup_get().

Silence the warning by adding __maybe_unused to cgroup_get().

---
Applied to cgroup/for-4.12.

Thanks!

 kernel/cgroup/cgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cgroup/cgroup.c +1 -1
index 38d9386..f2bcc11 100644
@@ -436,7 +436,7 @@ struct cgroup_subsys_state *cgroup_get_e_css(struct cgroup *cgrp,
 	return css;
 }
 
-static void cgroup_get(struct cgroup *cgrp)
+static void __maybe_unused cgroup_get(struct cgroup *cgrp)
 {
 	css_get(&cgrp->self);
 }
Signature · 1 line
2.9.3