ALSA: opl3: Declare common variables properly
authorTakashi Iwai <tiwai@suse.de>
Wed, 25 Jul 2018 21:00:52 +0000 (23:00 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 26 Jul 2018 06:31:48 +0000 (08:31 +0200)
Move the declarations of common variables into opl3_voice.h instead of
declaring at each file multiple times, which was error-prone.

This fixes sparse warnings like:
  sound/drivers/opl3/opl3_synth.c:51:6: warning: symbol 'snd_opl3_regmap' was not declared. Should it be static?

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/opl3/opl3_drums.c
sound/drivers/opl3/opl3_lib.c
sound/drivers/opl3/opl3_midi.c
sound/drivers/opl3/opl3_oss.c
sound/drivers/opl3/opl3_synth.c
sound/drivers/opl3/opl3_voice.h

index 73694380734af625817298a4ca55df22616d24a1..14929822956c8ff7329a5885d2246f5e5456c751 100644 (file)
@@ -21,8 +21,6 @@
 
 #include "opl3_voice.h"
 
-extern char snd_opl3_regmap[MAX_OPL2_VOICES][4];
-
 static char snd_opl3_drum_table[47] =
 {
        OPL3_BASSDRUM_ON,  OPL3_BASSDRUM_ON,  OPL3_HIHAT_ON,    /* 35 - 37 */
index 588963d6be281daac008fdfe70cdfcc058c9df86..1a5355b747ec18954437be96fc68fc2a9869559b 100644 (file)
 #include <linux/slab.h>
 #include <linux/ioport.h>
 #include <sound/minors.h>
+#include "opl3_voice.h"
 
 MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Hannu Savolainen 1993-1996, Rob Hooft");
 MODULE_DESCRIPTION("Routines for control of AdLib FM cards (OPL2/OPL3/OPL4 chips)");
 MODULE_LICENSE("GPL");
 
-extern char snd_opl3_regmap[MAX_OPL2_VOICES][4];
-
 static void snd_opl2_command(struct snd_opl3 * opl3, unsigned short cmd, unsigned char val)
 {
        unsigned long flags;
index 71cd5a2fbe824744fac73822152ff541ca7b5f88..471916ca0b6bbc6be7bb2404f529bd111f936143 100644 (file)
 #include "opl3_voice.h"
 #include <sound/asoundef.h>
 
-extern char snd_opl3_regmap[MAX_OPL2_VOICES][4];
-
-extern bool use_internal_drums;
-
 static void snd_opl3_note_off_unsafe(void *p, int note, int vel,
                                     struct snd_midi_channel *chan);
 /*
index 8a0ce3f43f42ac15b74a6bca9dfa84e994dda51a..869220ced4edd0bfb93efa78e13f1fedba032f76 100644 (file)
@@ -29,8 +29,6 @@ static int snd_opl3_reset_seq_oss(struct snd_seq_oss_arg *arg);
 
 /* operators */
 
-extern struct snd_midi_op opl3_ops;
-
 static struct snd_seq_oss_callback oss_callback = {
        .owner =        THIS_MODULE,
        .open =         snd_opl3_open_seq_oss,
index 42920a2433282befccd62aaa43bbec949fe22e6c..d522925fc5c08cddb90788dff0d842d91f712742 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/nospec.h>
 #include <sound/opl3.h>
 #include <sound/asound_fm.h>
+#include "opl3_voice.h"
 
 #if IS_ENABLED(CONFIG_SND_SEQUENCER)
 #define OPL3_SUPPORT_SYNTH
index a2445163008ec14c155a193c93a9e25e4b974b41..5b02bd49fde407a5f020eb44cf09a88d5413f37e 100644 (file)
@@ -52,4 +52,8 @@ void snd_opl3_free_seq_oss(struct snd_opl3 *opl3);
 #define snd_opl3_free_seq_oss(opl3) /* NOP */
 #endif
 
+extern char snd_opl3_regmap[MAX_OPL2_VOICES][4];
+extern bool use_internal_drums;
+extern struct snd_midi_op opl3_ops;
+
 #endif