Skip to contentSkip to conversation

ALSA: usb/line6: remove 'defined but not used' warning

PATCH Applied Pierre-Louis Bossart 2 participants 2 messages Jul 7, 2020 – Jul 8, 2020 Sound

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ALSA: usb/line6: remove 'defined but not used' warning

Fix W=1 warning. Variables are declared in a header file included from multiple C files, replace by #defines as suggested by Takashi

sound/usb/line6/driver.h:70:18: warning: ‘SYSEX_EXTRA_SIZE’ defined but not used [-Wunused-const-variable=]

   70 | static const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4;
      |                  ^~~~~~~~~~~~~~~~
sound/usb/line6/driver.h:69:18: warning: ‘SYSEX_DATA_OFS’ defined but
   not used [-Wunused-const-variable=]
   69 | static const int SYSEX_DATA_OFS = sizeof(line6_midi_id) + 3;
      |                  ^~~~~~~~~~~~~~
---
 sound/usb/line6/driver.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/usb/line6/driver.h +2 -2
index 1a4e3700c80c..ec20fbec6475 100644
@@ -66,8 +66,8 @@
 
 extern const unsigned char line6_midi_id[3];
 
-static const int SYSEX_DATA_OFS = sizeof(line6_midi_id) + 3;
-static const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4;
+#define SYSEX_DATA_OFS (sizeof(line6_midi_id) + 3)
+#define SYSEX_EXTRA_SIZE (sizeof(line6_midi_id) + 4)
 
 /*
 	 Common properties of Line 6 devices.
Signature · 1 line
2.25.1
Applied
#1 lore raw
Quoted 6 lines · Pierre-Louis Bossart

Fix W=1 warning. Variables are declared in a header file included from multiple C files, replace by #defines as suggested by Takashi

sound/usb/line6/driver.h:70:18: warning: ‘SYSEX_EXTRA_SIZE’ defined but not used [-Wunused-const-variable=]

Quoted 8 lines
   70 | static const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4;
      |                  ^~~~~~~~~~~~~~~~
sound/usb/line6/driver.h:69:18: warning: ‘SYSEX_DATA_OFS’ defined but
   not used [-Wunused-const-variable=]
   69 | static const int SYSEX_DATA_OFS = sizeof(line6_midi_id) + 3;
      |                  ^~~~~~~~~~~~~~

Applied, thanks.

Takashi