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

ALSA: au88x0: More constifications

Apply const prefix to each possible place: the static register tables,
the coef tables, the string arrays, etc.

Just for minor optimization and no functional changes.

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

+23 -23
+1 -1
sound/pci/au88x0/au88x0_core.c
··· 1989 1989 // Higher level ADB audio path (de)allocator. 1990 1990 1991 1991 /* Resource manager */ 1992 - static int resnum[VORTEX_RESOURCE_LAST] = 1992 + static const int resnum[VORTEX_RESOURCE_LAST] = 1993 1993 { NR_ADB, NR_SRC, NR_MIXIN, NR_MIXOUT, NR_A3D }; 1994 1994 /* 1995 1995 Checkout/Checkin resource of given type.
+11 -11
sound/pci/au88x0/au88x0_eq.c
··· 51 51 return -a; 52 52 } 53 53 54 - static void vortex_EqHw_SetLeftCoefs(vortex_t * vortex, u16 coefs[]) 54 + static void vortex_EqHw_SetLeftCoefs(vortex_t *vortex, const u16 coefs[]) 55 55 { 56 56 eqhw_t *eqhw = &(vortex->eq.this04); 57 57 int i = 0, n /*esp2c */; ··· 73 73 } 74 74 } 75 75 76 - static void vortex_EqHw_SetRightCoefs(vortex_t * vortex, u16 coefs[]) 76 + static void vortex_EqHw_SetRightCoefs(vortex_t *vortex, const u16 coefs[]) 77 77 { 78 78 eqhw_t *eqhw = &(vortex->eq.this04); 79 79 int i = 0, n /*esp2c */; ··· 96 96 97 97 } 98 98 99 - static void vortex_EqHw_SetLeftStates(vortex_t * vortex, u16 a[], u16 b[]) 99 + static void vortex_EqHw_SetLeftStates(vortex_t *vortex, const u16 a[], const u16 b[]) 100 100 { 101 101 eqhw_t *eqhw = &(vortex->eq.this04); 102 102 int i = 0, ebx; ··· 113 113 } 114 114 } 115 115 116 - static void vortex_EqHw_SetRightStates(vortex_t * vortex, u16 a[], u16 b[]) 116 + static void vortex_EqHw_SetRightStates(vortex_t *vortex, const u16 a[], const u16 b[]) 117 117 { 118 118 eqhw_t *eqhw = &(vortex->eq.this04); 119 119 int i = 0, ebx; ··· 206 206 hwwrite(vortex->mmio, 0x2b20c + (index * 0x30), b); 207 207 } 208 208 209 - static void vortex_EqHw_SetLeftGainsTarget(vortex_t * vortex, u16 a[]) 209 + static void vortex_EqHw_SetLeftGainsTarget(vortex_t *vortex, const u16 a[]) 210 210 { 211 211 eqhw_t *eqhw = &(vortex->eq.this04); 212 212 int ebx; ··· 216 216 } 217 217 } 218 218 219 - static void vortex_EqHw_SetRightGainsTarget(vortex_t * vortex, u16 a[]) 219 + static void vortex_EqHw_SetRightGainsTarget(vortex_t *vortex, const u16 a[]) 220 220 { 221 221 eqhw_t *eqhw = &(vortex->eq.this04); 222 222 int ebx; ··· 226 226 } 227 227 } 228 228 229 - static void vortex_EqHw_SetLeftGainsCurrent(vortex_t * vortex, u16 a[]) 229 + static void vortex_EqHw_SetLeftGainsCurrent(vortex_t *vortex, const u16 a[]) 230 230 { 231 231 eqhw_t *eqhw = &(vortex->eq.this04); 232 232 int ebx; ··· 236 236 } 237 237 } 238 238 239 - static void vortex_EqHw_SetRightGainsCurrent(vortex_t * vortex, u16 a[]) 239 + static void vortex_EqHw_SetRightGainsCurrent(vortex_t *vortex, const u16 a[]) 240 240 { 241 241 eqhw_t *eqhw = &(vortex->eq.this04); 242 242 int ebx; ··· 309 309 310 310 #endif 311 311 /* EQ band levels settings */ 312 - static void vortex_EqHw_SetLevels(vortex_t * vortex, u16 peaks[]) 312 + static void vortex_EqHw_SetLevels(vortex_t *vortex, const u16 peaks[]) 313 313 { 314 314 eqhw_t *eqhw = &(vortex->eq.this04); 315 315 int i; ··· 574 574 } 575 575 576 576 static int 577 - vortex_Eqlzr_SetAllBands(vortex_t * vortex, u16 gains[], s32 count) 577 + vortex_Eqlzr_SetAllBands(vortex_t *vortex, const u16 gains[], s32 count) 578 578 { 579 579 eqlzr_t *eq = &(vortex->eq); 580 580 int i; ··· 852 852 }; 853 853 854 854 /* EQ band gain labels. */ 855 - static char *EqBandLabels[10] = { 855 + static const char * const EqBandLabels[10] = { 856 856 "EQ0 31Hz\0", 857 857 "EQ1 63Hz\0", 858 858 "EQ2 125Hz\0",
+9 -9
sound/pci/au88x0/au88x0_eqdata.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 /* Data structs */ 3 3 4 - static u16 asEqCoefsZeros[50] = { 4 + static const u16 asEqCoefsZeros[50] = { 5 5 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 6 6 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 7 7 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, ··· 14 14 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 15 15 }; 16 16 17 - static u16 asEqCoefsPipes[64] = { 17 + static const u16 asEqCoefsPipes[64] = { 18 18 0x0000, 0x0000, 19 19 0x0000, 0x0666, 0x0000, 0x0000, 0x0666, 20 20 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, ··· 33 33 }; 34 34 35 35 /* More coef sets can be found in the win2k "inf" file. */ 36 - static auxxEqCoeffSet_t asEqCoefsNormal = { 36 + static const auxxEqCoeffSet_t asEqCoefsNormal = { 37 37 .LeftCoefs = { 38 38 0x7e60, 0xc19e, 0x0001, 0x0002, 0x0001, 39 39 0x7fa0, 0xc05f, 0x004f, 0x0000, 0xffb1, ··· 66 66 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96} 67 67 }; 68 68 69 - static u16 eq_gains_normal[20] = { 69 + static const u16 eq_gains_normal[20] = { 70 70 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, 71 71 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, 72 72 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, ··· 74 74 }; 75 75 76 76 /* _rodatab60 */ 77 - static u16 eq_gains_zero[10] = { 77 + static const u16 eq_gains_zero[10] = { 78 78 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 79 79 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 80 80 }; 81 81 82 82 /* _rodatab7c: ProgramPipe */ 83 - static u16 eq_gains_current[12] = { 83 + static const u16 eq_gains_current[12] = { 84 84 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 85 85 0x7fff, 86 86 0x7fff, 0x7fff, 0x7fff 87 87 }; 88 88 89 89 /* _rodatab78 */ 90 - static u16 eq_states_zero[2] = { 0x0000, 0x0000 }; 90 + static const u16 eq_states_zero[2] = { 0x0000, 0x0000 }; 91 91 92 - static u16 asEqOutStateZeros[48] = { 92 + static const u16 asEqOutStateZeros[48] = { 93 93 0x0000, 0x0000, 0x0000, 0x0000, 94 94 0x0000, 0x0000, 0x0000, 0x0000, 95 95 0x0000, 0x0000, 0x0000, 0x0000, ··· 105 105 }; 106 106 107 107 /*_rodataba0:*/ 108 - static u16 eq_levels[64] = { 108 + static const u16 eq_levels[64] = { 109 109 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 110 110 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 111 111 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+2 -2
sound/pci/au88x0/au88x0_pcm.c
··· 433 433 * definitions of capture are omitted here... 434 434 */ 435 435 436 - static char *vortex_pcm_prettyname[VORTEX_PCM_LAST] = { 436 + static const char * const vortex_pcm_prettyname[VORTEX_PCM_LAST] = { 437 437 CARD_NAME " ADB", 438 438 CARD_NAME " SPDIF", 439 439 CARD_NAME " A3D", 440 440 CARD_NAME " WT", 441 441 CARD_NAME " I2S", 442 442 }; 443 - static char *vortex_pcm_name[VORTEX_PCM_LAST] = { 443 + static const char * const vortex_pcm_name[VORTEX_PCM_LAST] = { 444 444 "adb", 445 445 "spdif", 446 446 "a3d",