Skip to contentSkip to conversation

ALSA: emu10k1: set variables emu1010_routing_info and emu1010_pads_info storage-class-specifier to static

PATCH Applied Tom Rix 3 participants 4 messages May 18, 2023 Sound

lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 ALSA: emu10k1: set variables emu1010_routing_info and emu1010_pads_info storage-class-specifier to static

smatch reports
sound/pci/emu10k1/emumixer.c:519:39: warning: symbol
'emu1010_routing_info' was not declared. Should it be static?
sound/pci/emu10k1/emumixer.c:859:36: warning: symbol
'emu1010_pads_info' was not declared. Should it be static?

These variables are only used in their defining file, so it should be static

---
 sound/pci/emu10k1/emumixer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/emu10k1/emumixer.c +2 -2
index 3a7f25f81504..26ed7e2fe053 100644
@@ -516,7 +516,7 @@ struct snd_emu1010_routing_info {
 	unsigned n_ins;
 };
 
-const struct snd_emu1010_routing_info emu1010_routing_info[] = {
+static const struct snd_emu1010_routing_info emu1010_routing_info[] = {
 	{
 		/* rev1 1010 */
 		.src_regs = emu1010_src_regs,
@@ -856,7 +856,7 @@ struct snd_emu1010_pads_info {
 	unsigned n_adc_ctls, n_dac_ctls;
 };
 
-const struct snd_emu1010_pads_info emu1010_pads_info[] = {
+static const struct snd_emu1010_pads_info emu1010_pads_info[] = {
 	{
 		/* rev1 1010 */
 		.adc_ctls = snd_emu1010_adc_pads,
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Tom Rix

smatch reports

^^^^^^ is this the best word to use here?

Quoted 6 lines

sound/pci/emu10k1/emumixer.c:519:39: warning: symbol
'emu1010_routing_info' was not declared. Should it be static?
sound/pci/emu10k1/emumixer.c:859:36: warning: symbol
'emu1010_pads_info' was not declared. Should it be static?

These variables are only used in their defining file, so it should be static

							  ^^ they
Quoted 3 lines

(also amending one of the still pending patches. thanks!)

regards

author
#2 lore raw
Quoted 3 lines · Oswald Buddenhagen
Quoted 1 line · Tom Rix

smatch reports

 ^^^^^^ is this the best word to use here?

I have been running smatch against the whole tree for a while, using this preamble.

Many fixes later, for the most part the tree has been cleaned of this class of problems.

Tom

Quoted 17 lines
Quoted 7 lines

sound/pci/emu10k1/emumixer.c:519:39: warning: symbol 'emu1010_routing_info' was not declared. Should it be static? sound/pci/emu10k1/emumixer.c:859:36: warning: symbol 'emu1010_pads_info' was not declared. Should it be static?

These variables are only used in their defining file, so it should be static

                              ^^ they

Quoted 3 lines

(also amending one of the still pending patches. thanks!)

regards

Applied
#3 lore raw
In reply to Oswald Buddenhagen
Quoted 4 lines · Oswald Buddenhagen
Quoted 1 line · Tom Rix

smatch reports

^^^^^^ is this the best word to use here?

Note that smatch is a name of a static analysis tool :)

Quoted 5 lines
Quoted 5 lines

sound/pci/emu10k1/emumixer.c:519:39: warning: symbol
'emu1010_routing_info' was not declared. Should it be static?
sound/pci/emu10k1/emumixer.c:859:36: warning: symbol
'emu1010_pads_info' was not declared. Should it be static?

Quoted 8 lines
Quoted 1 line

These variables are only used in their defining file, so it should be static

							  ^^ they
Quoted 3 lines

(also amending one of the still pending patches. thanks!)

Applied the patch now, thanks.

Takashi