Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: firewire: add const qualifier to identifiers for read-only symbols

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>

authored by

Takashi Sakamoto and committed by
Takashi Iwai
782fbec7 241bc82e

+22 -23
+1 -1
sound/firewire/bebob/bebob.h
··· 58 58 struct snd_bebob_clock_spec { 59 59 unsigned int num; 60 60 const char *const *labels; 61 - enum snd_bebob_clock_type *types; 61 + const enum snd_bebob_clock_type *types; 62 62 int (*get)(struct snd_bebob *bebob, unsigned int *id); 63 63 }; 64 64 struct snd_bebob_rate_spec {
+3 -3
sound/firewire/bebob/bebob_focusrite.c
··· 103 103 &data, sizeof(__be32), 0); 104 104 } 105 105 106 - static enum snd_bebob_clock_type saffirepro_10_clk_src_types[] = { 106 + static const enum snd_bebob_clock_type saffirepro_10_clk_src_types[] = { 107 107 SND_BEBOB_CLOCK_TYPE_INTERNAL, 108 108 SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* S/PDIF */ 109 109 SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* Word Clock */ 110 110 }; 111 - static enum snd_bebob_clock_type saffirepro_26_clk_src_types[] = { 111 + static const enum snd_bebob_clock_type saffirepro_26_clk_src_types[] = { 112 112 SND_BEBOB_CLOCK_TYPE_INTERNAL, 113 113 SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* S/PDIF */ 114 114 SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* ADAT1 */ ··· 201 201 } 202 202 203 203 const struct snd_bebob_spec saffire_le_spec; 204 - static enum snd_bebob_clock_type saffire_both_clk_src_types[] = { 204 + static const enum snd_bebob_clock_type saffire_both_clk_src_types[] = { 205 205 SND_BEBOB_CLOCK_TYPE_INTERNAL, 206 206 SND_BEBOB_CLOCK_TYPE_EXTERNAL, 207 207 };
+1 -1
sound/firewire/bebob/bebob_maudio.c
··· 340 340 } 341 341 342 342 /* Clock source control for special firmware */ 343 - static enum snd_bebob_clock_type special_clk_types[] = { 343 + static const enum snd_bebob_clock_type special_clk_types[] = { 344 344 SND_BEBOB_CLOCK_TYPE_INTERNAL, /* With digital mute */ 345 345 SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* SPDIF/ADAT */ 346 346 SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* Word Clock */
+1 -1
sound/firewire/bebob/bebob_terratec.c
··· 8 8 9 9 #include "./bebob.h" 10 10 11 - static enum snd_bebob_clock_type phase88_rack_clk_src_types[] = { 11 + static const enum snd_bebob_clock_type phase88_rack_clk_src_types[] = { 12 12 SND_BEBOB_CLOCK_TYPE_INTERNAL, 13 13 SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* S/PDIF */ 14 14 SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* Word Clock */
+1 -1
sound/firewire/bebob/bebob_yamaha_terratec.c
··· 31 31 * Yamaha GO 44 and GO 46. Yamaha and Terratec had cooperated for these models. 32 32 */ 33 33 34 - static enum snd_bebob_clock_type clk_src_types[] = { 34 + static const enum snd_bebob_clock_type clk_src_types[] = { 35 35 SND_BEBOB_CLOCK_TYPE_INTERNAL, 36 36 SND_BEBOB_CLOCK_TYPE_EXTERNAL, /* S/PDIF */ 37 37 };
+1 -1
sound/firewire/dice/dice.c
··· 26 26 */ 27 27 static bool force_two_pcm_support(struct fw_unit *unit) 28 28 { 29 - const char *const models[] = { 29 + static const char *const models[] = { 30 30 /* TC Electronic models. */ 31 31 "StudioKonnekt48", 32 32 /* Focusrite models. */
+1 -1
sound/firewire/fireface/ff-protocol-ff400.c
··· 356 356 snd_iprintf(buffer, "Sync to clock source: %s\n", src); 357 357 } 358 358 359 - struct snd_ff_protocol snd_ff_protocol_ff400 = { 359 + const struct snd_ff_protocol snd_ff_protocol_ff400 = { 360 360 .get_clock = ff400_get_clock, 361 361 .begin_session = ff400_begin_session, 362 362 .finish_session = ff400_finish_session,
+1 -1
sound/firewire/fireface/ff.c
··· 157 157 } 158 158 } 159 159 160 - static struct snd_ff_spec spec_ff400 = { 160 + static const struct snd_ff_spec spec_ff400 = { 161 161 .name = "Fireface400", 162 162 .pcm_capture_channels = {18, 14, 10}, 163 163 .pcm_playback_channels = {18, 14, 10},
+2 -2
sound/firewire/fireface/ff.h
··· 47 47 unsigned int midi_in_ports; 48 48 unsigned int midi_out_ports; 49 49 50 - struct snd_ff_protocol *protocol; 50 + const struct snd_ff_protocol *protocol; 51 51 }; 52 52 53 53 struct snd_ff { ··· 112 112 u64 midi_rx_port_1_reg; 113 113 }; 114 114 115 - extern struct snd_ff_protocol snd_ff_protocol_ff400; 115 + extern const struct snd_ff_protocol snd_ff_protocol_ff400; 116 116 117 117 int snd_ff_transaction_register(struct snd_ff *ff); 118 118 int snd_ff_transaction_reregister(struct snd_ff *ff);
+1 -1
sound/firewire/fireworks/fireworks_proc.c
··· 12 12 static inline const char* 13 13 get_phys_name(struct snd_efw_phys_grp *grp, bool input) 14 14 { 15 - const char *const ch_type[] = { 15 + static const char *const ch_type[] = { 16 16 "Analog", "S/PDIF", "ADAT", "S/PDIF or ADAT", "Mirroring", 17 17 "Headphones", "I2S", "Guitar", "Pirzo Guitar", "Guitar String", 18 18 };
+3 -3
sound/firewire/motu/motu.c
··· 194 194 snd_motu_transaction_reregister(motu); 195 195 } 196 196 197 - static struct snd_motu_spec motu_828mk2 = { 197 + static const struct snd_motu_spec motu_828mk2 = { 198 198 .name = "828mk2", 199 199 .protocol = &snd_motu_protocol_v2, 200 200 .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 | ··· 208 208 .analog_out_ports = 8, 209 209 }; 210 210 211 - static struct snd_motu_spec motu_828mk3 = { 211 + static const struct snd_motu_spec motu_828mk3 = { 212 212 .name = "828mk3", 213 213 .protocol = &snd_motu_protocol_v3, 214 214 .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 | ··· 225 225 .analog_out_ports = 8, 226 226 }; 227 227 228 - static struct snd_motu_spec motu_audio_express = { 228 + static const struct snd_motu_spec motu_audio_express = { 229 229 .name = "AudioExpress", 230 230 .protocol = &snd_motu_protocol_v3, 231 231 .flags = SND_MOTU_SPEC_SUPPORT_CLOCK_X2 |
+5 -6
sound/firewire/oxfw/oxfw-scs1x.c
··· 297 297 } 298 298 } 299 299 300 - static const struct snd_rawmidi_ops midi_capture_ops = { 301 - .open = midi_capture_open, 302 - .close = midi_capture_close, 303 - .trigger = midi_capture_trigger, 304 - }; 305 - 306 300 static int midi_playback_open(struct snd_rawmidi_substream *stream) 307 301 { 308 302 return 0; ··· 357 363 358 364 int snd_oxfw_scs1x_add(struct snd_oxfw *oxfw) 359 365 { 366 + static const struct snd_rawmidi_ops midi_capture_ops = { 367 + .open = midi_capture_open, 368 + .close = midi_capture_close, 369 + .trigger = midi_capture_trigger, 370 + }; 360 371 static const struct snd_rawmidi_ops midi_playback_ops = { 361 372 .open = midi_playback_open, 362 373 .close = midi_playback_close,
+1 -1
sound/firewire/tascam/tascam.c
··· 12 12 MODULE_AUTHOR("Takashi Sakamoto <o-takashi@sakamocchi.jp>"); 13 13 MODULE_LICENSE("GPL v2"); 14 14 15 - static struct snd_tscm_spec model_specs[] = { 15 + static const struct snd_tscm_spec model_specs[] = { 16 16 { 17 17 .name = "FW-1884", 18 18 .has_adat = true,