Skip to contentSkip to conversation

ALSA: line6: Fix -Wunused-const-variable warnings

PATCH In review YueHaibing 2 participants 2 messages Aug 22, 2019 Sound

lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH 1/1 ALSA: line6: Fix -Wunused-const-variable warnings

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

SYSEX_EXTRA_SIZE is only used in driver.c and
SYSEX_DATA_OFS in pod.c, so move them to .c fix
this warning.

---
 sound/usb/line6/driver.c | 2 ++
 sound/usb/line6/driver.h | 3 ---
 sound/usb/line6/pod.c    | 2 ++
 3 files changed, 4 insertions(+), 3 deletions(-)
sound/usb/line6/driver.c +2 -0
index b5a3f75..8027da8 100644
@@ -31,6 +31,8 @@ const unsigned char line6_midi_id[3] = {
 };
 EXPORT_SYMBOL_GPL(line6_midi_id);
 
+static const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4;
+
 /*
 	Code to request version of POD, Variax interface
 	(and maybe other devices).
sound/usb/line6/driver.h +0 -3
index e5e572e..c57633a 100644
@@ -66,9 +66,6 @@
 
 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;
-
 /*
 	 Common properties of Line 6 devices.
 */
sound/usb/line6/pod.c +2 -0
index ee4c9d2..24ad337 100644
@@ -110,6 +110,8 @@ enum {
 	POD_BUSY_MIDISEND
 };
 
+static const int SYSEX_DATA_OFS = sizeof(line6_midi_id) + 3;
+
 static struct snd_ratden pod_ratden = {
 	.num_min = 78125,
 	.num_max = 78125,
Signature · 1 line
2.7.4
#1 lore raw
Quoted 6 lines · YueHaibing

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

Quoted 6 lines

SYSEX_EXTRA_SIZE is only used in driver.c and
SYSEX_DATA_OFS in pod.c, so move them to .c fix
this warning.

No, this makes things worse. It should have been simply a normal define instead.

Care to resend the fix with replacement to define?

thanks,

Takashi

Quoted 51 lines
---
 sound/usb/line6/driver.c | 2 ++
 sound/usb/line6/driver.h | 3 ---
 sound/usb/line6/pod.c    | 2 ++
 3 files changed, 4 insertions(+), 3 deletions(-)
sound/usb/line6/driver.c +2 -0
index b5a3f75..8027da8 100644
@@ -31,6 +31,8 @@ const unsigned char line6_midi_id[3] = {
 };
 EXPORT_SYMBOL_GPL(line6_midi_id);
 
+static const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4;
+
 /*
 	Code to request version of POD, Variax interface
 	(and maybe other devices).
sound/usb/line6/driver.h +0 -3
index e5e572e..c57633a 100644
@@ -66,9 +66,6 @@
 
 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;
-
 /*
 	 Common properties of Line 6 devices.
 */
sound/usb/line6/pod.c +2 -0
index ee4c9d2..24ad337 100644
@@ -110,6 +110,8 @@ enum {
 	POD_BUSY_MIDISEND
 };
 
+static const int SYSEX_DATA_OFS = sizeof(line6_midi_id) + 3;
+
 static struct snd_ratden pod_ratden = {
 	.num_min = 78125,
 	.num_max = 78125,
Signature · 1 line
2.7.4