Skip to contentSkip to conversation

Input: synaptics: hide unused smbus_pnp_ids[] array

PATCH RESEND Applied Arnd Bergmann 2 participants 2 messages Feb 25, 2025

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

PATCH RESEND 1/1 Input: synaptics: hide unused smbus_pnp_ids[] array

From: Arnd Bergmann <[email protected]>

When SMBUS is disabled, this is never referenced, causing a W=1 warning:

drivers/input/mouse/synaptics.c:164:27: error: 'smbus_pnp_ids' defined but not used [-Werror=unused-const-variable=]

Hide the array behind the same #ifdef as the code referencing it.

Fixes e839ffab0289 ("Input: synaptics - add support for Intertouch devices")

---
Sent this about a year ago, the patch is still needed, so resending without changes

---
 drivers/input/mouse/synaptics.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/input/mouse/synaptics.c +2 -0
index aba57abe6978..309c360aab55 100644
@@ -161,6 +161,7 @@ static const char * const topbuttonpad_pnp_ids[] = {
 	NULL
 };
 
+#ifdef CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS
 static const char * const smbus_pnp_ids[] = {
 	/* all of the topbuttonpad_pnp_ids are valid, we just add some extras */
 	"LEN0048", /* X1 Carbon 3 */
@@ -196,6 +197,7 @@ static const char * const smbus_pnp_ids[] = {
 	"SYN3257", /* HP Envy 13-ad105ng */
 	NULL
 };
+#endif
 
 static const char * const forcepad_pnp_ids[] = {
 	"SYN300D",
Signature · 1 line
2.39.5
maintainer Applied
#1 lore raw
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When SMBUS is disabled, this is never referenced, causing a W=1 warning:

drivers/input/mouse/synaptics.c:164:27: error: 'smbus_pnp_ids' defined but not used [-Werror=unused-const-variable=]

Hide the array behind the same #ifdef as the code referencing it.

Fixes e839ffab0289 ("Input: synaptics - add support for Intertouch devices")

Applied, thank you.

Signature · 1 line
Dmitry