ALSA: pcxhr: More constifications
authorTakashi Iwai <tiwai@suse.de>
Sun, 5 Jan 2020 14:47:38 +0000 (15:47 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sun, 5 Jan 2020 15:14:47 +0000 (16:14 +0100)
Apply const prefix to each possible place: the board parameters and
DSP command table, and the string arrays.

Just for minor optimization and no functional changes.

Link: https://lore.kernel.org/r/20200105144823.29547-24-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/pcxhr/pcxhr.c
sound/pci/pcxhr/pcxhr_core.c
sound/pci/pcxhr/pcxhr_hwdep.c

index 9e59d59..c2e4831 100644 (file)
@@ -136,7 +136,7 @@ struct board_parameters {
        short fw_file_set;
        short firmware_num;
 };
        short fw_file_set;
        short firmware_num;
 };
-static struct board_parameters pcxhr_board_params[] = {
+static const struct board_parameters pcxhr_board_params[] = {
 [PCI_ID_VX882HR] =      { "VX882HR",      4, 4, 0, 41 },
 [PCI_ID_PCX882HR] =     { "PCX882HR",     4, 4, 0, 41 },
 [PCI_ID_VX881HR] =      { "VX881HR",      4, 4, 0, 41 },
 [PCI_ID_VX882HR] =      { "VX882HR",      4, 4, 0, 41 },
 [PCI_ID_PCX882HR] =     { "PCX882HR",     4, 4, 0, 41 },
 [PCI_ID_VX881HR] =      { "VX881HR",      4, 4, 0, 41 },
index 495be27..87d2422 100644 (file)
@@ -466,7 +466,7 @@ enum {
 /*
  * Array of DSP commands
  */
 /*
  * Array of DSP commands
  */
-static struct pcxhr_cmd_info pcxhr_dsp_cmds[] = {
+static const struct pcxhr_cmd_info pcxhr_dsp_cmds[] = {
 [CMD_VERSION] =                                { 0x010000, 1, RMH_SSIZE_FIXED },
 [CMD_SUPPORTED] =                      { 0x020000, 4, RMH_SSIZE_FIXED },
 [CMD_TEST_IT] =                                { 0x040000, 1, RMH_SSIZE_FIXED },
 [CMD_VERSION] =                                { 0x010000, 1, RMH_SSIZE_FIXED },
 [CMD_SUPPORTED] =                      { 0x020000, 4, RMH_SSIZE_FIXED },
 [CMD_TEST_IT] =                                { 0x040000, 1, RMH_SSIZE_FIXED },
@@ -497,7 +497,7 @@ static struct pcxhr_cmd_info pcxhr_dsp_cmds[] = {
 };
 
 #ifdef CONFIG_SND_DEBUG_VERBOSE
 };
 
 #ifdef CONFIG_SND_DEBUG_VERBOSE
-static char* cmd_names[] = {
+static const char * const cmd_names[] = {
 [CMD_VERSION] =                                "CMD_VERSION",
 [CMD_SUPPORTED] =                      "CMD_SUPPORTED",
 [CMD_TEST_IT] =                                "CMD_TEST_IT",
 [CMD_VERSION] =                                "CMD_VERSION",
 [CMD_SUPPORTED] =                      "CMD_SUPPORTED",
 [CMD_TEST_IT] =                                "CMD_TEST_IT",
@@ -1006,7 +1006,7 @@ static int pcxhr_handle_async_err(struct pcxhr_mgr *mgr, u32 err,
                                  enum pcxhr_async_err_src err_src, int pipe,
                                  int is_capture)
 {
                                  enum pcxhr_async_err_src err_src, int pipe,
                                  int is_capture)
 {
-       static char* err_src_name[] = {
+       static const char * const err_src_name[] = {
                [PCXHR_ERR_PIPE]        = "Pipe",
                [PCXHR_ERR_STREAM]      = "Stream",
                [PCXHR_ERR_AUDIO]       = "Audio"
                [PCXHR_ERR_PIPE]        = "Pipe",
                [PCXHR_ERR_STREAM]      = "Stream",
                [PCXHR_ERR_AUDIO]       = "Audio"
index 12a6bdb..2258bd6 100644 (file)
@@ -348,7 +348,7 @@ static int pcxhr_dsp_load(struct pcxhr_mgr *mgr, int index,
  */
 int pcxhr_setup_firmware(struct pcxhr_mgr *mgr)
 {
  */
 int pcxhr_setup_firmware(struct pcxhr_mgr *mgr)
 {
-       static char *fw_files[][5] = {
+       static const char * const fw_files[][5] = {
        [0] = { "xlxint.dat", "xlxc882hr.dat",
                "dspe882.e56", "dspb882hr.b56", "dspd882.d56" },
        [1] = { "xlxint.dat", "xlxc882e.dat",
        [0] = { "xlxint.dat", "xlxc882hr.dat",
                "dspe882.e56", "dspb882hr.b56", "dspd882.d56" },
        [1] = { "xlxint.dat", "xlxc882e.dat",