From: Takashi Iwai Date: Sun, 5 Jan 2020 14:47:17 +0000 (+0100) Subject: ALSA: aoa: More constifications X-Git-Tag: v5.15~4528^2~110 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa35aa46077794de446ddd4bcaf809c2fd041ce2;p=platform%2Fkernel%2Flinux-starfive.git 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: Takashi Iwai --- diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c index f85bc8a..12028b3 100644 --- a/sound/aoa/codecs/onyx.c +++ b/sound/aoa/codecs/onyx.c @@ -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, diff --git a/sound/aoa/codecs/tas-basstreble.h b/sound/aoa/codecs/tas-basstreble.h index 770935a..14dc4e9 100644 --- a/sound/aoa/codecs/tas-basstreble.h +++ b/sound/aoa/codecs/tas-basstreble.h @@ -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, diff --git a/sound/aoa/codecs/tas-gain-table.h b/sound/aoa/codecs/tas-gain-table.h index 77b8e7d..c9ea014 100644 --- a/sound/aoa/codecs/tas-gain-table.h +++ b/sound/aoa/codecs/tas-gain-table.h @@ -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 */ diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c index 17df288..faf6b03 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c @@ -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