Commit eafcdbdb authored by Takashi Iwai's avatar Takashi Iwai
Browse files

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 56d7058e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1989,7 +1989,7 @@ vortex_connect_codecrec(vortex_t * vortex, int en, unsigned char mixin0,
// Higher level ADB audio path (de)allocator.

/* Resource manager */
static int resnum[VORTEX_RESOURCE_LAST] =
static const int resnum[VORTEX_RESOURCE_LAST] =
    { NR_ADB, NR_SRC, NR_MIXIN, NR_MIXOUT, NR_A3D };
/*
 Checkout/Checkin resource of given type. 
+11 −11
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ static inline u16 sign_invert(u16 a)
		return -a;
}

static void vortex_EqHw_SetLeftCoefs(vortex_t * vortex, u16 coefs[])
static void vortex_EqHw_SetLeftCoefs(vortex_t *vortex, const u16 coefs[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int i = 0, n /*esp2c */;
@@ -73,7 +73,7 @@ static void vortex_EqHw_SetLeftCoefs(vortex_t * vortex, u16 coefs[])
	}
}

static void vortex_EqHw_SetRightCoefs(vortex_t * vortex, u16 coefs[])
static void vortex_EqHw_SetRightCoefs(vortex_t *vortex, const u16 coefs[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int i = 0, n /*esp2c */;
@@ -96,7 +96,7 @@ static void vortex_EqHw_SetRightCoefs(vortex_t * vortex, u16 coefs[])

}

static void vortex_EqHw_SetLeftStates(vortex_t * vortex, u16 a[], u16 b[])
static void vortex_EqHw_SetLeftStates(vortex_t *vortex, const u16 a[], const u16 b[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int i = 0, ebx;
@@ -113,7 +113,7 @@ static void vortex_EqHw_SetLeftStates(vortex_t * vortex, u16 a[], u16 b[])
	}
}

static void vortex_EqHw_SetRightStates(vortex_t * vortex, u16 a[], u16 b[])
static void vortex_EqHw_SetRightStates(vortex_t *vortex, const u16 a[], const u16 b[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int i = 0, ebx;
@@ -206,7 +206,7 @@ vortex_EqHw_SetRightGainsSingleTarget(vortex_t * vortex, u16 index, u16 b)
	hwwrite(vortex->mmio, 0x2b20c + (index * 0x30), b);
}

static void vortex_EqHw_SetLeftGainsTarget(vortex_t * vortex, u16 a[])
static void vortex_EqHw_SetLeftGainsTarget(vortex_t *vortex, const u16 a[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int ebx;
@@ -216,7 +216,7 @@ static void vortex_EqHw_SetLeftGainsTarget(vortex_t * vortex, u16 a[])
	}
}

static void vortex_EqHw_SetRightGainsTarget(vortex_t * vortex, u16 a[])
static void vortex_EqHw_SetRightGainsTarget(vortex_t *vortex, const u16 a[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int ebx;
@@ -226,7 +226,7 @@ static void vortex_EqHw_SetRightGainsTarget(vortex_t * vortex, u16 a[])
	}
}

static void vortex_EqHw_SetLeftGainsCurrent(vortex_t * vortex, u16 a[])
static void vortex_EqHw_SetLeftGainsCurrent(vortex_t *vortex, const u16 a[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int ebx;
@@ -236,7 +236,7 @@ static void vortex_EqHw_SetLeftGainsCurrent(vortex_t * vortex, u16 a[])
	}
}

static void vortex_EqHw_SetRightGainsCurrent(vortex_t * vortex, u16 a[])
static void vortex_EqHw_SetRightGainsCurrent(vortex_t *vortex, const u16 a[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int ebx;
@@ -309,7 +309,7 @@ static void vortex_EqHw_GetRightGainsCurrent(vortex_t * vortex, u16 a[])

#endif
/* EQ band levels settings */
static void vortex_EqHw_SetLevels(vortex_t * vortex, u16 peaks[])
static void vortex_EqHw_SetLevels(vortex_t *vortex, const u16 peaks[])
{
	eqhw_t *eqhw = &(vortex->eq.this04);
	int i;
@@ -574,7 +574,7 @@ static int vortex_Eqlzr_SetAllBandsFromActiveCoeffSet(vortex_t * vortex)
}

static int
vortex_Eqlzr_SetAllBands(vortex_t * vortex, u16 gains[], s32 count)
vortex_Eqlzr_SetAllBands(vortex_t *vortex, const u16 gains[], s32 count)
{
	eqlzr_t *eq = &(vortex->eq);
	int i;
@@ -852,7 +852,7 @@ static const struct snd_kcontrol_new vortex_levels_kcontrol = {
};

/* EQ band gain labels. */
static char *EqBandLabels[10] = {
static const char * const EqBandLabels[10] = {
	"EQ0 31Hz\0",
	"EQ1 63Hz\0",
	"EQ2 125Hz\0",
+9 −9
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/* Data structs */

static u16 asEqCoefsZeros[50] = {
static const u16 asEqCoefsZeros[50] = {
	0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
	0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
	0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -14,7 +14,7 @@ static u16 asEqCoefsZeros[50] = {
	0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
};

static u16 asEqCoefsPipes[64] = {
static const u16 asEqCoefsPipes[64] = {
	0x0000, 0x0000,
	0x0000, 0x0666, 0x0000, 0x0000, 0x0666,
	0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
@@ -33,7 +33,7 @@ static u16 asEqCoefsPipes[64] = {
};

/* More coef sets can be found in the win2k "inf" file. */
static auxxEqCoeffSet_t asEqCoefsNormal = {
static const auxxEqCoeffSet_t asEqCoefsNormal = {
	.LeftCoefs = {
		      0x7e60, 0xc19e, 0x0001, 0x0002, 0x0001,
		      0x7fa0, 0xc05f, 0x004f, 0x0000, 0xffb1,
@@ -66,7 +66,7 @@ static auxxEqCoeffSet_t asEqCoefsNormal = {
		       0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96}
};

static u16 eq_gains_normal[20] = {
static const u16 eq_gains_normal[20] = {
	0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96,
	0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96,
	0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96,
@@ -74,22 +74,22 @@ static u16 eq_gains_normal[20] = {
};

/* _rodatab60 */
static u16 eq_gains_zero[10] = {
static const u16 eq_gains_zero[10] = {
	0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
	0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};

/* _rodatab7c:  ProgramPipe */
static u16 eq_gains_current[12] = {
static const u16 eq_gains_current[12] = {
	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
	0x7fff,
	0x7fff, 0x7fff, 0x7fff
};

/* _rodatab78 */
static u16 eq_states_zero[2] = { 0x0000, 0x0000 };
static const u16 eq_states_zero[2] = { 0x0000, 0x0000 };

static u16 asEqOutStateZeros[48] = {
static const u16 asEqOutStateZeros[48] = {
	0x0000, 0x0000, 0x0000, 0x0000,
	0x0000, 0x0000, 0x0000, 0x0000,
	0x0000, 0x0000, 0x0000, 0x0000,
@@ -105,7 +105,7 @@ static u16 asEqOutStateZeros[48] = {
};

/*_rodataba0:*/
static u16 eq_levels[64] = {
static const u16 eq_levels[64] = {
	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
	0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+2 −2
Original line number Diff line number Diff line
@@ -433,14 +433,14 @@ static const struct snd_pcm_ops snd_vortex_playback_ops = {
*  definitions of capture are omitted here...
*/

static char *vortex_pcm_prettyname[VORTEX_PCM_LAST] = {
static const char * const vortex_pcm_prettyname[VORTEX_PCM_LAST] = {
	CARD_NAME " ADB",
	CARD_NAME " SPDIF",
	CARD_NAME " A3D",
	CARD_NAME " WT",
	CARD_NAME " I2S",
};
static char *vortex_pcm_name[VORTEX_PCM_LAST] = {
static const char * const vortex_pcm_name[VORTEX_PCM_LAST] = {
	"adb",
	"spdif",
	"a3d",