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

ALSA: aoa: More constifications

Apply const prefix at every place where appropriate: the static
register tables, the volume tables and the callback tables.

Just for minor optimization and no functional changes.

Link: https://lore.kernel.org/r/20200105144823.29547-3-tiwai@suse.de


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f5f87abf
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -543,7 +543,7 @@ static const struct snd_kcontrol_new onyx_spdif_ctrl = {

/* our registers */

static u8 register_map[] = {
static const u8 register_map[] = {
	ONYX_REG_DAC_ATTEN_LEFT,
	ONYX_REG_DAC_ATTEN_RIGHT,
	ONYX_REG_CONTROL,
@@ -559,7 +559,7 @@ static u8 register_map[] = {
	ONYX_REG_DIG_INFO4
};

static u8 initial_values[ARRAY_SIZE(register_map)] = {
static const u8 initial_values[ARRAY_SIZE(register_map)] = {
	0x80, 0x80, /* muted */
	ONYX_MRST | ONYX_SRST, /* but handled specially! */
	ONYX_MUTE_LEFT | ONYX_MUTE_RIGHT,
+2 −2
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@
#define TAS3004_TREBLE_ZERO	36
#define TAS3004_BASS_ZERO	36

static u8 tas3004_treble_table[] = {
static const u8 tas3004_treble_table[] = {
	150, /* -18 dB */
	149,
	148,
@@ -99,7 +99,7 @@ static inline u8 tas3004_treble(int idx)
 * I have also ignored completely differences of
 * +/- 1
 */
static s8 tas3004_bass_diff_to_treble[] = {
static const s8 tas3004_bass_diff_to_treble[] = {
	2, /* 7 dB, offset 50 */
	2,
	2,
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ int main() {
 * as easy as calculating
 *      hwvalue = 1048576.0*exp(0.057564628*dB*2)
 * :) */
static int tas_gaintable[] = {
static const int tas_gaintable[] = {
	0x000000, /* -infinity dB */
	0x00014b, /* -70.0 dB */
	0x00015f, /* -69.5 dB */
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
	static const char *rnames[] = { "i2sbus: %pOFn (control)",
					"i2sbus: %pOFn (tx)",
					"i2sbus: %pOFn (rx)" };
	static irq_handler_t ints[] = {
	static const irq_handler_t ints[] = {
		i2sbus_bus_intr,
		i2sbus_tx_intr,
		i2sbus_rx_intr