From c09482455ca586539802282380f59f54a1febf16 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Sun, 5 Jan 2020 15:47:22 +0100 Subject: ALSA: vx: More constifications Apply const prefix to every possible place: the static tables for DSP commands, the string tables, and register/offset tables. Just for minor optimization and no functional changes. Link: https://lore.kernel.org/r/20200105144823.29547-8-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/drivers/vx/vx_cmd.c | 2 +- sound/drivers/vx/vx_core.c | 12 ++++++------ sound/drivers/vx/vx_hwdep.c | 2 +- sound/drivers/vx/vx_mixer.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'sound/drivers') diff --git a/sound/drivers/vx/vx_cmd.c b/sound/drivers/vx/vx_cmd.c index 77ae59aef4e0..b0970a04883e 100644 --- a/sound/drivers/vx/vx_cmd.c +++ b/sound/drivers/vx/vx_cmd.c @@ -15,7 +15,7 @@ /* * Array of DSP commands */ -static struct vx_cmd_info vx_dsp_cmds[] = { +static const struct vx_cmd_info vx_dsp_cmds[] = { [CMD_VERSION] = { 0x010000, 2, RMH_SSIZE_FIXED, 1 }, [CMD_SUPPORTED] = { 0x020000, 1, RMH_SSIZE_FIXED, 2 }, [CMD_TEST_IT] = { 0x040000, 1, RMH_SSIZE_FIXED, 1 }, diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c index dd35de3f2434..ffab0400d7fb 100644 --- a/sound/drivers/vx/vx_core.c +++ b/sound/drivers/vx/vx_core.c @@ -39,7 +39,7 @@ MODULE_LICENSE("GPL"); int snd_vx_check_reg_bit(struct vx_core *chip, int reg, int mask, int bit, int time) { unsigned long end_time = jiffies + (time * HZ + 999) / 1000; - static char *reg_names[VX_REG_MAX] = { + static const char * const reg_names[VX_REG_MAX] = { "ICR", "CVR", "ISR", "IVR", "RXH", "RXM", "RXL", "DMA", "CDSP", "RFREQ", "RUER/V2", "DATA", "MEMIRQ", "ACQ", "BIT0", "BIT1", "MIC0", "MIC1", "MIC2", @@ -588,11 +588,11 @@ static void vx_reset_board(struct vx_core *chip, int cold_reset) static void vx_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { struct vx_core *chip = entry->private_data; - static char *audio_src_vxp[] = { "Line", "Mic", "Digital" }; - static char *audio_src_vx2[] = { "Analog", "Analog", "Digital" }; - static char *clock_mode[] = { "Auto", "Internal", "External" }; - static char *clock_src[] = { "Internal", "External" }; - static char *uer_type[] = { "Consumer", "Professional", "Not Present" }; + static const char * const audio_src_vxp[] = { "Line", "Mic", "Digital" }; + static const char * const audio_src_vx2[] = { "Analog", "Analog", "Digital" }; + static const char * const clock_mode[] = { "Auto", "Internal", "External" }; + static const char * const clock_src[] = { "Internal", "External" }; + static const char * const uer_type[] = { "Consumer", "Professional", "Not Present" }; snd_iprintf(buffer, "%s\n", chip->card->longname); snd_iprintf(buffer, "Xilinx Firmware: %s\n", diff --git a/sound/drivers/vx/vx_hwdep.c b/sound/drivers/vx/vx_hwdep.c index f0d31b0a178e..01baa6d872e9 100644 --- a/sound/drivers/vx/vx_hwdep.c +++ b/sound/drivers/vx/vx_hwdep.c @@ -32,7 +32,7 @@ MODULE_FIRMWARE("vx/l_1_vp4.d56"); int snd_vx_setup_firmware(struct vx_core *chip) { - static char *fw_files[VX_TYPE_NUMS][4] = { + static const char * const fw_files[VX_TYPE_NUMS][4] = { [VX_TYPE_BOARD] = { NULL, "x1_1_vx2.xlx", "bd56002.boot", "l_1_vx2.d56", }, diff --git a/sound/drivers/vx/vx_mixer.c b/sound/drivers/vx/vx_mixer.c index b17c67b14d59..13099f8c84d6 100644 --- a/sound/drivers/vx/vx_mixer.c +++ b/sound/drivers/vx/vx_mixer.c @@ -961,7 +961,7 @@ int snd_vx_mixer_new(struct vx_core *chip) return err; /* VU, peak, saturation meters */ for (c = 0; c < 2; c++) { - static char *dir[2] = { "Output", "Input" }; + static const char * const dir[2] = { "Output", "Input" }; for (i = 0; i < chip->hw->num_ins; i++) { int val = (i * 2) | (c << 8); if (c == 1) { -- cgit v1.2.3-59-g8ed1b