[RFC PATCH 00/23] ALSA: fix kernel-doc and W=1 warnings
This cleanup touches a lot of old - and very old code for hardware designed in the late 1990s/early 2000s -, hence the RFC status. I mostly did dumb edits just to make warnings go away, suggestions and feedback welcome.
Pierre-Louis Bossart (23): ALSA: isa/gus: remove -Wmissing-prototypes warnings ALSA: isa/gus: remove 'set but not used' warning ALSA: pci/asihpi: remove 'set but not used' warnings ALSA: pci/asihpi: fix kernel-doc ALSA: pci/asihpi: remove 'set but not used' warning ALSA: pci/echoaudio: remove 'set but not used' warning ALSA: pci/aw2-saa7146: remove 'set but not used' warning ALSA: pci/ctxfi/ctatc: fix kernel-doc ALSA: pci/ctxfi: fix kernel-doc warnings ALSA: usb/line6: remove 'defined but not used' warning ASoC: pci/emu10k1: remove "set but not used' warnings ALSA: firewire: fix kernel-doc ALSA: pci/emu10k1: remove 'set but not used' warning ALSA: pci/korg1212: remove 'set but not used' warnings ALSA: pci/rme9652/hdspm: remove always true condition ALSA: pci/oxygen/xonar_wm87x6: remove always true condition ALSA: xen: remove 'set but not used' warning ALSA: pci/es1938: remove 'set but not used' warning ALSA: pci/fm801: fix kernel-doc ALSA: pci/via82xx: remove 'set but not used' warnings ALSA: pcmcia/pdaudiocf: fix kernel-doc ALSA: vx_core: remove warning for empty loop body ALSA: pci/au88x0: remove "defined but not used" warnings
include/sound/gus.h | 4 ++++ sound/drivers/vx/vx_core.c | 3 ++- sound/firewire/cmp.c | 1 - sound/isa/gus/gus_reset.c | 2 -- sound/isa/gus/gus_uart.c | 3 ++- sound/pci/asihpi/asihpi.c | 12 +++++----- sound/pci/asihpi/hpicmn.c | 26 +++++++++++---------- sound/pci/au88x0/au88x0_a3ddata.c | 8 +++---- sound/pci/au88x0/au88x0_xtalk.c | 36 +++++++++++++++--------------- sound/pci/aw2/aw2-saa7146.c | 2 +- sound/pci/ctxfi/ctatc.c | 4 ++++ sound/pci/ctxfi/cthardware.c | 2 +- sound/pci/ctxfi/cthw20k1.c | 2 +- sound/pci/ctxfi/cthw20k2.c | 2 +- sound/pci/ctxfi/ctimap.c | 2 +- sound/pci/ctxfi/ctmixer.c | 2 +- sound/pci/ctxfi/ctpcm.c | 2 +- sound/pci/echoaudio/echoaudio.c | 3 ++- sound/pci/emu10k1/emu10k1_main.c | 4 ++-- sound/pci/emu10k1/emu10k1_patch.c | 3 ++- sound/pci/es1938.c | 3 ++- sound/pci/fm801.c | 27 ++++++++++++++++++++++ sound/pci/korg1212/korg1212.c | 4 +++- sound/pci/oxygen/xonar_wm87x6.c | 6 +++-- sound/pci/rme9652/hdspm.c | 4 ++-- sound/pci/via82xx.c | 2 +- sound/pci/via82xx_modem.c | 2 +- sound/pcmcia/pdaudiocf/pdaudiocf.c | 1 + sound/usb/line6/driver.h | 4 ++-- sound/xen/xen_snd_front.c | 2 +- 30 files changed, 110 insertions(+), 68 deletions(-)
Fix W=1 warnings by adding prototypes to header file
sound/isa/gus/gus_timer.c:141:6: warning: no previous prototype for ‘snd_gf1_timers_init’ [-Wmissing-prototypes] 141 | void snd_gf1_timers_init(struct snd_gus_card * gus) | ^~~~~~~~~~~~~~~~~~~ sound/isa/gus/gus_timer.c:177:6: warning: no previous prototype for ‘snd_gf1_timers_done’ [-Wmissing-prototypes] 177 | void snd_gf1_timers_done(struct snd_gus_card * gus) | ^~~~~~~~~~~~~~~~~~~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- include/sound/gus.h | 4 ++++ sound/isa/gus/gus_reset.c | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/sound/gus.h b/include/sound/gus.h index 410939ecf3a5..cd8da68cab92 100644 --- a/include/sound/gus.h +++ b/include/sound/gus.h @@ -613,4 +613,8 @@ int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr, int snd_gus_dram_read(struct snd_gus_card *gus, char __user *ptr, unsigned int addr, unsigned int size, int rom);
+/* gus_timer.c */ +void snd_gf1_timers_init(struct snd_gus_card *gus); +void snd_gf1_timers_done(struct snd_gus_card *gus); + #endif /* __SOUND_GUS_H */ diff --git a/sound/isa/gus/gus_reset.c b/sound/isa/gus/gus_reset.c index 07bfcda43827..9a1ab5872c4f 100644 --- a/sound/isa/gus/gus_reset.c +++ b/sound/isa/gus/gus_reset.c @@ -9,8 +9,6 @@ #include <sound/core.h> #include <sound/gus.h>
-extern void snd_gf1_timers_init(struct snd_gus_card * gus); -extern void snd_gf1_timers_done(struct snd_gus_card * gus); extern int snd_gf1_synth_init(struct snd_gus_card * gus); extern void snd_gf1_synth_done(struct snd_gus_card * gus);
Fix W=1 warning by noting variable as __always_unused.
sound/isa/gus/gus_uart.c: In function ‘snd_gf1_interrupt_midi_in’: sound/isa/gus/gus_uart.c:16:22: warning: variable ‘data’ set but not used [-Wunused-but-set-variable] 16 | unsigned char stat, data, byte;
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/isa/gus/gus_uart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/isa/gus/gus_uart.c b/sound/isa/gus/gus_uart.c index 7586619770b3..4fb4ed79e262 100644 --- a/sound/isa/gus/gus_uart.c +++ b/sound/isa/gus/gus_uart.c @@ -13,7 +13,8 @@ static void snd_gf1_interrupt_midi_in(struct snd_gus_card * gus) { int count; - unsigned char stat, data, byte; + unsigned char stat, byte; + __always_unused unsigned char data; unsigned long flags;
count = 10;
Fix W=1 warnings by removing 2 unnecessary initializations and removing a variable that's not used.
sound/pci/asihpi/asihpi.c: In function ‘snd_asihpi_tuner_band_get’: sound/pci/asihpi/asihpi.c:1907:6: warning: variable ‘num_bands’ set but not used [-Wunused-but-set-variable] 1907 | u32 num_bands = 0; | ^~~~~~~~~ sound/pci/asihpi/asihpi.c: In function ‘snd_asihpi_tuner_band_put’: sound/pci/asihpi/asihpi.c:1934:6: warning: variable ‘num_bands’ set but not used [-Wunused-but-set-variable] 1934 | u32 num_bands = 0; | ^~~~~~~~~ sound/pci/asihpi/asihpi.c: In function ‘snd_asihpi_mux_info’: sound/pci/asihpi/asihpi.c:2164:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable] 2164 | int err; | ^~~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/asihpi/asihpi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index a9540c2c4a1a..faa879f175a9 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c @@ -1904,7 +1904,7 @@ static int snd_asihpi_tuner_band_get(struct snd_kcontrol *kcontrol, */ u16 band, idx; u16 tuner_bands[HPI_TUNER_BAND_LAST]; - u32 num_bands = 0; + u32 num_bands;
num_bands = asihpi_tuner_band_query(kcontrol, tuner_bands, HPI_TUNER_BAND_LAST); @@ -1931,7 +1931,7 @@ static int snd_asihpi_tuner_band_put(struct snd_kcontrol *kcontrol, unsigned int idx; u16 band; u16 tuner_bands[HPI_TUNER_BAND_LAST]; - u32 num_bands = 0; + u32 num_bands;
num_bands = asihpi_tuner_band_query(kcontrol, tuner_bands, HPI_TUNER_BAND_LAST); @@ -2161,7 +2161,6 @@ static int snd_card_asihpi_mux_count_sources(struct snd_kcontrol *snd_control) static int snd_asihpi_mux_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { - int err; u16 src_node_type, src_node_index; u32 h_control = kcontrol->private_value;
@@ -2174,10 +2173,9 @@ static int snd_asihpi_mux_info(struct snd_kcontrol *kcontrol, uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
- err = - hpi_multiplexer_query_source(h_control, - uinfo->value.enumerated.item, - &src_node_type, &src_node_index); + hpi_multiplexer_query_source(h_control, + uinfo->value.enumerated.item, + &src_node_type, &src_node_index);
sprintf(uinfo->value.enumerated.name, "%s %d", asihpi_src_names[src_node_type - HPI_SOURCENODE_NONE],
Fix W=1 warnings. The code certainly predates .rst syntax, adjust as needed.
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/asihpi/hpicmn.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/sound/pci/asihpi/hpicmn.c b/sound/pci/asihpi/hpicmn.c index 968510bc2552..7d1abaedb46a 100644 --- a/sound/pci/asihpi/hpicmn.c +++ b/sound/pci/asihpi/hpicmn.c @@ -28,10 +28,12 @@ struct hpi_adapters_list { static struct hpi_adapters_list adapters;
/** -* Given an HPI Message that was sent out and a response that was received, -* validate that the response has the correct fields filled in, -* i.e ObjectType, Function etc -**/ + * hpi_validate_response - Given an HPI Message that was sent out and + * a response that was received, validate that the response has the + * correct fields filled in, i.e ObjectType, Function etc + * @phm: message + * @phr: response + */ u16 hpi_validate_response(struct hpi_message *phm, struct hpi_response *phr) { if (phr->type != HPI_TYPE_RESPONSE) { @@ -106,10 +108,11 @@ void hpi_delete_adapter(struct hpi_adapter_obj *pao) }
/** -* FindAdapter returns a pointer to the struct hpi_adapter_obj with -* index wAdapterIndex in an HPI_ADAPTERS_LIST structure. -* -*/ + * hpi_find_adapter - FindAdapter returns a pointer to the struct + * hpi_adapter_obj with index wAdapterIndex in an HPI_ADAPTERS_LIST + * structure. + * @adapter_index: value in [0, HPI_MAX_ADAPTERS[ + */ struct hpi_adapter_obj *hpi_find_adapter(u16 adapter_index) { struct hpi_adapter_obj *pao = NULL; @@ -137,10 +140,9 @@ struct hpi_adapter_obj *hpi_find_adapter(u16 adapter_index) }
/** -* -* wipe an HPI_ADAPTERS_LIST structure. -* -**/ + * wipe_adapter_list - wipe an HPI_ADAPTERS_LIST structure. + * + */ static void wipe_adapter_list(void) { memset(&adapters, 0, sizeof(adapters));
Fix W=1 warnings, mark variables as __always_unused
sound/pci/asihpi/asihpi.c: In function ‘snd_asihpi_tuner_band_get’: sound/pci/asihpi/asihpi.c:1907:6: warning: variable ‘num_bands’ set but not used [-Wunused-but-set-variable] 1907 | u32 num_bands; | ^~~~~~~~~ sound/pci/asihpi/asihpi.c: In function ‘snd_asihpi_tuner_band_put’: sound/pci/asihpi/asihpi.c:1934:6: warning: variable ‘num_bands’ set but not used [-Wunused-but-set-variable] 1934 | u32 num_bands; | ^~~~~~~~~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/asihpi/asihpi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index faa879f175a9..023c35a2a951 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c @@ -1904,7 +1904,7 @@ static int snd_asihpi_tuner_band_get(struct snd_kcontrol *kcontrol, */ u16 band, idx; u16 tuner_bands[HPI_TUNER_BAND_LAST]; - u32 num_bands; + __always_unused u32 num_bands;
num_bands = asihpi_tuner_band_query(kcontrol, tuner_bands, HPI_TUNER_BAND_LAST); @@ -1931,7 +1931,7 @@ static int snd_asihpi_tuner_band_put(struct snd_kcontrol *kcontrol, unsigned int idx; u16 band; u16 tuner_bands[HPI_TUNER_BAND_LAST]; - u32 num_bands; + __always_unused u32 num_bands;
num_bands = asihpi_tuner_band_query(kcontrol, tuner_bands, HPI_TUNER_BAND_LAST);
Fix W=1 warning. One variable is only used in a conditionally-compiled block, mark as __maybe_unused
sound/pci/echoaudio/echoaudio.c: In function ‘snd_echo_probe’: sound/pci/echoaudio/echoaudio.c:1958:6: warning: variable ‘i’ set but not used [-Wunused-but-set-variable] 1958 | int i, err; | ^
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/echoaudio/echoaudio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index 0941a7a17623..bee3271e29da 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c @@ -1955,7 +1955,8 @@ static int snd_echo_probe(struct pci_dev *pci, struct snd_card *card; struct echoaudio *chip; char *dsp; - int i, err; + __maybe_unused int i; + int err;
if (dev >= SNDRV_CARDS) return -ENODEV;
Fix W=1 warning by nothing variable as always unused.
sound/pci/aw2/aw2-saa7146.c: In function ‘snd_aw2_saa7146_interrupt’: sound/pci/aw2/aw2-saa7146.c:333:15: warning: variable ‘iicsta’ set but not used [-Wunused-but-set-variable] 333 | unsigned int iicsta; | ^~~~~~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/aw2/aw2-saa7146.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/pci/aw2/aw2-saa7146.c b/sound/pci/aw2/aw2-saa7146.c index 4e64eb5d8f64..c84f1a45194f 100644 --- a/sound/pci/aw2/aw2-saa7146.c +++ b/sound/pci/aw2/aw2-saa7146.c @@ -330,7 +330,7 @@ void snd_aw2_saa7146_pcm_trigger_stop_capture(struct snd_aw2_saa7146 *chip, irqreturn_t snd_aw2_saa7146_interrupt(int irq, void *dev_id) { unsigned int isr; - unsigned int iicsta; + __always_unused unsigned int iicsta; struct snd_aw2_saa7146 *chip = dev_id;
isr = READREG(ISR);
Fix W=1 warnings. Add missing arguments and description.
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/ctxfi/ctatc.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index e56a230f6a9c..b1898fafc6a9 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c @@ -1655,6 +1655,10 @@ static const struct ct_atc atc_preset = { * ct_atc_create - create and initialize a hardware manager * @card: corresponding alsa card object * @pci: corresponding kernel pci device object + * @rsr: reference sampling rate + * @msr: master sampling rate + * @chip_type: CHIPTYP enum values + * @ssid: vendor ID (upper 16 bits) and device ID (lower 16 bits) * @ratc: return created object address in it * * Creates and initializes a hardware manager.
Fix W=1 warnings. The files contain formatting that isn't kernel-doc.
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/ctxfi/cthardware.c | 2 +- sound/pci/ctxfi/cthw20k1.c | 2 +- sound/pci/ctxfi/cthw20k2.c | 2 +- sound/pci/ctxfi/ctimap.c | 2 +- sound/pci/ctxfi/ctmixer.c | 2 +- sound/pci/ctxfi/ctpcm.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/pci/ctxfi/cthardware.c b/sound/pci/ctxfi/cthardware.c index 9b7e63f4a3a7..1d5064486217 100644 --- a/sound/pci/ctxfi/cthardware.c +++ b/sound/pci/ctxfi/cthardware.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/** +/* * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. * * @File cthardware.c diff --git a/sound/pci/ctxfi/cthw20k1.c b/sound/pci/ctxfi/cthw20k1.c index 015c0d676897..108ab449c968 100644 --- a/sound/pci/ctxfi/cthw20k1.c +++ b/sound/pci/ctxfi/cthw20k1.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/** +/* * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. * * @File cthw20k1.c diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c index ce44cbe6459f..fc1bc18caee9 100644 --- a/sound/pci/ctxfi/cthw20k2.c +++ b/sound/pci/ctxfi/cthw20k2.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/** +/* * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. * * @File cthw20k2.c diff --git a/sound/pci/ctxfi/ctimap.c b/sound/pci/ctxfi/ctimap.c index eb1825e13fc5..d5a53d2f5f15 100644 --- a/sound/pci/ctxfi/ctimap.c +++ b/sound/pci/ctxfi/ctimap.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/** +/* * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. * * @File ctimap.c diff --git a/sound/pci/ctxfi/ctmixer.c b/sound/pci/ctxfi/ctmixer.c index 84514dc90d87..6797fde3d788 100644 --- a/sound/pci/ctxfi/ctmixer.c +++ b/sound/pci/ctxfi/ctmixer.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/** +/* * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. * * @File ctmixer.c diff --git a/sound/pci/ctxfi/ctpcm.c b/sound/pci/ctxfi/ctpcm.c index 6ee6a9675ca5..3f48ad0e27e7 100644 --- a/sound/pci/ctxfi/ctpcm.c +++ b/sound/pci/ctxfi/ctpcm.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/** +/* * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. * * @File ctpcm.c
Fix W=1 warning. Variables are declared in a header file included from multiple C files. Mark as __maybe_unused.
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; | ^~~~~~~~~~~~~~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/usb/line6/driver.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/usb/line6/driver.h b/sound/usb/line6/driver.h index 1a4e3700c80c..3f75855f142a 100644 --- a/sound/usb/line6/driver.h +++ b/sound/usb/line6/driver.h @@ -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; +static __maybe_unused const int SYSEX_DATA_OFS = sizeof(line6_midi_id) + 3; +static __maybe_unused const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4;
/* Common properties of Line 6 devices.
On Thu, 02 Jul 2020 21:35:51 +0200, Pierre-Louis Bossart wrote:
Fix W=1 warning. Variables are declared in a header file included from multiple C files. Mark as __maybe_unused.
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; | ^~~~~~~~~~~~~~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
sound/usb/line6/driver.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/usb/line6/driver.h b/sound/usb/line6/driver.h index 1a4e3700c80c..3f75855f142a 100644 --- a/sound/usb/line6/driver.h +++ b/sound/usb/line6/driver.h @@ -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; +static __maybe_unused const int SYSEX_DATA_OFS = sizeof(line6_midi_id) + 3; +static __maybe_unused const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4;
IMO, this can be clearer to make them define. The static const doesn't look like a right usage in such a case in anyway...
thanks,
Takashi
-static const int SYSEX_DATA_OFS = sizeof(line6_midi_id) + 3; -static const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4; +static __maybe_unused const int SYSEX_DATA_OFS = sizeof(line6_midi_id) + 3; +static __maybe_unused const int SYSEX_EXTRA_SIZE = sizeof(line6_midi_id) + 4;
IMO, this can be clearer to make them define. The static const doesn't look like a right usage in such a case in anyway...
Right, and the capital letters do hint at a define indeed. Will resend, thanks Takashi for the review.
Fix W=1 warnings. Mark variables used for reads as __always_unused.
sound/pci/emu10k1/emu10k1_main.c: In function ‘snd_emu10k1_cardbus_init’: sound/pci/emu10k1/emu10k1_main.c:626:15: warning: variable ‘value’ set but not used [-Wunused-but-set-variable] 626 | unsigned int value; | ^~~~~ sound/pci/emu10k1/emu10k1_main.c: In function ‘snd_emu1010_load_firmware_entry’: sound/pci/emu10k1/emu10k1_main.c:656:15: warning: variable ‘write_post’ set but not used [-Wunused-but-set-variable] 656 | unsigned int write_post; | ^~~~~~~~~~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/emu10k1/emu10k1_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index 6ff581733a19..bd70e112ffd7 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -623,7 +623,7 @@ static int snd_emu10k1_ecard_init(struct snd_emu10k1 *emu) static int snd_emu10k1_cardbus_init(struct snd_emu10k1 *emu) { unsigned long special_port; - unsigned int value; + __always_unused unsigned int value;
/* Special initialisation routine * before the rest of the IO-Ports become active. @@ -653,7 +653,7 @@ static int snd_emu1010_load_firmware_entry(struct snd_emu10k1 *emu, int n, i; int reg; int value; - unsigned int write_post; + __always_unused unsigned int write_post; unsigned long flags;
if (!fw_entry)
Fix W=1 warning. Remove excess function parameter from description
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/firewire/cmp.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/sound/firewire/cmp.c b/sound/firewire/cmp.c index 14abbe7175b6..b596bec19774 100644 --- a/sound/firewire/cmp.c +++ b/sound/firewire/cmp.c @@ -293,7 +293,6 @@ static int pcr_set_check(struct cmp_connection *c, __be32 pcr) /** * cmp_connection_establish - establish a connection to the target * @c: the connection manager - * @max_payload_bytes: the amount of data (including CIP headers) per packet * * This function establishes a point-to-point connection from the local * computer to the target by allocating isochronous resources (channel and
On Thu, Jul 02, 2020 at 02:35:53PM -0500, Pierre-Louis Bossart wrote:
Fix W=1 warning. Remove excess function parameter from description
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
sound/firewire/cmp.c | 1 - 1 file changed, 1 deletion(-)
Thanks for your catching this bug.
Fixes: 7bc93821a70a ("ALSA: firewire-lib: split allocation of isochronous resources from establishment of connection") Acked-by: Takashi Sakamoto o-takashi@sakamocchi.jp
diff --git a/sound/firewire/cmp.c b/sound/firewire/cmp.c index 14abbe7175b6..b596bec19774 100644 --- a/sound/firewire/cmp.c +++ b/sound/firewire/cmp.c @@ -293,7 +293,6 @@ static int pcr_set_check(struct cmp_connection *c, __be32 pcr) /**
- cmp_connection_establish - establish a connection to the target
- @c: the connection manager
- @max_payload_bytes: the amount of data (including CIP headers) per packet
- This function establishes a point-to-point connection from the local
- computer to the target by allocating isochronous resources (channel and
-- 2.25.1
Regards
Takashi Sakamoto
Fix W=1 warning. The loopsize variable is only used in compiled-out code, so mark with __maybe_unused.
sound/pci/emu10k1/emu10k1_patch.c: In function ‘snd_emu10k1_sample_new’: sound/pci/emu10k1/emu10k1_patch.c:30:22: warning: variable ‘loopsize’ set but not used [-Wunused-but-set-variable] 30 | int truesize, size, loopsize, blocksize; | ^~~~~~~~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/emu10k1/emu10k1_patch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/pci/emu10k1/emu10k1_patch.c b/sound/pci/emu10k1/emu10k1_patch.c index b3aa7bbe1067..89890f24509f 100644 --- a/sound/pci/emu10k1/emu10k1_patch.c +++ b/sound/pci/emu10k1/emu10k1_patch.c @@ -27,7 +27,8 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp, const void __user *data, long count) { int offset; - int truesize, size, loopsize, blocksize; + int truesize, size, blocksize; + __maybe_unused int loopsize; int loopend, sampleend; unsigned int start_addr; struct snd_emu10k1 *emu;
Fix W=1 warnings. Two variables are only used for debug logs, mark with __maybe_unused:
sound/pci/korg1212/korg1212.c: In function ‘snd_korg1212_create’: sound/pci/korg1212/korg1212.c:2152:36: warning: variable ‘iomem2_size’ set but not used [-Wunused-but-set-variable] 2152 | unsigned ioport_size, iomem_size, iomem2_size; | ^~~~~~~~~~~ sound/pci/korg1212/korg1212.c:2152:11: warning: variable ‘ioport_size’ set but not used [-Wunused-but-set-variable] 2152 | unsigned ioport_size, iomem_size, iomem2_size; | ^~~~~~~~~~~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/korg1212/korg1212.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index 65a887b217ee..2eddd9de9e6d 100644 --- a/sound/pci/korg1212/korg1212.c +++ b/sound/pci/korg1212/korg1212.c @@ -2149,7 +2149,9 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci, { int err, rc; unsigned int i; - unsigned ioport_size, iomem_size, iomem2_size; + unsigned iomem_size; + __maybe_unused unsigned ioport_size; + __maybe_unused unsigned iomem2_size; struct snd_korg1212 * korg1212; const struct firmware *dsp_code;
Fix W=1 warning:
sound/pci/rme9652/hdspm.c: In function ‘hdspm_autosync_ref’: sound/pci/rme9652/hdspm.c:3030:16: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] 3030 | if ((syncref >= HDSPM_AES32_AUTOSYNC_FROM_WORD) && | ^~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/rme9652/hdspm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index f7cda9062088..0fa49f4d15cf 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -3027,8 +3027,8 @@ static int hdspm_autosync_ref(struct hdspm *hdspm)
unsigned int status = hdspm_read(hdspm, HDSPM_statusRegister); unsigned int syncref = (status >> HDSPM_AES32_syncref_bit) & 0xF; - if ((syncref >= HDSPM_AES32_AUTOSYNC_FROM_WORD) && - (syncref <= HDSPM_AES32_AUTOSYNC_FROM_SYNC_IN)) { + /* syncref >= HDSPM_AES32_AUTOSYNC_FROM_WORD is always true */ + if (syncref <= HDSPM_AES32_AUTOSYNC_FROM_SYNC_IN) { return syncref; } return HDSPM_AES32_AUTOSYNC_FROM_NONE;
Fix W=1 warnings:
sound/pci/oxygen/xonar_wm87x6.c: In function ‘wm8776_write’: sound/pci/oxygen/xonar_wm87x6.c:119:11: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] 119 | if (reg >= WM8776_HPLVOL && reg <= WM8776_DACMASTER) | ^~ sound/pci/oxygen/xonar_wm87x6.c: In function ‘wm8766_write’: sound/pci/oxygen/xonar_wm87x6.c:147:12: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] 147 | if ((reg >= WM8766_LDA1 && reg <= WM8766_RDA1) || | ^~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/oxygen/xonar_wm87x6.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sound/pci/oxygen/xonar_wm87x6.c b/sound/pci/oxygen/xonar_wm87x6.c index 0767276582ca..8aa92f3e5ee8 100644 --- a/sound/pci/oxygen/xonar_wm87x6.c +++ b/sound/pci/oxygen/xonar_wm87x6.c @@ -116,7 +116,8 @@ static void wm8776_write(struct oxygen *chip, else wm8776_write_i2c(chip, reg, value); if (reg < ARRAY_SIZE(data->wm8776_regs)) { - if (reg >= WM8776_HPLVOL && reg <= WM8776_DACMASTER) + /* reg >= WM8776_HPLVOL is always true */ + if (reg <= WM8776_DACMASTER) value &= ~WM8776_UPDATE; data->wm8776_regs[reg] = value; } @@ -144,7 +145,8 @@ static void wm8766_write(struct oxygen *chip, OXYGEN_SPI_CEN_LATCH_CLOCK_LO, (reg << 9) | value); if (reg < ARRAY_SIZE(data->wm8766_regs)) { - if ((reg >= WM8766_LDA1 && reg <= WM8766_RDA1) || + /* reg >= WM8766_LDA1 is always true */ + if (reg <= WM8766_RDA1 || (reg >= WM8766_LDA2 && reg <= WM8766_MASTDA)) value &= ~WM8766_UPDATE; data->wm8766_regs[reg] = value;
Fix W=1 warning. Mark the 'req' variable as __always_unused.
sound/xen/xen_snd_front.c: In function ‘xen_snd_front_stream_close’: sound/xen/xen_snd_front.c:117:21: warning: variable ‘req’ set but not used [-Wunused-but-set-variable] 117 | struct xensnd_req *req; | ^~~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/xen/xen_snd_front.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/xen/xen_snd_front.c b/sound/xen/xen_snd_front.c index a9e5c2cd7698..e21d0bfafeae 100644 --- a/sound/xen/xen_snd_front.c +++ b/sound/xen/xen_snd_front.c @@ -114,7 +114,7 @@ int xen_snd_front_stream_prepare(struct xen_snd_front_evtchnl *evtchnl,
int xen_snd_front_stream_close(struct xen_snd_front_evtchnl *evtchnl) { - struct xensnd_req *req; + __always_unused struct xensnd_req *req; int ret;
mutex_lock(&evtchnl->u.req.req_io_lock);
Fix W=1 warning. Mark the 'audiostatus' variable as __always_unused.
sound/pci/es1938.c: In function ‘snd_es1938_interrupt’: sound/pci/es1938.c:1622:24: warning: variable ‘audiostatus’ set but not used [-Wunused-but-set-variable] 1622 | unsigned char status, audiostatus; | ^~~~~~~~~~~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/es1938.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index b4a0adf7451c..09704a78d799 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c @@ -1619,7 +1619,8 @@ static int snd_es1938_create(struct snd_card *card, static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id) { struct es1938 *chip = dev_id; - unsigned char status, audiostatus; + unsigned char status; + __always_unused unsigned char audiostatus; int handled = 0;
status = inb(SLIO_REG(chip, IRQCONTROL));
Fix W=1 warnings, add missing field descriptions.
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/fm801.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index 181ebafa550a..0a95032fd297 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c @@ -144,6 +144,8 @@ MODULE_PARM_DESC(radio_nr, "Radio device numbers"); /** * struct fm801 - describes FM801 chip + * @dev: device for this chio + * @irq: irq number * @port: I/O port number * @multichannel: multichannel support * @secondary: secondary codec @@ -151,6 +153,31 @@ MODULE_PARM_DESC(radio_nr, "Radio device numbers"); * @tea575x_tuner: tuner access method & flags * @ply_ctrl: playback control * @cap_ctrl: capture control + * @ply_buffer: playback buffer + * @ply_buf: playback buffer index + * @ply_count: playback buffer count + * @ply_size: playback buffer size + * @ply_pos: playback position + * @cap_buffer: capture buffer + * @cap_buf: capture buffer index + * @cap_count: capture buffer count + * @cap_size: capture buffer size + * @cap_pos: capture position + * @ac97_bus: ac97 bus handle + * @ac97: ac97 handle + * @ac97_sec: ac97 secondary handle + * @card: ALSA card + * @pcm: PCM devices + * @rmidi: rmidi device + * @playback_substream: substream for playback + * @capture_substream: substream for capture + * @p_dma_size: playback DMA size + * @c_dma_size: capture DMA size + * @reg_lock: lock + * @proc_entry: /proc entry + * @v4l2_dev: v4l2 device + * @tea: tea575a structure + * @saved_regs: context saved during suspend */ struct fm801 { struct device *dev;
Fix W=1 warnings. Mark variables as __always_unused.
sound/pci/via82xx.c: In function ‘snd_via82xx_codec_wait’: sound/pci/via82xx.c:547:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable] 547 | int err; | ^~~ sound/pci/via82xx_modem.c: In function ‘snd_via82xx_codec_wait’: sound/pci/via82xx_modem.c:401:6: warning: variable ‘err’ set but not used [-Wunused-but-set-variable] 401 | int err; | ^~~
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/via82xx.c | 2 +- sound/pci/via82xx_modem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index 8b03e2dc503f..7abd47dbfe55 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -544,7 +544,7 @@ static int snd_via82xx_codec_valid(struct via82xx *chip, int secondary) static void snd_via82xx_codec_wait(struct snd_ac97 *ac97) { struct via82xx *chip = ac97->private_data; - int err; + __always_unused int err; err = snd_via82xx_codec_ready(chip, ac97->num); /* here we need to wait fairly for long time.. */ if (!nodelay) diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index 607b7100db1c..addfa196df21 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c @@ -398,7 +398,7 @@ static int snd_via82xx_codec_valid(struct via82xx_modem *chip, int secondary) static void snd_via82xx_codec_wait(struct snd_ac97 *ac97) { struct via82xx_modem *chip = ac97->private_data; - int err; + __always_unused int err; err = snd_via82xx_codec_ready(chip, ac97->num); /* here we need to wait fairly for long time.. */ msleep(500);
Fix W=1 warnings - add missing context parameter in description
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pcmcia/pdaudiocf/pdaudiocf.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index 6c33ea91cc05..27d9da6d61e8 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c @@ -139,6 +139,7 @@ static int snd_pdacf_probe(struct pcmcia_device *link)
/** * snd_pdacf_assign_resources - initialize the hardware and card instance. + * @pdacf: context * @port: i/o port for the card * @irq: irq number for the card *
Fix W=1 warning.
sound/drivers/vx/vx_core.c: In function ‘snd_vx_threaded_irq_handler’: sound/drivers/vx/vx_core.c:515:3: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] 515 | ; /* so far, nothing to do yet */ | ^
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/drivers/vx/vx_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c index ffab0400d7fb..26d591fe6a6b 100644 --- a/sound/drivers/vx/vx_core.c +++ b/sound/drivers/vx/vx_core.c @@ -511,8 +511,9 @@ irqreturn_t snd_vx_threaded_irq_handler(int irq, void *dev) /* The start on time code conditions are filled (ie the time code * received by the board is equal to one of those given to it). */ - if (events & TIME_CODE_EVENT_PENDING) + if (events & TIME_CODE_EVENT_PENDING) { ; /* so far, nothing to do yet */ + }
/* The frequency has changed on the board (UER mode). */ if (events & FREQUENCY_CHANGE_EVENT_PENDING)
Fix W=1 warnings. Mark all unused tables with __maybe_unused.
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com --- sound/pci/au88x0/au88x0_a3ddata.c | 8 +++---- sound/pci/au88x0/au88x0_xtalk.c | 36 +++++++++++++++---------------- 2 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/sound/pci/au88x0/au88x0_a3ddata.c b/sound/pci/au88x0/au88x0_a3ddata.c index 18623cb6bc52..a5da3b3a546a 100644 --- a/sound/pci/au88x0/au88x0_a3ddata.c +++ b/sound/pci/au88x0/au88x0_a3ddata.c @@ -21,7 +21,7 @@ static const a3d_Hrtf_t A3dHrirZeros = { 0, 0, 0 };
-static const a3d_Hrtf_t A3dHrirImpulse = { +static __maybe_unused const a3d_Hrtf_t A3dHrirImpulse = { 0x7fff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -30,7 +30,7 @@ static const a3d_Hrtf_t A3dHrirImpulse = { 0, 0, 0 };
-static const a3d_Hrtf_t A3dHrirOnes = { +static __maybe_unused const a3d_Hrtf_t A3dHrirOnes = { 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, @@ -47,7 +47,7 @@ static const a3d_Hrtf_t A3dHrirOnes = { 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff };
-static const a3d_Hrtf_t A3dHrirSatTest = { +static __maybe_unused const a3d_Hrtf_t A3dHrirSatTest = { 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, @@ -59,7 +59,7 @@ static const a3d_Hrtf_t A3dHrirSatTest = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-static const a3d_Hrtf_t A3dHrirDImpulse = { +static __maybe_unused const a3d_Hrtf_t A3dHrirDImpulse = { 0, 0x7fff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/sound/pci/au88x0/au88x0_xtalk.c b/sound/pci/au88x0/au88x0_xtalk.c index 084fcbf8ae80..27859536d7c0 100644 --- a/sound/pci/au88x0/au88x0_xtalk.c +++ b/sound/pci/au88x0/au88x0_xtalk.c @@ -17,35 +17,35 @@ static short const sXtalkWideKLeftEq = 0x269C; static short const sXtalkWideKRightEq = 0x269C; static short const sXtalkWideKLeftXt = 0xF25E; -static short const sXtalkWideKRightXt = 0xF25E; +static __maybe_unused short const sXtalkWideKRightXt = 0xF25E; static short const sXtalkWideShiftLeftEq = 1; static short const sXtalkWideShiftRightEq = 1; static short const sXtalkWideShiftLeftXt = 0; -static short const sXtalkWideShiftRightXt = 0; +static __maybe_unused short const sXtalkWideShiftRightXt = 0; static unsigned short const wXtalkWideLeftDelay = 0xd; static unsigned short const wXtalkWideRightDelay = 0xd; static short const sXtalkNarrowKLeftEq = 0x468D; static short const sXtalkNarrowKRightEq = 0x468D; static short const sXtalkNarrowKLeftXt = 0xF82E; -static short const sXtalkNarrowKRightXt = 0xF82E; +static __maybe_unused short const sXtalkNarrowKRightXt = 0xF82E; static short const sXtalkNarrowShiftLeftEq = 0x3; static short const sXtalkNarrowShiftRightEq = 0x3; static short const sXtalkNarrowShiftLeftXt = 0; -static short const sXtalkNarrowShiftRightXt = 0; +static __maybe_unused short const sXtalkNarrowShiftRightXt = 0; static unsigned short const wXtalkNarrowLeftDelay = 0x7; static unsigned short const wXtalkNarrowRightDelay = 0x7;
-static xtalk_gains_t const asXtalkGainsDefault = { +static __maybe_unused xtalk_gains_t const asXtalkGainsDefault = { 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000, 0x4000 };
-static xtalk_gains_t const asXtalkGainsTest = { +static __maybe_unused xtalk_gains_t const asXtalkGainsTest = { 0x7fff, 0x8000, 0x0000, 0x0000, 0x0001, 0xffff, 0x4000, 0xc000, 0x0002, 0xfffe };
-static xtalk_gains_t const asXtalkGains1Chan = { +static __maybe_unused xtalk_gains_t const asXtalkGains1Chan = { 0x7FFF, 0, 0, 0, 0, 0x7FFF, 0, 0, 0, 0, }; @@ -64,7 +64,7 @@ static xtalk_dline_t const alXtalkDlineZeros = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; -static xtalk_dline_t const alXtalkDlineTest = { +static __maybe_unused xtalk_dline_t const alXtalkDlineTest = { 0x0000fc18, 0xfff03e8, 0x000186a0, 0xfffe7960, 1, 0xffffffff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 @@ -74,7 +74,7 @@ static xtalk_instate_t const asXtalkInStateZeros = { 0, 0, 0, 0 };
-static xtalk_instate_t const asXtalkInStateTest = { +static __maybe_unused xtalk_instate_t const asXtalkInStateTest = { 0x0080, 0xff80, 0x0001, 0xffff };
@@ -89,11 +89,11 @@ static xtalk_state_t const asXtalkOutStateZeros = { static short const sDiamondKLeftEq = 0x401d; static short const sDiamondKRightEq = 0x401d; static short const sDiamondKLeftXt = 0xF90E; -static short const sDiamondKRightXt = 0xF90E; +static __maybe_unused short const sDiamondKRightXt = 0xF90E; static short const sDiamondShiftLeftEq = 1; static short const sDiamondShiftRightEq = 1; static short const sDiamondShiftLeftXt = 0; -static short const sDiamondShiftRightXt = 0; +static __maybe_unused short const sDiamondShiftRightXt = 0; static unsigned short const wDiamondLeftDelay = 0xb; static unsigned short const wDiamondRightDelay = 0xb;
@@ -118,7 +118,7 @@ static xtalk_coefs_t const asXtalkWideCoefsLeftXt = { {0x77dc, 0xc79e, 0xffb8, 0x000a, 0}, {0, 0, 0, 0, 0} }; -static xtalk_coefs_t const asXtalkWideCoefsRightXt = { +static __maybe_unused xtalk_coefs_t const asXtalkWideCoefsRightXt = { {0x55c6, 0xc97b, 0x005b, 0x0047, 0}, {0x6a60, 0xca20, 0xffc6, 0x0040, 0}, {0x6411, 0xd711, 0xfca1, 0x0190, 0}, @@ -149,7 +149,7 @@ static xtalk_coefs_t const asXtalkNarrowCoefsLeftXt = { {0, 0, 0, 0, 0} };
-static xtalk_coefs_t const asXtalkNarrowCoefsRightXt = { +static __maybe_unused xtalk_coefs_t const asXtalkNarrowCoefsRightXt = { {0x3CB2, 0xDF49, 0xF6EA, 0x095B, 0}, {0x6777, 0xC915, 0xFEAF, 0x00B1, 0}, {0x7762, 0xC7D9, 0x025B, 0xFDA6, 0}, @@ -172,7 +172,7 @@ static xtalk_coefs_t const asXtalkCoefsPipe = { {0, 0, 0x0FA0, 0, 0}, {0, 0, 0x1180, 0, 0}, }; -static xtalk_coefs_t const asXtalkCoefsNegPipe = { +static __maybe_unused xtalk_coefs_t const asXtalkCoefsNegPipe = { {0, 0, 0xF380, 0, 0}, {0, 0, 0xF380, 0, 0}, {0, 0, 0xF380, 0, 0}, @@ -180,7 +180,7 @@ static xtalk_coefs_t const asXtalkCoefsNegPipe = { {0, 0, 0xF200, 0, 0} };
-static xtalk_coefs_t const asXtalkCoefsNumTest = { +static __maybe_unused xtalk_coefs_t const asXtalkCoefsNumTest = { {0, 0, 0xF380, 0x8000, 0x6D60}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, @@ -188,7 +188,7 @@ static xtalk_coefs_t const asXtalkCoefsNumTest = { {0, 0, 0, 0, 0} };
-static xtalk_coefs_t const asXtalkCoefsDenTest = { +static __maybe_unused xtalk_coefs_t const asXtalkCoefsDenTest = { {0xC000, 0x2000, 0x4000, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, @@ -196,7 +196,7 @@ static xtalk_coefs_t const asXtalkCoefsDenTest = { {0, 0, 0, 0, 0} };
-static xtalk_state_t const asXtalkOutStateTest = { +static __maybe_unused xtalk_state_t const asXtalkOutStateTest = { {0x7FFF, 0x0004, 0xFFFC, 0}, {0xFE00, 0x0008, 0xFFF8, 0x4000}, {0x0200, 0x0010, 0xFFF0, 0xC000}, @@ -228,7 +228,7 @@ static xtalk_coefs_t const asDiamondCoefsLeftXt = { {0, 0, 0, 0, 0} };
-static xtalk_coefs_t const asDiamondCoefsRightXt = { +static __maybe_unused xtalk_coefs_t const asDiamondCoefsRightXt = { {0x3B50, 0xFE08, 0xF959, 0x0060, 0}, {0x9FCB, 0xD8F1, 0x00A2, 0x003A, 0}, {0, 0, 0, 0, 0},
On Thu, 02 Jul 2020 21:35:41 +0200, Pierre-Louis Bossart wrote:
This cleanup touches a lot of old - and very old code for hardware designed in the late 1990s/early 2000s -, hence the RFC status. I mostly did dumb edits just to make warnings go away, suggestions and feedback welcome.
Pierre-Louis Bossart (23): ALSA: isa/gus: remove -Wmissing-prototypes warnings ALSA: isa/gus: remove 'set but not used' warning ALSA: pci/asihpi: remove 'set but not used' warnings ALSA: pci/asihpi: fix kernel-doc ALSA: pci/asihpi: remove 'set but not used' warning ALSA: pci/echoaudio: remove 'set but not used' warning ALSA: pci/aw2-saa7146: remove 'set but not used' warning ALSA: pci/ctxfi/ctatc: fix kernel-doc ALSA: pci/ctxfi: fix kernel-doc warnings ALSA: usb/line6: remove 'defined but not used' warning ASoC: pci/emu10k1: remove "set but not used' warnings ALSA: firewire: fix kernel-doc ALSA: pci/emu10k1: remove 'set but not used' warning ALSA: pci/korg1212: remove 'set but not used' warnings ALSA: pci/rme9652/hdspm: remove always true condition ALSA: pci/oxygen/xonar_wm87x6: remove always true condition ALSA: xen: remove 'set but not used' warning ALSA: pci/es1938: remove 'set but not used' warning ALSA: pci/fm801: fix kernel-doc ALSA: pci/via82xx: remove 'set but not used' warnings ALSA: pcmcia/pdaudiocf: fix kernel-doc ALSA: vx_core: remove warning for empty loop body ALSA: pci/au88x0: remove "defined but not used" warnings
Those look OK although __maybe_unused and __always_unused aren't always intuitive. At least better than spewing the warnings unnecessarily.
The line6 patch hasn't been applied yet because it might be clearer to be replaced with define instead. A similar argument may be applied to au88x0 code, but this is much uglier and I'd take a more straightforward fix by your patch.
So, now all but patch#10 are applied to for-next branch.
Thanks!
Takashi
participants (3)
-
Pierre-Louis Bossart
-
Takashi Iwai
-
Takashi Sakamoto