Skip to content

Commit

Permalink
ALSA: aoa: More constifications
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jan 5, 2020
1 parent f5f87ab commit fa35aa4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions sound/aoa/codecs/onyx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions sound/aoa/codecs/tas-basstreble.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion sound/aoa/codecs/tas-gain-table.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion sound/aoa/soundbus/i2sbus/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fa35aa4

Please sign in to comment.