ALSA: aoa: More constifications
authorTakashi Iwai <tiwai@suse.de>
Sun, 5 Jan 2020 14:47:17 +0000 (15:47 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sun, 5 Jan 2020 15:14:27 +0000 (16:14 +0100)
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 <tiwai@suse.de>
sound/aoa/codecs/onyx.c
sound/aoa/codecs/tas-basstreble.h
sound/aoa/codecs/tas-gain-table.h
sound/aoa/soundbus/i2sbus/core.c

index f85bc8a..12028b3 100644 (file)
@@ -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,
index 770935a..14dc4e9 100644 (file)
@@ -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,
index 77b8e7d..c9ea014 100644 (file)
@@ -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 */
index 17df288..faf6b03 100644 (file)
@@ -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