On 16 April 2015 at 16:47, Jon Medhurst (Tixy) tixy@linaro.org wrote:
On Thu, 2015-04-16 at 14:56 +0530, Amit Pundir wrote:
On 14 April 2015 at 21:33, Jon Medhurst tixy@linaro.org wrote:
From: Mark Hambleton mark.hambleton@arm.com
Remove unused variable referenced from commented out code.
Fixes warning caused by commit df99953c42c6 ("cpuidle: governor: menu: don't use loadavg")
Signed-off-by: Mark Hambleton mark.hambleton@arm.com Signed-off-by: Jon Medhurst tixy@linaro.org
drivers/cpuidle/governors/menu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index 33305fb..9924ea20 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c @@ -126,6 +126,7 @@ struct menu_device { #define LOAD_INT(x) ((x) >> FSHIFT) #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
+#if 0 static int get_loadavg(void)
How about using __maybe_unused attribute here instead?
Does that work for function definitions?
Yes it apparently does.
Anyway, it's definitely unused because the Android patch referenced in the commit message comments out the only caller of the function. I would say that neither patch should be commenting out of #if 0'ing code, if it's not wanted, it should be deleted.
Agreed. I'd have happily deleted it, if it wasn't a part of mainline tree. So I'm a bit hesitant to do that.
But, in the end, I guess nobody really cares how it's done, and I don't have a preference as to how the warning is silenced.
I'm sticking with __maybe_unused attribute then. Also I'll try to verify if we still need this Android commit df99953c42c6 ("cpuidle: governor: menu: don't use loadavg").
Regards, Amit Pundir
-- Tixy