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 15/68] ALSA: riptide: More constifications
Date: Sun,  5 Jan 2020 15:47:30 +0100	[thread overview]
Message-ID: <20200105144823.29547-16-tiwai@suse.de> (raw)
In-Reply-To: <20200105144823.29547-1-tiwai@suse.de>

Apply const prefix to each lbus path table definition and its
callers.

Just for minor optimization and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/riptide/riptide.c | 60 ++++++++++++++++++++++-----------------------
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index 625c85428955..b4f300281822 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -361,9 +361,9 @@ enum RT_CHANNEL_IDS {
 enum { SB_CMD = 0, MODEM_CMD, I2S_CMD0, I2S_CMD1, FM_CMD, MAX_CMD };
 
 struct lbuspath {
-	unsigned char *noconv;
-	unsigned char *stereo;
-	unsigned char *mono;
+	const unsigned char *noconv;
+	const unsigned char *stereo;
+	const unsigned char *mono;
 };
 
 struct cmdport {
@@ -464,7 +464,7 @@ struct sgd {			/* scatter gather desriptor */
 
 struct pcmhw {			/* pcm descriptor */
 	struct lbuspath paths;
-	unsigned char *lbuspath;
+	const unsigned char *lbuspath;
 	unsigned char source;
 	unsigned char intdec[2];
 	unsigned char mixer;
@@ -517,7 +517,7 @@ MODULE_DEVICE_TABLE(pci, snd_riptide_ids);
 /*
  */
 
-static unsigned char lbusin2out[E2SINK_MAX + 1][2] = {
+static const unsigned char lbusin2out[E2SINK_MAX + 1][2] = {
 	{NO_OUT, LS_NONE1}, {NO_OUT, LS_NONE2}, {NO_OUT, LS_NONE1}, {NO_OUT,
 								     LS_NONE2},
 	{NO_OUT, LS_NONE1}, {NO_OUT, LS_NONE2}, {NO_OUT, LS_NONE1}, {NO_OUT,
@@ -557,63 +557,63 @@ static unsigned char lbusin2out[E2SINK_MAX + 1][2] = {
 								     LS_NONE2},
 };
 
-static unsigned char lbus_play_opl3[] = {
+static const unsigned char lbus_play_opl3[] = {
 	DIGITAL_MIXER_IN0 + FM_MIXER, 0xff
 };
-static unsigned char lbus_play_modem[] = {
+static const unsigned char lbus_play_modem[] = {
 	DIGITAL_MIXER_IN0 + MODEM_MIXER, 0xff
 };
-static unsigned char lbus_play_i2s[] = {
+static const unsigned char lbus_play_i2s[] = {
 	INTER0_IN + I2S_INTDEC, DIGITAL_MIXER_IN0 + I2S_MIXER, 0xff
 };
-static unsigned char lbus_play_out[] = {
+static const unsigned char lbus_play_out[] = {
 	PDAC2ACLNK, 0xff
 };
-static unsigned char lbus_play_outhp[] = {
+static const unsigned char lbus_play_outhp[] = {
 	HNDSPK2ACLNK, 0xff
 };
-static unsigned char lbus_play_noconv1[] = {
+static const unsigned char lbus_play_noconv1[] = {
 	DIGITAL_MIXER_IN0, 0xff
 };
-static unsigned char lbus_play_stereo1[] = {
+static const unsigned char lbus_play_stereo1[] = {
 	INTER0_IN, DIGITAL_MIXER_IN0, 0xff
 };
-static unsigned char lbus_play_mono1[] = {
+static const unsigned char lbus_play_mono1[] = {
 	INTERM0_IN, DIGITAL_MIXER_IN0, 0xff
 };
-static unsigned char lbus_play_noconv2[] = {
+static const unsigned char lbus_play_noconv2[] = {
 	DIGITAL_MIXER_IN1, 0xff
 };
-static unsigned char lbus_play_stereo2[] = {
+static const unsigned char lbus_play_stereo2[] = {
 	INTER1_IN, DIGITAL_MIXER_IN1, 0xff
 };
-static unsigned char lbus_play_mono2[] = {
+static const unsigned char lbus_play_mono2[] = {
 	INTERM1_IN, DIGITAL_MIXER_IN1, 0xff
 };
-static unsigned char lbus_play_noconv3[] = {
+static const unsigned char lbus_play_noconv3[] = {
 	DIGITAL_MIXER_IN2, 0xff
 };
-static unsigned char lbus_play_stereo3[] = {
+static const unsigned char lbus_play_stereo3[] = {
 	INTER2_IN, DIGITAL_MIXER_IN2, 0xff
 };
-static unsigned char lbus_play_mono3[] = {
+static const unsigned char lbus_play_mono3[] = {
 	INTERM2_IN, DIGITAL_MIXER_IN2, 0xff
 };
-static unsigned char lbus_rec_noconv1[] = {
+static const unsigned char lbus_rec_noconv1[] = {
 	LBUS2ARM_FIFO5, 0xff
 };
-static unsigned char lbus_rec_stereo1[] = {
+static const unsigned char lbus_rec_stereo1[] = {
 	DECIM0_IN, LBUS2ARM_FIFO5, 0xff
 };
-static unsigned char lbus_rec_mono1[] = {
+static const unsigned char lbus_rec_mono1[] = {
 	DECIMM3_IN, LBUS2ARM_FIFO5, 0xff
 };
 
-static unsigned char play_ids[] = { 4, 1, 2, };
-static unsigned char play_sources[] = {
+static const unsigned char play_ids[] = { 4, 1, 2, };
+static const unsigned char play_sources[] = {
 	ARM2LBUS_FIFO4, ARM2LBUS_FIFO1, ARM2LBUS_FIFO2,
 };
-static struct lbuspath lbus_play_paths[] = {
+static const struct lbuspath lbus_play_paths[] = {
 	{
 	 .noconv = lbus_play_noconv1,
 	 .stereo = lbus_play_stereo1,
@@ -737,7 +737,7 @@ static int loadfirmware(struct cmdif *cif, const unsigned char *img,
 
 static void
 alloclbuspath(struct cmdif *cif, unsigned char source,
-	      unsigned char *path, unsigned char *mixer, unsigned char *s)
+	      const unsigned char *path, unsigned char *mixer, unsigned char *s)
 {
 	while (*path != 0xff) {
 		unsigned char sink, type;
@@ -765,7 +765,7 @@ alloclbuspath(struct cmdif *cif, unsigned char source,
 			}
 		}
 		if (*path++ & SPLIT_PATH) {
-			unsigned char *npath = path;
+			const unsigned char *npath = path;
 
 			while (*npath != 0xff)
 				npath++;
@@ -775,7 +775,7 @@ alloclbuspath(struct cmdif *cif, unsigned char source,
 }
 
 static void
-freelbuspath(struct cmdif *cif, unsigned char source, unsigned char *path)
+freelbuspath(struct cmdif *cif, unsigned char source, const unsigned char *path)
 {
 	while (*path != 0xff) {
 		unsigned char sink;
@@ -787,7 +787,7 @@ freelbuspath(struct cmdif *cif, unsigned char source, unsigned char *path)
 			source = lbusin2out[sink][0];
 		}
 		if (*path++ & SPLIT_PATH) {
-			unsigned char *npath = path;
+			const unsigned char *npath = path;
 
 			while (*npath != 0xff)
 				npath++;
@@ -1441,7 +1441,7 @@ static int snd_riptide_prepare(struct snd_pcm_substream *substream)
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct pcmhw *data = get_pcmhwdev(substream);
 	struct cmdif *cif = chip->cif;
-	unsigned char *lbuspath = NULL;
+	const unsigned char *lbuspath = NULL;
 	unsigned int rate, channels;
 	int err = 0;
 	snd_pcm_format_t format;
-- 
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 15:00 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 ` [alsa-devel] [PATCH 12/68] ALSA: caiaq: " Takashi Iwai
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 ` Takashi Iwai [this message]
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-16-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.