Skip to contentSkip to conversation

HID: sony: Fix unused function warning

PATCH In review José Expósito 2 participants 2 messages Nov 28, 2022 – Dec 20, 2022 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: sony: Fix unused function warning

Compiling this driver without setting "CONFIG_SONY_FF" generates the following warning:

drivers/hid/hid-sony.c:2358:20: warning: unused function 'sony_send_output_report' [-Wunused-function] static inline void sony_send_output_report(struct sony_sc *sc)
^
1 warning generated.

Add the missing preprocessor check to fix it.

---
 drivers/hid/hid-sony.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hid/hid-sony.c +2 -0
index 03691cdcfb8e..13125997ab5e 100644
@@ -2355,11 +2355,13 @@ static void motion_send_output_report(struct sony_sc *sc)
 	hid_hw_output_report(hdev, (u8 *)report, MOTION_REPORT_0x02_SIZE);
 }
 
+#ifdef CONFIG_SONY_FF
 static inline void sony_send_output_report(struct sony_sc *sc)
 {
 	if (sc->send_output_report)
 		sc->send_output_report(sc);
 }
+#endif
 
 static void sony_state_worker(struct work_struct *work)
 {
Signature · 1 line
2.38.1
maintainer
#1 lore raw
Quoted 9 lines · José Expósito

Compiling this driver without setting "CONFIG_SONY_FF" generates the following warning:

drivers/hid/hid-sony.c:2358:20: warning: unused function 'sony_send_output_report' [-Wunused-function] static inline void sony_send_output_report(struct sony_sc *sc)
^
1 warning generated.

Quoted 3 lines

Add the missing preprocessor check to fix it.

Thanks for fixing this, now applied.

Signature · 2 lines
Jiri Kosina
SUSE Labs