Skip to contentSkip to conversation

platform/x86: ideapad-laptop: hide unused 'touchpad_store'

PATCH In review Arnd Bergmann 2 participants 4 messages May 22, 2017 – May 23, 2017 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 platform/x86: ideapad-laptop: hide unused 'touchpad_store'

A readonly sysfs property must not have a 'store' function:

drivers/platform/x86/ideapad-laptop.c:438:16: error: 'touchpad_store' defined but not used [-Werror=unused-function]

We can either comment it out or remove the function entirely, without a good reason one or or another I picked the second option.

Fixes 7f363145992c ("platform/x86: ideapad-laptop: Switch touchpad attribute to be RO")
---
 drivers/platform/x86/ideapad-laptop.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/ideapad-laptop.c +3 -1
index f7a4608cc60b..c4c7ae3179c0 100644
@@ -435,6 +435,8 @@ static ssize_t touchpad_show(struct device *dev,
 	return sprintf(buf, "%lu\n", result);
 }
 
+#if 0
+/* Switch to RO for now: It might be revisited in the future */
 static ssize_t touchpad_store(struct device *dev,
 			      struct device_attribute *attr,
 			      const char *buf, size_t count)
@@ -453,7 +455,7 @@ static ssize_t touchpad_store(struct device *dev,
 	return count;
 }
 
-/* Switch to RO for now: It might be revisited in the future */
+#endif
 static DEVICE_ATTR_RO(touchpad);
 
 static struct attribute *ideapad_attributes[] = {
Signature · 1 line
2.9.0
#1 lore raw
Quoted 6 lines · Arnd Bergmann

A readonly sysfs property must not have a 'store' function:

drivers/platform/x86/ideapad-laptop.c:438:16: error: 'touchpad_store' defined but not used [-Werror=unused-function]

We can either comment it out or remove the function entirely, without a good reason one or or another I picked the second option.

Hmm... I was expecting something like this but didn't get a single error from kbuild bot.

Quoted 12 lines
Fixes 7f363145992c ("platform/x86: ideapad-laptop: Switch touchpad attribute to be RO")
---
 drivers/platform/x86/ideapad-laptop.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/ideapad-laptop.c +0 -0
index f7a4608cc60b..c4c7ae3179c0 100644

drivers/platform/x86/ideapad-laptop.c static ssize_t touchpad_show(struct device *dev, · line 439

Quoted 5 lines
drivers/platform/x86/ideapad-laptop.c +2 -0
@@ -435,6 +435,8 @@ static ssize_t touchpad_show(struct device *dev,
        return sprintf(buf, "%lu\n", result);
 }
 
+#if 0
+/* Switch to RO for now: It might be revisited in the future */

Can we use __maybe_unused instead?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 26 lines · Andy Shevchenko
Quoted 6 lines · Arnd Bergmann

A readonly sysfs property must not have a 'store' function:

drivers/platform/x86/ideapad-laptop.c:438:16: error: 'touchpad_store' defined but not used [-Werror=unused-function]

We can either comment it out or remove the function entirely, without a good reason one or or another I picked the second option.

Hmm... I was expecting something like this but didn't get a single error from kbuild bot.

Quoted 15 lines
Fixes 7f363145992c ("platform/x86: ideapad-laptop: Switch touchpad attribute to be RO")
---
 drivers/platform/x86/ideapad-laptop.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/ideapad-laptop.c +0 -0
index f7a4608cc60b..c4c7ae3179c0 100644
@@ -435,6 +435,8 @@ static ssize_t touchpad_show(struct device *dev,
        return sprintf(buf, "%lu\n", result);
 }
 
Quoted 4 lines

drivers/platform/x86/ideapad-laptop.c static ssize_t touchpad_show(struct device *dev, · line 439

Quoted 2 lines
drivers/platform/x86/ideapad-laptop.c +2 -0
+#if 0
+/* Switch to RO for now: It might be revisited in the future */

Can we use __maybe_unused instead?

Sure, whichever you prefer. I guess you'll just commit that patch yourself then?

Arnd

#3 lore raw
Quoted 28 lines · Arnd Bergmann
Quoted 26 lines · Andy Shevchenko
Quoted 6 lines · Arnd Bergmann

A readonly sysfs property must not have a 'store' function:

drivers/platform/x86/ideapad-laptop.c:438:16: error: 'touchpad_store' defined but not used [-Werror=unused-function]

We can either comment it out or remove the function entirely, without a good reason one or or another I picked the second option.

Hmm... I was expecting something like this but didn't get a single error from kbuild bot.

Quoted 15 lines
Fixes 7f363145992c ("platform/x86: ideapad-laptop: Switch touchpad attribute to be RO")
---
 drivers/platform/x86/ideapad-laptop.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/ideapad-laptop.c +0 -0
index f7a4608cc60b..c4c7ae3179c0 100644
@@ -435,6 +435,8 @@ static ssize_t touchpad_show(struct device *dev,
        return sprintf(buf, "%lu\n", result);
 }
 
Quoted 6 lines
Quoted 4 lines

drivers/platform/x86/ideapad-laptop.c static ssize_t touchpad_show(struct device *dev, · line 439

Quoted 2 lines
drivers/platform/x86/ideapad-laptop.c +2 -0
+#if 0
+/* Switch to RO for now: It might be revisited in the future */

Can we use __maybe_unused instead?

Sure, whichever you prefer. I guess you'll just commit that patch yourself then?

Updated version pushed to testing, thanks.

Signature · 2 lines
With Best Regards,
Andy Shevchenko