]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
ALSA: firewire: add const qualifier to identifiers for read-only symbols
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tue, 22 Aug 2017 13:58:15 +0000 (22:58 +0900)
committerTakashi Iwai <tiwai@suse.de>
Tue, 22 Aug 2017 14:08:00 +0000 (16:08 +0200)
Drivers in ALSA firewire stack still includes some symbols which can be
moved to a section for read-only symbols.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 files changed:
sound/firewire/bebob/bebob.h
sound/firewire/bebob/bebob_focusrite.c
sound/firewire/bebob/bebob_maudio.c
sound/firewire/bebob/bebob_terratec.c
sound/firewire/bebob/bebob_yamaha_terratec.c
sound/firewire/dice/dice.c
sound/firewire/fireface/ff-protocol-ff400.c
sound/firewire/fireface/ff.c
sound/firewire/fireface/ff.h
sound/firewire/fireworks/fireworks_proc.c
sound/firewire/motu/motu.c
sound/firewire/oxfw/oxfw-scs1x.c
sound/firewire/tascam/tascam.c

index 17678d6ab5a2d9b93e7a318c382c4f58ec1805d5..df1b1e94c43c94b82044a55801a0846efac6c1b3 100644 (file)
@@ -58,7 +58,7 @@ enum snd_bebob_clock_type {
 struct snd_bebob_clock_spec {
        unsigned int num;
        const char *const *labels;
-       enum snd_bebob_clock_type *types;
+       const enum snd_bebob_clock_type *types;
        int (*get)(struct snd_bebob *bebob, unsigned int *id);
 };
 struct snd_bebob_rate_spec {
index f1109005794944cd759b90ede92a6fc601ab251e..52b8b61ecddd2d6a467992e7c5cc48b66df6ea21 100644 (file)
@@ -103,12 +103,12 @@ saffire_write_quad(struct snd_bebob *bebob, u64 offset, u32 value)
                                  &data, sizeof(__be32), 0);
 }
 
-static enum snd_bebob_clock_type saffirepro_10_clk_src_types[] = {
+static const enum snd_bebob_clock_type saffirepro_10_clk_src_types[] = {
        SND_BEBOB_CLOCK_TYPE_INTERNAL,
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* S/PDIF */
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* Word Clock */
 };
-static enum snd_bebob_clock_type saffirepro_26_clk_src_types[] = {
+static const enum snd_bebob_clock_type saffirepro_26_clk_src_types[] = {
        SND_BEBOB_CLOCK_TYPE_INTERNAL,
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* S/PDIF */
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* ADAT1 */
@@ -201,7 +201,7 @@ end:
 }
 
 const struct snd_bebob_spec saffire_le_spec;
-static enum snd_bebob_clock_type saffire_both_clk_src_types[] = {
+static const enum snd_bebob_clock_type saffire_both_clk_src_types[] = {
        SND_BEBOB_CLOCK_TYPE_INTERNAL,
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,
 };
index d10208f92edfa520ef68579f6961f5e36791bf5a..bd55620c6a479315f6787eb26de2c73bf4913eb6 100644 (file)
@@ -340,7 +340,7 @@ end:
 }
 
 /* Clock source control for special firmware */
-static enum snd_bebob_clock_type special_clk_types[] = {
+static const enum snd_bebob_clock_type special_clk_types[] = {
        SND_BEBOB_CLOCK_TYPE_INTERNAL,  /* With digital mute */
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* SPDIF/ADAT */
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* Word Clock */
index 2fdaf93e7a8d3d69d8fa28e91a611c8776b52e76..9770c2127a7a589d8497595f45c59bc4c5c195ee 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "./bebob.h"
 
-static enum snd_bebob_clock_type phase88_rack_clk_src_types[] = {
+static const enum snd_bebob_clock_type phase88_rack_clk_src_types[] = {
        SND_BEBOB_CLOCK_TYPE_INTERNAL,
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* S/PDIF */
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* Word Clock */
index a6be3e7138e0586cfac6c6ee2b9e67906894f4aa..8bd78fef3516251d17fb56a64b244dfed2b4daea 100644 (file)
@@ -31,7 +31,7 @@
  * Yamaha GO 44 and GO 46. Yamaha and Terratec had cooperated for these models.
  */
 
-static enum snd_bebob_clock_type clk_src_types[] = {
+static const enum snd_bebob_clock_type clk_src_types[] = {
        SND_BEBOB_CLOCK_TYPE_INTERNAL,
        SND_BEBOB_CLOCK_TYPE_EXTERNAL,  /* S/PDIF */
 };
index 25e9f77275c4dd6ef6a39da8e9f77294f86f876c..4ddb4cdd054b860142da4356dc6abeef44b4c698 100644 (file)
@@ -26,7 +26,7 @@ MODULE_LICENSE("GPL v2");
  */
 static bool force_two_pcm_support(struct fw_unit *unit)
 {
-       const char *const models[] = {
+       static const char *const models[] = {
                /* TC Electronic models. */
                "StudioKonnekt48",
                /* Focusrite models. */
index fcec6de80eebc724e3f59c7761c783f6371aa804..12aa15df435d1cca2bf6f3cf42b60704b2340004 100644 (file)
@@ -356,7 +356,7 @@ static void ff400_dump_clock_config(struct snd_ff *ff,
        snd_iprintf(buffer, "Sync to clock source: %s\n", src);
 }
 
-struct snd_ff_protocol snd_ff_protocol_ff400 = {
+const struct snd_ff_protocol snd_ff_protocol_ff400 = {
        .get_clock              = ff400_get_clock,
        .begin_session          = ff400_begin_session,
        .finish_session         = ff400_finish_session,
index eee7c8eac7a61908b53dfa0862b0ca0b5e98ab2a..4974bc7980e9b476611d78cc79a48275259a12b9 100644 (file)
@@ -157,7 +157,7 @@ static void snd_ff_remove(struct fw_unit *unit)
        }
 }
 
-static struct snd_ff_spec spec_ff400 = {
+static const struct snd_ff_spec spec_ff400 = {
        .name = "Fireface400",
        .pcm_capture_channels = {18, 14, 10},
        .pcm_playback_channels = {18, 14, 10},
index 3cb812a500305eaa45d9cb3dcfad77a85eff2687..64df44beb95058ab42f51d195edc4f6497edea88 100644 (file)
@@ -47,7 +47,7 @@ struct snd_ff_spec {
        unsigned int midi_in_ports;
        unsigned int midi_out_ports;
 
-       struct snd_ff_protocol *protocol;
+       const struct snd_ff_protocol *protocol;
 };
 
 struct snd_ff {
@@ -112,7 +112,7 @@ struct snd_ff_protocol {
        u64 midi_rx_port_1_reg;
 };
 
-extern struct snd_ff_protocol snd_ff_protocol_ff400;
+extern const struct snd_ff_protocol snd_ff_protocol_ff400;
 
 int snd_ff_transaction_register(struct snd_ff *ff);
 int snd_ff_transaction_reregister(struct snd_ff *ff);
index beb0a0ffee57c4cfbb72845dd16a6f27b1c165ba..9c21f31b8b21c9f05ceaabcf0ce49cc86eb46681 100644 (file)
@@ -12,7 +12,7 @@
 static inline const char*
 get_phys_name(struct snd_efw_phys_grp *grp, bool input)
 {
-       const char *const ch_type[] = {
+       static const char *const ch_type[] = {
                "Analog", "S/PDIF", "ADAT", "S/PDIF or ADAT", "Mirroring",
                "Headphones", "I2S", "Guitar", "Pirzo Guitar", "Guitar String",
        };
index 2bbb764822fc07dcc7b5426d88aab7fdbac86374..0d6b526105ab08b8e905f2988548d3662ff37302 100644 (file)
@@ -194,7 +194,7 @@ static void motu_bus_update(struct fw_unit *unit)
        snd_motu_transaction_reregister(motu);
 }
 
-static struct snd_motu_spec motu_828mk2 = {
+static const struct snd_motu_spec motu_828mk2 = {
        .name = "828mk2",
        .protocol = &snd_motu_protocol_v2,
        .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
@@ -208,7 +208,7 @@ static struct snd_motu_spec motu_828mk2 = {
        .analog_out_ports = 8,
 };
 
-static struct snd_motu_spec motu_828mk3 = {
+static const struct snd_motu_spec motu_828mk3 = {
        .name = "828mk3",
        .protocol = &snd_motu_protocol_v3,
        .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
@@ -225,7 +225,7 @@ static struct snd_motu_spec motu_828mk3 = {
        .analog_out_ports = 8,
 };
 
-static struct snd_motu_spec motu_audio_express = {
+static const struct snd_motu_spec motu_audio_express = {
        .name = "AudioExpress",
        .protocol = &snd_motu_protocol_v3,
        .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
index 93209ebd91214ed514a43a42e729f31d68e21855..02d5956658987424fdb9ca4ff8b79d68f0b47051 100644 (file)
@@ -297,12 +297,6 @@ static void midi_capture_trigger(struct snd_rawmidi_substream *stream, int up)
        }
 }
 
-static const struct snd_rawmidi_ops midi_capture_ops = {
-       .open    = midi_capture_open,
-       .close   = midi_capture_close,
-       .trigger = midi_capture_trigger,
-};
-
 static int midi_playback_open(struct snd_rawmidi_substream *stream)
 {
        return 0;
@@ -363,6 +357,11 @@ void snd_oxfw_scs1x_update(struct snd_oxfw *oxfw)
 
 int snd_oxfw_scs1x_add(struct snd_oxfw *oxfw)
 {
+       static const struct snd_rawmidi_ops midi_capture_ops = {
+               .open    = midi_capture_open,
+               .close   = midi_capture_close,
+               .trigger = midi_capture_trigger,
+       };
        static const struct snd_rawmidi_ops midi_playback_ops = {
                .open    = midi_playback_open,
                .close   = midi_playback_close,
index 9dc93a7eb9da420fb871d7b28007b67b4d37f261..44ad41fb7374070458de78e991330a744d3f0aff 100644 (file)
@@ -12,7 +12,7 @@ MODULE_DESCRIPTION("TASCAM FireWire series Driver");
 MODULE_AUTHOR("Takashi Sakamoto <o-takashi@sakamocchi.jp>");
 MODULE_LICENSE("GPL v2");
 
-static struct snd_tscm_spec model_specs[] = {
+static const struct snd_tscm_spec model_specs[] = {
        {
                .name = "FW-1884",
                .has_adat = true,