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

ALSA: usb-audio: More constifications

Apply const prefix to the remaining places: the static table for the
unit information, the mixer maps, the validator tables, etc.

Just for minor optimization and no functional changes.

Link: https://lore.kernel.org/r/20200105144823.29547-12-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+73 -73
+30 -30
sound/usb/mixer.c
··· 1020 1020 int type_uac2; /* data type for uac2 if different from uac1, else -1 */ 1021 1021 }; 1022 1022 1023 - static struct usb_feature_control_info audio_feature_info[] = { 1023 + static const struct usb_feature_control_info audio_feature_info[] = { 1024 1024 { UAC_FU_MUTE, "Mute", USB_MIXER_INV_BOOLEAN, -1 }, 1025 1025 { UAC_FU_VOLUME, "Volume", USB_MIXER_S16, -1 }, 1026 1026 { UAC_FU_BASS, "Tone Control - Bass", USB_MIXER_S8, -1 }, ··· 1526 1526 strlcpy(kctl->id.name, "Headphone", sizeof(kctl->id.name)); 1527 1527 } 1528 1528 1529 - static struct usb_feature_control_info *get_feature_control_info(int control) 1529 + static const struct usb_feature_control_info *get_feature_control_info(int control) 1530 1530 { 1531 1531 int i; 1532 1532 ··· 1544 1544 struct usb_audio_term *oterm, 1545 1545 int unitid, int nameid, int readonly_mask) 1546 1546 { 1547 - struct usb_feature_control_info *ctl_info; 1547 + const struct usb_feature_control_info *ctl_info; 1548 1548 unsigned int len = 0; 1549 1549 int mapped_name = 0; 1550 1550 struct snd_kcontrol *kctl; ··· 2198 2198 */ 2199 2199 struct procunit_value_info { 2200 2200 int control; 2201 - char *suffix; 2201 + const char *suffix; 2202 2202 int val_type; 2203 2203 int min_value; 2204 2204 }; ··· 2206 2206 struct procunit_info { 2207 2207 int type; 2208 2208 char *name; 2209 - struct procunit_value_info *values; 2209 + const struct procunit_value_info *values; 2210 2210 }; 2211 2211 2212 - static struct procunit_value_info undefined_proc_info[] = { 2212 + static const struct procunit_value_info undefined_proc_info[] = { 2213 2213 { 0x00, "Control Undefined", 0 }, 2214 2214 { 0 } 2215 2215 }; 2216 2216 2217 - static struct procunit_value_info updown_proc_info[] = { 2217 + static const struct procunit_value_info updown_proc_info[] = { 2218 2218 { UAC_UD_ENABLE, "Switch", USB_MIXER_BOOLEAN }, 2219 2219 { UAC_UD_MODE_SELECT, "Mode Select", USB_MIXER_U8, 1 }, 2220 2220 { 0 } 2221 2221 }; 2222 - static struct procunit_value_info prologic_proc_info[] = { 2222 + static const struct procunit_value_info prologic_proc_info[] = { 2223 2223 { UAC_DP_ENABLE, "Switch", USB_MIXER_BOOLEAN }, 2224 2224 { UAC_DP_MODE_SELECT, "Mode Select", USB_MIXER_U8, 1 }, 2225 2225 { 0 } 2226 2226 }; 2227 - static struct procunit_value_info threed_enh_proc_info[] = { 2227 + static const struct procunit_value_info threed_enh_proc_info[] = { 2228 2228 { UAC_3D_ENABLE, "Switch", USB_MIXER_BOOLEAN }, 2229 2229 { UAC_3D_SPACE, "Spaciousness", USB_MIXER_U8 }, 2230 2230 { 0 } 2231 2231 }; 2232 - static struct procunit_value_info reverb_proc_info[] = { 2232 + static const struct procunit_value_info reverb_proc_info[] = { 2233 2233 { UAC_REVERB_ENABLE, "Switch", USB_MIXER_BOOLEAN }, 2234 2234 { UAC_REVERB_LEVEL, "Level", USB_MIXER_U8 }, 2235 2235 { UAC_REVERB_TIME, "Time", USB_MIXER_U16 }, 2236 2236 { UAC_REVERB_FEEDBACK, "Feedback", USB_MIXER_U8 }, 2237 2237 { 0 } 2238 2238 }; 2239 - static struct procunit_value_info chorus_proc_info[] = { 2239 + static const struct procunit_value_info chorus_proc_info[] = { 2240 2240 { UAC_CHORUS_ENABLE, "Switch", USB_MIXER_BOOLEAN }, 2241 2241 { UAC_CHORUS_LEVEL, "Level", USB_MIXER_U8 }, 2242 2242 { UAC_CHORUS_RATE, "Rate", USB_MIXER_U16 }, 2243 2243 { UAC_CHORUS_DEPTH, "Depth", USB_MIXER_U16 }, 2244 2244 { 0 } 2245 2245 }; 2246 - static struct procunit_value_info dcr_proc_info[] = { 2246 + static const struct procunit_value_info dcr_proc_info[] = { 2247 2247 { UAC_DCR_ENABLE, "Switch", USB_MIXER_BOOLEAN }, 2248 2248 { UAC_DCR_RATE, "Ratio", USB_MIXER_U16 }, 2249 2249 { UAC_DCR_MAXAMPL, "Max Amp", USB_MIXER_S16 }, ··· 2253 2253 { 0 } 2254 2254 }; 2255 2255 2256 - static struct procunit_info procunits[] = { 2256 + static const struct procunit_info procunits[] = { 2257 2257 { UAC_PROCESS_UP_DOWNMIX, "Up Down", updown_proc_info }, 2258 2258 { UAC_PROCESS_DOLBY_PROLOGIC, "Dolby Prologic", prologic_proc_info }, 2259 2259 { UAC_PROCESS_STEREO_EXTENDER, "3D Stereo Extender", threed_enh_proc_info }, ··· 2263 2263 { 0 }, 2264 2264 }; 2265 2265 2266 - static struct procunit_value_info uac3_updown_proc_info[] = { 2266 + static const struct procunit_value_info uac3_updown_proc_info[] = { 2267 2267 { UAC3_UD_MODE_SELECT, "Mode Select", USB_MIXER_U8, 1 }, 2268 2268 { 0 } 2269 2269 }; 2270 - static struct procunit_value_info uac3_stereo_ext_proc_info[] = { 2270 + static const struct procunit_value_info uac3_stereo_ext_proc_info[] = { 2271 2271 { UAC3_EXT_WIDTH_CONTROL, "Width Control", USB_MIXER_U8 }, 2272 2272 { 0 } 2273 2273 }; 2274 2274 2275 - static struct procunit_info uac3_procunits[] = { 2275 + static const struct procunit_info uac3_procunits[] = { 2276 2276 { UAC3_PROCESS_UP_DOWNMIX, "Up Down", uac3_updown_proc_info }, 2277 2277 { UAC3_PROCESS_STEREO_EXTENDER, "3D Stereo Extender", uac3_stereo_ext_proc_info }, 2278 2278 { UAC3_PROCESS_MULTI_FUNCTION, "Multi-Function", undefined_proc_info }, ··· 2282 2282 /* 2283 2283 * predefined data for extension units 2284 2284 */ 2285 - static struct procunit_value_info clock_rate_xu_info[] = { 2285 + static const struct procunit_value_info clock_rate_xu_info[] = { 2286 2286 { USB_XU_CLOCK_RATE_SELECTOR, "Selector", USB_MIXER_U8, 0 }, 2287 2287 { 0 } 2288 2288 }; 2289 - static struct procunit_value_info clock_source_xu_info[] = { 2289 + static const struct procunit_value_info clock_source_xu_info[] = { 2290 2290 { USB_XU_CLOCK_SOURCE_SELECTOR, "External", USB_MIXER_BOOLEAN }, 2291 2291 { 0 } 2292 2292 }; 2293 - static struct procunit_value_info spdif_format_xu_info[] = { 2293 + static const struct procunit_value_info spdif_format_xu_info[] = { 2294 2294 { USB_XU_DIGITAL_FORMAT_SELECTOR, "SPDIF/AC3", USB_MIXER_BOOLEAN }, 2295 2295 { 0 } 2296 2296 }; 2297 - static struct procunit_value_info soft_limit_xu_info[] = { 2297 + static const struct procunit_value_info soft_limit_xu_info[] = { 2298 2298 { USB_XU_SOFT_LIMIT_SELECTOR, " ", USB_MIXER_BOOLEAN }, 2299 2299 { 0 } 2300 2300 }; 2301 - static struct procunit_info extunits[] = { 2301 + static const struct procunit_info extunits[] = { 2302 2302 { USB_XU_CLOCK_RATE, "Clock rate", clock_rate_xu_info }, 2303 2303 { USB_XU_CLOCK_SOURCE, "DigitalIn CLK source", clock_source_xu_info }, 2304 2304 { USB_XU_DIGITAL_IO_STATUS, "DigitalOut format:", spdif_format_xu_info }, ··· 2310 2310 * build a processing/extension unit 2311 2311 */ 2312 2312 static int build_audio_procunit(struct mixer_build *state, int unitid, 2313 - void *raw_desc, struct procunit_info *list, 2313 + void *raw_desc, const struct procunit_info *list, 2314 2314 bool extension_unit) 2315 2315 { 2316 2316 struct uac_processing_unit_descriptor *desc = raw_desc; ··· 2318 2318 struct usb_mixer_elem_info *cval; 2319 2319 struct snd_kcontrol *kctl; 2320 2320 int i, err, nameid, type, len; 2321 - struct procunit_info *info; 2322 - struct procunit_value_info *valinfo; 2321 + const struct procunit_info *info; 2322 + const struct procunit_value_info *valinfo; 2323 2323 const struct usbmix_name_map *map; 2324 - static struct procunit_value_info default_value_info[] = { 2324 + static const struct procunit_value_info default_value_info[] = { 2325 2325 { 0x01, "Switch", USB_MIXER_BOOLEAN }, 2326 2326 { 0 } 2327 2327 }; 2328 - static struct procunit_info default_info = { 2328 + static const struct procunit_info default_info = { 2329 2329 0, NULL, default_value_info 2330 2330 }; 2331 2331 const char *name = extension_unit ? ··· 2803 2803 int st_chmask; /* side tone mixing channel mask */ 2804 2804 }; 2805 2805 2806 - static struct uac3_badd_profile uac3_badd_profiles[] = { 2806 + static const struct uac3_badd_profile uac3_badd_profiles[] = { 2807 2807 { 2808 2808 /* 2809 2809 * BAIF, BAOF or combination of both ··· 2864 2864 }; 2865 2865 2866 2866 static bool uac3_badd_func_has_valid_channels(struct usb_mixer_interface *mixer, 2867 - struct uac3_badd_profile *f, 2867 + const struct uac3_badd_profile *f, 2868 2868 int c_chmask, int p_chmask) 2869 2869 { 2870 2870 /* ··· 2908 2908 struct usb_device *dev = mixer->chip->dev; 2909 2909 struct usb_interface_assoc_descriptor *assoc; 2910 2910 int badd_profile = mixer->chip->badd_profile; 2911 - struct uac3_badd_profile *f; 2911 + const struct uac3_badd_profile *f; 2912 2912 const struct usbmix_ctl_map *map; 2913 2913 int p_chmask = 0, c_chmask = 0, st_chmask = 0; 2914 2914 int i; ··· 3174 3174 struct usb_mixer_elem_list *list) 3175 3175 { 3176 3176 struct usb_mixer_elem_info *cval = mixer_elem_list_to_info(list); 3177 - static char *val_types[] = {"BOOLEAN", "INV_BOOLEAN", 3177 + static const char * const val_types[] = {"BOOLEAN", "INV_BOOLEAN", 3178 3178 "S8", "U8", "S16", "U16"}; 3179 3179 snd_iprintf(buffer, " Info: id=%i, control=%i, cmask=0x%x, " 3180 3180 "channels=%i, type=\"%s\"\n", cval->head.id,
+28 -28
sound/usb/mixer_maps.c
··· 14 14 int id; 15 15 const char *name; 16 16 int control; 17 - struct usbmix_dB_map *dB; 17 + const struct usbmix_dB_map *dB; 18 18 }; 19 19 20 20 struct usbmix_selector_map { ··· 52 52 ++--+->SU[11]-->FU[12] --------------------------------------------------------------------------------------> USB_OUT[13] 53 53 */ 54 54 55 - static struct usbmix_name_map extigy_map[] = { 55 + static const struct usbmix_name_map extigy_map[] = { 56 56 /* 1: IT pcm */ 57 57 { 2, "PCM Playback" }, /* FU */ 58 58 /* 3: IT pcm */ ··· 93 93 * e.g. no Master and fake PCM volume 94 94 * Pavel Mihaylov <bin@bash.info> 95 95 */ 96 - static struct usbmix_dB_map mp3plus_dB_1 = {.min = -4781, .max = 0}; 96 + static const struct usbmix_dB_map mp3plus_dB_1 = {.min = -4781, .max = 0}; 97 97 /* just guess */ 98 - static struct usbmix_dB_map mp3plus_dB_2 = {.min = -1781, .max = 618}; 98 + static const struct usbmix_dB_map mp3plus_dB_2 = {.min = -1781, .max = 618}; 99 99 /* just guess */ 100 100 101 - static struct usbmix_name_map mp3plus_map[] = { 101 + static const struct usbmix_name_map mp3plus_map[] = { 102 102 /* 1: IT pcm */ 103 103 /* 2: IT mic */ 104 104 /* 3: IT line */ ··· 139 139 | ^ 140 140 +->FU[13]--------------------------------------+ 141 141 */ 142 - static struct usbmix_name_map audigy2nx_map[] = { 142 + static const struct usbmix_name_map audigy2nx_map[] = { 143 143 /* 1: IT pcm playback */ 144 144 /* 4: IT digital in */ 145 145 { 6, "Digital In Playback" }, /* FU */ ··· 167 167 { 0 } /* terminator */ 168 168 }; 169 169 170 - static struct usbmix_name_map mbox1_map[] = { 170 + static const struct usbmix_name_map mbox1_map[] = { 171 171 { 1, "Clock" }, 172 172 { 0 } /* terminator */ 173 173 }; 174 174 175 - static struct usbmix_selector_map c400_selectors[] = { 175 + static const struct usbmix_selector_map c400_selectors[] = { 176 176 { 177 177 .id = 0x80, 178 178 .count = 2, ··· 181 181 { 0 } /* terminator */ 182 182 }; 183 183 184 - static struct usbmix_selector_map audigy2nx_selectors[] = { 184 + static const struct usbmix_selector_map audigy2nx_selectors[] = { 185 185 { 186 186 .id = 14, /* Capture Source */ 187 187 .count = 3, ··· 201 201 }; 202 202 203 203 /* Creative SoundBlaster Live! 24-bit External */ 204 - static struct usbmix_name_map live24ext_map[] = { 204 + static const struct usbmix_name_map live24ext_map[] = { 205 205 /* 2: PCM Playback Volume */ 206 206 { 5, "Mic Capture" }, /* FU, default PCM Capture Volume */ 207 207 { 0 } /* terminator */ 208 208 }; 209 209 210 210 /* LineX FM Transmitter entry - needed to bypass controls bug */ 211 - static struct usbmix_name_map linex_map[] = { 211 + static const struct usbmix_name_map linex_map[] = { 212 212 /* 1: IT pcm */ 213 213 /* 2: OT Speaker */ 214 214 { 3, "Master" }, /* FU: master volume - left / right / mute */ 215 215 { 0 } /* terminator */ 216 216 }; 217 217 218 - static struct usbmix_name_map maya44_map[] = { 218 + static const struct usbmix_name_map maya44_map[] = { 219 219 /* 1: IT line */ 220 220 { 2, "Line Playback" }, /* FU */ 221 221 /* 3: IT line */ ··· 238 238 * so this map removes all unwanted sliders from alsamixer 239 239 */ 240 240 241 - static struct usbmix_name_map justlink_map[] = { 241 + static const struct usbmix_name_map justlink_map[] = { 242 242 /* 1: IT pcm playback */ 243 243 /* 2: Not present */ 244 244 { 3, NULL}, /* IT mic (No mic input on device) */ ··· 255 255 }; 256 256 257 257 /* TerraTec Aureon 5.1 MkII USB */ 258 - static struct usbmix_name_map aureon_51_2_map[] = { 258 + static const struct usbmix_name_map aureon_51_2_map[] = { 259 259 /* 1: IT USB */ 260 260 /* 2: IT Mic */ 261 261 /* 3: IT Line */ ··· 274 274 {} /* terminator */ 275 275 }; 276 276 277 - static struct usbmix_name_map scratch_live_map[] = { 277 + static const struct usbmix_name_map scratch_live_map[] = { 278 278 /* 1: IT Line 1 (USB streaming) */ 279 279 /* 2: OT Line 1 (Speaker) */ 280 280 /* 3: IT Line 1 (Line connector) */ ··· 290 290 { 0 } /* terminator */ 291 291 }; 292 292 293 - static struct usbmix_name_map ebox44_map[] = { 293 + static const struct usbmix_name_map ebox44_map[] = { 294 294 { 4, NULL }, /* FU */ 295 295 { 6, NULL }, /* MU */ 296 296 { 7, NULL }, /* FU */ ··· 305 305 * FIXME: or mp3plus_map should use "Capture Source" too, 306 306 * so this maps can be merget 307 307 */ 308 - static struct usbmix_name_map hercules_usb51_map[] = { 308 + static const struct usbmix_name_map hercules_usb51_map[] = { 309 309 { 8, "Capture Source" }, /* SU, default "PCM Capture Source" */ 310 310 { 9, "Master Playback" }, /* FU, default "Speaker Playback" */ 311 311 { 10, "Mic Boost", 7 }, /* FU, default "Auto Gain Input" */ ··· 316 316 }; 317 317 318 318 /* Plantronics Gamecom 780 has a broken volume control, better to disable it */ 319 - static struct usbmix_name_map gamecom780_map[] = { 319 + static const struct usbmix_name_map gamecom780_map[] = { 320 320 { 9, NULL }, /* FU, speaker out */ 321 321 {} 322 322 }; ··· 330 330 }; 331 331 332 332 /* Bose companion 5, the dB conversion factor is 16 instead of 256 */ 333 - static struct usbmix_dB_map bose_companion5_dB = {-5006, -6}; 334 - static struct usbmix_name_map bose_companion5_map[] = { 333 + static const struct usbmix_dB_map bose_companion5_dB = {-5006, -6}; 334 + static const struct usbmix_name_map bose_companion5_map[] = { 335 335 { 3, NULL, .dB = &bose_companion5_dB }, 336 336 { 0 } /* terminator */ 337 337 }; ··· 363 363 * Control map entries 364 364 */ 365 365 366 - static struct usbmix_ctl_map usbmix_ctl_maps[] = { 366 + static const struct usbmix_ctl_map usbmix_ctl_maps[] = { 367 367 { 368 368 .id = USB_ID(0x041e, 0x3000), 369 369 .map = extigy_map, ··· 495 495 * Control map entries for UAC3 BADD profiles 496 496 */ 497 497 498 - static struct usbmix_name_map uac3_badd_generic_io_map[] = { 498 + static const struct usbmix_name_map uac3_badd_generic_io_map[] = { 499 499 { UAC3_BADD_FU_ID2, "Generic Out Playback" }, 500 500 { UAC3_BADD_FU_ID5, "Generic In Capture" }, 501 501 { 0 } /* terminator */ 502 502 }; 503 - static struct usbmix_name_map uac3_badd_headphone_map[] = { 503 + static const struct usbmix_name_map uac3_badd_headphone_map[] = { 504 504 { UAC3_BADD_FU_ID2, "Headphone Playback" }, 505 505 { 0 } /* terminator */ 506 506 }; 507 - static struct usbmix_name_map uac3_badd_speaker_map[] = { 507 + static const struct usbmix_name_map uac3_badd_speaker_map[] = { 508 508 { UAC3_BADD_FU_ID2, "Speaker Playback" }, 509 509 { 0 } /* terminator */ 510 510 }; 511 - static struct usbmix_name_map uac3_badd_microphone_map[] = { 511 + static const struct usbmix_name_map uac3_badd_microphone_map[] = { 512 512 { UAC3_BADD_FU_ID5, "Mic Capture" }, 513 513 { 0 } /* terminator */ 514 514 }; 515 515 /* Covers also 'headset adapter' profile */ 516 - static struct usbmix_name_map uac3_badd_headset_map[] = { 516 + static const struct usbmix_name_map uac3_badd_headset_map[] = { 517 517 { UAC3_BADD_FU_ID2, "Headset Playback" }, 518 518 { UAC3_BADD_FU_ID5, "Headset Capture" }, 519 519 { UAC3_BADD_FU_ID7, "Sidetone Mixing" }, 520 520 { 0 } /* terminator */ 521 521 }; 522 - static struct usbmix_name_map uac3_badd_speakerphone_map[] = { 522 + static const struct usbmix_name_map uac3_badd_speakerphone_map[] = { 523 523 { UAC3_BADD_FU_ID2, "Speaker Playback" }, 524 524 { UAC3_BADD_FU_ID5, "Mic Capture" }, 525 525 { 0 } /* terminator */ 526 526 }; 527 527 528 - static struct usbmix_ctl_map uac3_badd_usbmix_ctl_maps[] = { 528 + static const struct usbmix_ctl_map uac3_badd_usbmix_ctl_maps[] = { 529 529 { 530 530 .id = UAC3_FUNCTION_SUBCLASS_GENERIC_IO, 531 531 .map = uac3_badd_generic_io_map,
+3 -3
sound/usb/mixer_quirks.c
··· 119 119 * Create a set of standard UAC controls from a table 120 120 */ 121 121 static int snd_create_std_mono_table(struct usb_mixer_interface *mixer, 122 - struct std_mono_table *t) 122 + const struct std_mono_table *t) 123 123 { 124 124 int err; 125 125 ··· 1386 1386 * are valid they presents mono controls as L and R channels of 1387 1387 * stereo. So we provide a good mixer here. 1388 1388 */ 1389 - static struct std_mono_table ebox44_table[] = { 1389 + static const struct std_mono_table ebox44_table[] = { 1390 1390 { 1391 1391 .unitid = 4, 1392 1392 .control = 1, ··· 1691 1691 static int snd_microii_controls_create(struct usb_mixer_interface *mixer) 1692 1692 { 1693 1693 int err, i; 1694 - static usb_mixer_elem_resume_func_t resume_funcs[] = { 1694 + const static usb_mixer_elem_resume_func_t resume_funcs[] = { 1695 1695 snd_microii_spdif_default_update, 1696 1696 NULL, 1697 1697 snd_microii_spdif_switch_update
+7 -7
sound/usb/mixer_scarlett.c
··· 633 633 /********************** device-specific config *************************/ 634 634 635 635 /* untested... */ 636 - static struct scarlett_device_info s6i6_info = { 636 + static const struct scarlett_device_info s6i6_info = { 637 637 .matrix_in = 18, 638 638 .matrix_out = 8, 639 639 .input_len = 6, ··· 675 675 }; 676 676 677 677 /* untested... */ 678 - static struct scarlett_device_info s8i6_info = { 678 + static const struct scarlett_device_info s8i6_info = { 679 679 .matrix_in = 18, 680 680 .matrix_out = 6, 681 681 .input_len = 8, ··· 714 714 } 715 715 }; 716 716 717 - static struct scarlett_device_info s18i6_info = { 717 + static const struct scarlett_device_info s18i6_info = { 718 718 .matrix_in = 18, 719 719 .matrix_out = 6, 720 720 .input_len = 18, ··· 751 751 } 752 752 }; 753 753 754 - static struct scarlett_device_info s18i8_info = { 754 + static const struct scarlett_device_info s18i8_info = { 755 755 .matrix_in = 18, 756 756 .matrix_out = 8, 757 757 .input_len = 18, ··· 793 793 } 794 794 }; 795 795 796 - static struct scarlett_device_info s18i20_info = { 796 + static const struct scarlett_device_info s18i20_info = { 797 797 .matrix_in = 18, 798 798 .matrix_out = 8, 799 799 .input_len = 18, ··· 843 843 844 844 845 845 static int scarlett_controls_create_generic(struct usb_mixer_interface *mixer, 846 - struct scarlett_device_info *info) 846 + const struct scarlett_device_info *info) 847 847 { 848 848 int i, err; 849 849 char mx[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; ··· 915 915 { 916 916 int err, i, o; 917 917 char mx[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 918 - struct scarlett_device_info *info; 918 + const struct scarlett_device_info *info; 919 919 struct usb_mixer_elem_info *elem; 920 920 static char sample_rate_buffer[4] = { '\x80', '\xbb', '\x00', '\x00' }; 921 921
+1 -1
sound/usb/proc.c
··· 60 60 static void proc_dump_substream_formats(struct snd_usb_substream *subs, struct snd_info_buffer *buffer) 61 61 { 62 62 struct audioformat *fp; 63 - static char *sync_types[4] = { 63 + static const char * const sync_types[4] = { 64 64 "NONE", "ASYNC", "ADAPTIVE", "SYNC" 65 65 }; 66 66
+2 -2
sound/usb/stream.c
··· 239 239 static struct snd_pcm_chmap_elem *convert_chmap(int channels, unsigned int bits, 240 240 int protocol) 241 241 { 242 - static unsigned int uac1_maps[] = { 242 + static const unsigned int uac1_maps[] = { 243 243 SNDRV_CHMAP_FL, /* left front */ 244 244 SNDRV_CHMAP_FR, /* right front */ 245 245 SNDRV_CHMAP_FC, /* center front */ ··· 254 254 SNDRV_CHMAP_TC, /* top */ 255 255 0 /* terminator */ 256 256 }; 257 - static unsigned int uac2_maps[] = { 257 + static const unsigned int uac2_maps[] = { 258 258 SNDRV_CHMAP_FL, /* front left */ 259 259 SNDRV_CHMAP_FR, /* front right */ 260 260 SNDRV_CHMAP_FC, /* front center */
+2 -2
sound/usb/validate.c
··· 233 233 #define FIXED(p, t, s) { .protocol = (p), .type = (t), .size = sizeof(s) } 234 234 #define FUNC(p, t, f) { .protocol = (p), .type = (t), .func = (f) } 235 235 236 - static struct usb_desc_validator audio_validators[] = { 236 + static const struct usb_desc_validator audio_validators[] = { 237 237 /* UAC1 */ 238 238 FUNC(UAC_VERSION_1, UAC_HEADER, validate_uac1_header), 239 239 FIXED(UAC_VERSION_1, UAC_INPUT_TERMINAL, ··· 288 288 { } /* terminator */ 289 289 }; 290 290 291 - static struct usb_desc_validator midi_validators[] = { 291 + static const struct usb_desc_validator midi_validators[] = { 292 292 FIXED(UAC_VERSION_ALL, USB_MS_HEADER, 293 293 struct usb_ms_header_descriptor), 294 294 FIXED(UAC_VERSION_ALL, USB_MS_MIDI_IN_JACK,