All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: alsa-devel@alsa-project.org
Subject: [alsa-devel] [PATCH 12/68] ALSA: caiaq: More constifications
Date: Sun,  5 Jan 2020 15:47:27 +0100	[thread overview]
Message-ID: <20200105144823.29547-13-tiwai@suse.de> (raw)
In-Reply-To: <20200105144823.29547-1-tiwai@suse.de>

Apply const prefix to each possible place: the rate table, the
controller tables, and the key tables.

Just for minor optimization and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/usb/caiaq/audio.c   |  2 +-
 sound/usb/caiaq/control.c | 20 ++++++++++----------
 sound/usb/caiaq/input.c   | 10 +++++-----
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c
index 41993a5c0537..e9243d53a107 100644
--- a/sound/usb/caiaq/audio.c
+++ b/sound/usb/caiaq/audio.c
@@ -179,7 +179,7 @@ static int snd_usb_caiaq_pcm_hw_free(struct snd_pcm_substream *sub)
 #error "Change this table"
 #endif
 
-static unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100,
+static const unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100,
 				48000, 64000, 88200, 96000, 176400, 192000 };
 
 static int snd_usb_caiaq_pcm_prepare(struct snd_pcm_substream *substream)
diff --git a/sound/usb/caiaq/control.c b/sound/usb/caiaq/control.c
index 532e354f6124..af459c49baf4 100644
--- a/sound/usb/caiaq/control.c
+++ b/sound/usb/caiaq/control.c
@@ -163,14 +163,14 @@ struct caiaq_controller {
 	int index;
 };
 
-static struct caiaq_controller ak1_controller[] = {
+static const struct caiaq_controller ak1_controller[] = {
 	{ "LED left", 	2 },
 	{ "LED middle", 1 },
 	{ "LED right", 	0 },
 	{ "LED ring", 	3 }
 };
 
-static struct caiaq_controller rk2_controller[] = {
+static const struct caiaq_controller rk2_controller[] = {
 	{ "LED 1",		5  },
 	{ "LED 2",		4  },
 	{ "LED 3",		3  },
@@ -196,7 +196,7 @@ static struct caiaq_controller rk2_controller[] = {
 	{ "LED 7seg_3g",	23 }
 };
 
-static struct caiaq_controller rk3_controller[] = {
+static const struct caiaq_controller rk3_controller[] = {
 	{ "LED 7seg_1a",        0 + 0 },
 	{ "LED 7seg_1b",        0 + 1 },
 	{ "LED 7seg_1c",        0 + 2 },
@@ -244,7 +244,7 @@ static struct caiaq_controller rk3_controller[] = {
 	{ "LED pedal",		32 + 8 }
 };
 
-static struct caiaq_controller kore_controller[] = {
+static const struct caiaq_controller kore_controller[] = {
 	{ "LED F1",		8   | CNT_INTVAL },
 	{ "LED F2",		12  | CNT_INTVAL },
 	{ "LED F3",		0   | CNT_INTVAL },
@@ -278,7 +278,7 @@ static struct caiaq_controller kore_controller[] = {
 	{ "LED control",	26  | CNT_INTVAL }
 };
 
-static struct caiaq_controller a8dj_controller[] = {
+static const struct caiaq_controller a8dj_controller[] = {
 	{ "Current input mode",			0 | CNT_INTVAL 	},
 	{ "GND lift for TC Vinyl mode", 	24 + 0 		},
 	{ "GND lift for TC CD/Line mode", 	24 + 1 		},
@@ -286,11 +286,11 @@ static struct caiaq_controller a8dj_controller[] = {
 	{ "Software lock", 			40 		}
 };
 
-static struct caiaq_controller a4dj_controller[] = {
+static const struct caiaq_controller a4dj_controller[] = {
 	{ "Current input mode",	0 | CNT_INTVAL 	}
 };
 
-static struct caiaq_controller kontrolx1_controller[] = {
+static const struct caiaq_controller kontrolx1_controller[] = {
 	{ "LED FX A: ON",		7 | CNT_INTVAL	},
 	{ "LED FX A: 1",		6 | CNT_INTVAL	},
 	{ "LED FX A: 2",		5 | CNT_INTVAL	},
@@ -327,7 +327,7 @@ static struct caiaq_controller kontrolx1_controller[] = {
 	{ "LED Deck B: SYNC",		8  | CNT_INTVAL	},
 };
 
-static struct caiaq_controller kontrols4_controller[] = {
+static const struct caiaq_controller kontrols4_controller[] = {
 	{ "LED: Master: Quant",			10  | CNT_INTVAL },
 	{ "LED: Master: Headphone",		11  | CNT_INTVAL },
 	{ "LED: Master: Master",		12  | CNT_INTVAL },
@@ -500,7 +500,7 @@ static struct caiaq_controller kontrols4_controller[] = {
 	{ "LED: FX2: Mode",			133 | CNT_INTVAL },
 };
 
-static struct caiaq_controller maschine_controller[] = {
+static const struct caiaq_controller maschine_controller[] = {
 	{ "LED: Pad 1",				3  | CNT_INTVAL },
 	{ "LED: Pad 2",				2  | CNT_INTVAL },
 	{ "LED: Pad 3",				1  | CNT_INTVAL },
@@ -568,7 +568,7 @@ static struct caiaq_controller maschine_controller[] = {
 	{ "Backlight Display",			59 | CNT_INTVAL }
 };
 
-static int add_controls(struct caiaq_controller *c, int num,
+static int add_controls(const struct caiaq_controller *c, int num,
 			struct snd_usb_caiaqdev *cdev)
 {
 	int i, ret;
diff --git a/sound/usb/caiaq/input.c b/sound/usb/caiaq/input.c
index 533eb69fe4e6..1e2cf2f08eec 100644
--- a/sound/usb/caiaq/input.c
+++ b/sound/usb/caiaq/input.c
@@ -14,13 +14,13 @@
 #include "device.h"
 #include "input.h"
 
-static unsigned short keycode_ak1[] =  { KEY_C, KEY_B, KEY_A };
-static unsigned short keycode_rk2[] =  { KEY_1, KEY_2, KEY_3, KEY_4,
+static const unsigned short keycode_ak1[] =  { KEY_C, KEY_B, KEY_A };
+static const unsigned short keycode_rk2[] =  { KEY_1, KEY_2, KEY_3, KEY_4,
 					 KEY_5, KEY_6, KEY_7 };
-static unsigned short keycode_rk3[] =  { KEY_1, KEY_2, KEY_3, KEY_4,
+static const unsigned short keycode_rk3[] =  { KEY_1, KEY_2, KEY_3, KEY_4,
 					 KEY_5, KEY_6, KEY_7, KEY_8, KEY_9 };
 
-static unsigned short keycode_kore[] = {
+static const unsigned short keycode_kore[] = {
 	KEY_FN_F1,      /* "menu"               */
 	KEY_FN_F7,      /* "lcd backlight       */
 	KEY_FN_F2,      /* "control"            */
@@ -60,7 +60,7 @@ static unsigned short keycode_kore[] = {
 #define MASCHINE_PADS      (16)
 #define MASCHINE_PAD(X)    ((X) + ABS_PRESSURE)
 
-static unsigned short keycode_maschine[] = {
+static const unsigned short keycode_maschine[] = {
 	MASCHINE_BUTTON(40), /* mute       */
 	MASCHINE_BUTTON(39), /* solo       */
 	MASCHINE_BUTTON(38), /* select     */
-- 
2.16.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2020-01-05 14:56 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-05 14:47 [alsa-devel] [PATCH 00/68] ALSA: Constifications, take #2 Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 01/68] ALSA: Allow const arrays for legacy resource management helpers Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 02/68] ALSA: aoa: More constifications Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 03/68] ALSA: hda/realtek - " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 04/68] ALSA: dummy: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 05/68] ALSA: pcm: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 06/68] ALSA: seq: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 07/68] ALSA: vx: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 08/68] ALSA: intel8x0: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 09/68] ALSA: hda: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 10/68] ALSA: ac97: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 11/68] ALSA: usb-audio: " Takashi Iwai
2020-01-05 14:47 ` Takashi Iwai [this message]
2020-01-05 14:47 ` [alsa-devel] [PATCH 13/68] ALSA: au88x0: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 14/68] ALSA: emu10k1: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 15/68] ALSA: riptide: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 16/68] ALSA: ice1712: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 17/68] ALSA: ppc: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 18/68] ALSA: hdsp: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 19/68] ALSA: hdspm: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 20/68] ALSA: rme9652: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 21/68] ALSA: emux: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 22/68] ALSA: usx2y: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 23/68] ALSA: pcxhr: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 24/68] ALSA: mixart: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 25/68] ALSA: ymfpci: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 26/68] ALSA: bcd2000: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 27/68] ALSA: nm256: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 28/68] ALSA: korg1212: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 29/68] ALSA: cs46xx: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 30/68] ALSA: ca0106: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 31/68] ALSA: ctxfi: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 32/68] ALSA: asihpi: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 33/68] ALSA: atiixp: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 34/68] ALSA: es1938: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 35/68] ALSA: es1968: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 36/68] ALSA: cmipci: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 37/68] ALSA: sparc: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 38/68] ALSA: info: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 39/68] ALSA: jack: More constification Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 40/68] ALSA: oss: More constifications Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 41/68] ALSA: rawmidi: More constification Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 42/68] ALSA: opl3: More constifications Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 43/68] ALSA: cmi8328: " Takashi Iwai
2020-01-05 14:47 ` [alsa-devel] [PATCH 44/68] ALSA: cs423x: More constification Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 45/68] ALSA: sb: More constifications Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 46/68] ALSA: cmi8330: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 47/68] ALSA: es1688: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 48/68] ALSA: es18xx: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 49/68] ALSA: gus: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 50/68] ALSA: opti9xx: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 51/68] ALSA: wss: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 52/68] ALSA: sc6000: More constification Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 53/68] ALSA: mts64: More constifications Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 54/68] ALSA: aw2: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 55/68] ALSA: lx6464es: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 56/68] ALSA: arm: More constification Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 57/68] ALSA: opl4: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 58/68] ALSA: serial-u16550: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 59/68] ALSA: ak4531: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 60/68] ALSA: azt3328: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 61/68] ALSA: cs4281: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 62/68] ALSA: echoaudio: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 63/68] ALSA: ens137x: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 64/68] ALSA: fm801: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 65/68] ALSA: via82xx: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 66/68] ALSA: pdaudiocf: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 67/68] ALSA: spi: " Takashi Iwai
2020-01-05 14:48 ` [alsa-devel] [PATCH 68/68] ALSA: sh: Fix compile warning wrt const Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200105144823.29547-13-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.