]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ALSA: vx: More constifications
authorTakashi Iwai <tiwai@suse.de>
Sun, 5 Jan 2020 14:47:22 +0000 (15:47 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sun, 5 Jan 2020 15:14:30 +0000 (16:14 +0100)
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 <tiwai@suse.de>
sound/drivers/vx/vx_cmd.c
sound/drivers/vx/vx_core.c
sound/drivers/vx/vx_hwdep.c
sound/drivers/vx/vx_mixer.c
sound/pci/vx222/vx222_ops.c
sound/pcmcia/vx/vxp_ops.c

index 77ae59aef4e01eca8037b2ad14487e4c306270ff..b0970a04883effb66631817100ea04ae7c270e08 100644 (file)
@@ -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 },
index dd35de3f2434a3d9f7f36763a226b5624d38916f..ffab0400d7fbed908e4ce7522f023d9362789e0a 100644 (file)
@@ -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",
index f0d31b0a178e7fd9b0987da77515b16ddfcc6cc1..01baa6d872e92f542f326bb30d8a87440259ff4a 100644 (file)
@@ -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",
                },
index b17c67b14d59a6b7777f5b37dd23b8155a65e885..13099f8c84d619e90b9e1d8a025fea25bce1c8fd 100644 (file)
@@ -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) {
index 6245240d8768c20859573db2ebee2fb4e7e2d585..23d4338dc5537fcbea2b4758dc86af8766922899 100644 (file)
@@ -19,7 +19,7 @@
 #include "vx222.h"
 
 
-static int vx2_reg_offset[VX_REG_MAX] = {
+static const int vx2_reg_offset[VX_REG_MAX] = {
        [VX_ICR]    = 0x00,
        [VX_CVR]    = 0x04,
        [VX_ISR]    = 0x08,
@@ -45,7 +45,7 @@ static int vx2_reg_offset[VX_REG_MAX] = {
        [VX_GPIOC]  = 0x54,             // VX_GPIOC (new with PLX9030)
 };
 
-static int vx2_reg_index[VX_REG_MAX] = {
+static const int vx2_reg_index[VX_REG_MAX] = {
        [VX_ICR]        = 1,
        [VX_CVR]        = 1,
        [VX_ISR]        = 1,
index f7cf707d315f90aaf0b9a763efa9708a84f792c0..45eeb0f57d590c5dbe0d512da8b0331b1f5f058e 100644 (file)
@@ -15,7 +15,7 @@
 #include "vxpocket.h"
 
 
-static int vxp_reg_offset[VX_REG_MAX] = {
+static const int vxp_reg_offset[VX_REG_MAX] = {
        [VX_ICR]        = 0x00,         // ICR
        [VX_CVR]        = 0x01,         // CVR
        [VX_ISR]        = 0x02,         // ISR