Thread (9 messages) 9 messages, 2 authors, 2014-10-28

Re: [PATCH] Input: spear-keyboard - Add CONFIG_PM_SLEEP to suspend/resume functions

From: Jingoo Han <hidden>
Date: 2014-10-28 00:02:28

On Tuesday, October 28, 2014 8:38 AM, Dmitry Torokhov wrote:
On Mon, Oct 27, 2014 at 09:32:58PM +0900, Jingoo Han wrote:
quoted
Add CONFIG_PM_SLEEP to suspend/resume functions

Add CONFIG_PM_SLEEP to suspend/resume functions instead of
CONFIG_PM to fix the following build warning when CONFIG_PM_SLEEP
is not selected and CONFIG_PM is selected. This is because sleep
PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the
CONFIG_PM_SLEEP is enabled.
Recently I've become a fan of __maybe_unused markings as they insulate
us from various CONFIG changes in unrelated subsystems, I'll transform
this patch to use them instead.
OK, I see. I have no objection.
Then, how about changing other usages of CONFIG_PM_SLEEP/CONFIG_PM
to __maybe_unused annotation? Personally, I prefer to increase build
coverage than using #ifdef guards. Someone, however, argued that #ifdef
guards should be used in this case because the size of binary can be
reduced. How about your opinion?
Thank you.

Best regards,
Jingoo Han
Thanks.
quoted
drivers/input/keyboard/spear-keyboard.c:292:12: warning: 'spear_kbd_suspend' defined but not used [-
Wunused-function]
quoted
drivers/input/keyboard/spear-keyboard.c:345:12: warning: 'spear_kbd_resume' defined but not used [-
Wunused-function]
quoted
Signed-off-by: Jingoo Han <redacted>
---
 drivers/input/keyboard/spear-keyboard.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
index 258af10..fc93e79 100644
--- a/drivers/input/keyboard/spear-keyboard.c
+++ b/drivers/input/keyboard/spear-keyboard.c
@@ -288,7 +288,7 @@ static int spear_kbd_remove(struct platform_device *pdev)
 	return 0;
 }

-#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
 static int spear_kbd_suspend(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
--
1.7.9.5
--
Dmitry
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help