From patchwork Fri Jan 3 08:16:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194014 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51CEEC00523 for ; Fri, 3 Jan 2020 08:22:40 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D03E1206DB for ; Fri, 3 Jan 2020 08:22:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="QX8rlKYp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D03E1206DB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2A8A816EE; Fri, 3 Jan 2020 09:21:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2A8A816EE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039758; bh=NTMUs9qXftAvCbz0pZN2W/QLzezA5WHZGVm5pqDRR2Y=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QX8rlKYpSpXs9crJ01bAsBLAwGK6FHRU9cgvR4me3tTQDQ5ydhw7olJVD18ct6Rqo 2ae5ll/RDF+x55UjzvJqnCK5vAlHmaOl6P1Pf5Zn0TIKBsaHT3JszabR1EQRsv6QJA hKjjavOD4T4rCLp62QlWg3aLAjzq1yT3al24Wr/4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 994D5F8032A; Fri, 3 Jan 2020 09:17:49 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 02064F80315; Fri, 3 Jan 2020 09:17:36 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D7B4DF8015D for ; Fri, 3 Jan 2020 09:17:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D7B4DF8015D X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 90732B1F7 for ; Fri, 3 Jan 2020 08:17:19 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:17 +0100 Message-Id: <20200103081714.9560-2-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 01/58] ALSA: pci: Constify snd_pcm_hardware definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Most of snd_pcm_hardware definitions are just copied to another object as-is, hence we can define them as const for further optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/pci/ali5451/ali5451.c | 8 ++++---- sound/pci/echoaudio/darla20.c | 2 +- sound/pci/echoaudio/darla24.c | 2 +- sound/pci/echoaudio/echo3g.c | 2 +- sound/pci/echoaudio/gina20.c | 2 +- sound/pci/echoaudio/gina24.c | 2 +- sound/pci/echoaudio/indigo.c | 2 +- sound/pci/echoaudio/indigodj.c | 2 +- sound/pci/echoaudio/indigodjx.c | 2 +- sound/pci/echoaudio/indigoio.c | 2 +- sound/pci/echoaudio/indigoiox.c | 2 +- sound/pci/echoaudio/layla20.c | 2 +- sound/pci/echoaudio/layla24.c | 2 +- sound/pci/echoaudio/mia.c | 2 +- sound/pci/echoaudio/mona.c | 2 +- sound/pci/nm256/nm256.c | 6 +++--- sound/pci/rme9652/hdspm.c | 4 ++-- 17 files changed, 23 insertions(+), 23 deletions(-) diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index 9f78cf9e0b47..434077527b95 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c @@ -1400,7 +1400,7 @@ static snd_pcm_uframes_t snd_ali_pointer(struct snd_pcm_substream *substream) return cso; } -static struct snd_pcm_hardware snd_ali_playback = +static const struct snd_pcm_hardware snd_ali_playback = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | @@ -1426,7 +1426,7 @@ static struct snd_pcm_hardware snd_ali_playback = * Capture support device description */ -static struct snd_pcm_hardware snd_ali_capture = +static const struct snd_pcm_hardware snd_ali_capture = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | @@ -1457,7 +1457,7 @@ static void snd_ali_pcm_free_substream(struct snd_pcm_runtime *runtime) } static int snd_ali_open(struct snd_pcm_substream *substream, int rec, - int channel, struct snd_pcm_hardware *phw) + int channel, const struct snd_pcm_hardware *phw) { struct snd_ali *codec = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; @@ -1537,7 +1537,7 @@ static int snd_ali_modem_hw_params(struct snd_pcm_substream *substream, return 0; } -static struct snd_pcm_hardware snd_ali_modem = +static const struct snd_pcm_hardware snd_ali_modem = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/darla20.c b/sound/pci/echoaudio/darla20.c index 0f1c65d701f9..e295c71c7a39 100644 --- a/sound/pci/echoaudio/darla20.c +++ b/sound/pci/echoaudio/darla20.c @@ -56,7 +56,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/darla24.c b/sound/pci/echoaudio/darla24.c index 6dd7bfd643da..ae816e78f599 100644 --- a/sound/pci/echoaudio/darla24.c +++ b/sound/pci/echoaudio/darla24.c @@ -61,7 +61,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/echo3g.c b/sound/pci/echoaudio/echo3g.c index 8a03c4bb9f4c..3d37bb4030ec 100644 --- a/sound/pci/echoaudio/echo3g.c +++ b/sound/pci/echoaudio/echo3g.c @@ -74,7 +74,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/gina20.c b/sound/pci/echoaudio/gina20.c index fa1208f4031f..4f864ddc9530 100644 --- a/sound/pci/echoaudio/gina20.c +++ b/sound/pci/echoaudio/gina20.c @@ -60,7 +60,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/gina24.c b/sound/pci/echoaudio/gina24.c index 3089c3221a25..eff69e83ca0a 100644 --- a/sound/pci/echoaudio/gina24.c +++ b/sound/pci/echoaudio/gina24.c @@ -81,7 +81,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/indigo.c b/sound/pci/echoaudio/indigo.c index 0e85070b305e..a9f2efc58f6e 100644 --- a/sound/pci/echoaudio/indigo.c +++ b/sound/pci/echoaudio/indigo.c @@ -61,7 +61,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/indigodj.c b/sound/pci/echoaudio/indigodj.c index 0ad022137e53..14e9769ceba1 100644 --- a/sound/pci/echoaudio/indigodj.c +++ b/sound/pci/echoaudio/indigodj.c @@ -61,7 +61,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/indigodjx.c b/sound/pci/echoaudio/indigodjx.c index 38f17d39e53a..a14a7dc8c87d 100644 --- a/sound/pci/echoaudio/indigodjx.c +++ b/sound/pci/echoaudio/indigodjx.c @@ -61,7 +61,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/indigoio.c b/sound/pci/echoaudio/indigoio.c index 29e0137feb02..97e024450d19 100644 --- a/sound/pci/echoaudio/indigoio.c +++ b/sound/pci/echoaudio/indigoio.c @@ -62,7 +62,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/indigoiox.c b/sound/pci/echoaudio/indigoiox.c index f5c9ef6148ad..a017c966b4dc 100644 --- a/sound/pci/echoaudio/indigoiox.c +++ b/sound/pci/echoaudio/indigoiox.c @@ -62,7 +62,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/layla20.c b/sound/pci/echoaudio/layla20.c index 74906c35c662..7e38bc9c025d 100644 --- a/sound/pci/echoaudio/layla20.c +++ b/sound/pci/echoaudio/layla20.c @@ -70,7 +70,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/layla24.c b/sound/pci/echoaudio/layla24.c index 69742326f188..95c52210fb65 100644 --- a/sound/pci/echoaudio/layla24.c +++ b/sound/pci/echoaudio/layla24.c @@ -80,7 +80,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/mia.c b/sound/pci/echoaudio/mia.c index ee9722db62f5..a2d4b0003b57 100644 --- a/sound/pci/echoaudio/mia.c +++ b/sound/pci/echoaudio/mia.c @@ -71,7 +71,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/echoaudio/mona.c b/sound/pci/echoaudio/mona.c index 3e5747ea4860..1b45a2b5066f 100644 --- a/sound/pci/echoaudio/mona.c +++ b/sound/pci/echoaudio/mona.c @@ -90,7 +90,7 @@ static const struct pci_device_id snd_echo_ids[] = { {0,} }; -static struct snd_pcm_hardware pcm_hardware_skel = { +static const struct snd_pcm_hardware pcm_hardware_skel = { .info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index ac194485aa78..5da28b0adbd9 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c @@ -785,7 +785,7 @@ snd_nm256_capture_update(struct nm256 *chip) /* * hardware info */ -static struct snd_pcm_hardware snd_nm256_playback = +static const struct snd_pcm_hardware snd_nm256_playback = { .info = SNDRV_PCM_INFO_MMAP_IOMEM |SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED | @@ -804,7 +804,7 @@ static struct snd_pcm_hardware snd_nm256_playback = .period_bytes_max = 128 * 1024, }; -static struct snd_pcm_hardware snd_nm256_capture = +static const struct snd_pcm_hardware snd_nm256_capture = { .info = SNDRV_PCM_INFO_MMAP_IOMEM | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_INTERLEAVED | @@ -838,7 +838,7 @@ static int snd_nm256_pcm_hw_params(struct snd_pcm_substream *substream, */ static void snd_nm256_setup_stream(struct nm256 *chip, struct nm256_stream *s, struct snd_pcm_substream *substream, - struct snd_pcm_hardware *hw_ptr) + const struct snd_pcm_hardware *hw_ptr) { struct snd_pcm_runtime *runtime = substream->runtime; diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 56ae14c90a2c..9e3263395f98 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -5820,7 +5820,7 @@ static int snd_hdspm_prepare(struct snd_pcm_substream *substream) return 0; } -static struct snd_pcm_hardware snd_hdspm_playback_subinfo = { +static const struct snd_pcm_hardware snd_hdspm_playback_subinfo = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_NONINTERLEAVED | @@ -5845,7 +5845,7 @@ static struct snd_pcm_hardware snd_hdspm_playback_subinfo = { .fifo_size = 0 }; -static struct snd_pcm_hardware snd_hdspm_capture_subinfo = { +static const struct snd_pcm_hardware snd_hdspm_capture_subinfo = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_NONINTERLEAVED | From patchwork Fri Jan 3 08:16:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194017 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89769C00523 for ; Fri, 3 Jan 2020 08:18:21 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 96D8521835 for ; Fri, 3 Jan 2020 08:18:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Szn2y/eq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96D8521835 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6801116DB; Fri, 3 Jan 2020 09:17:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6801116DB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039498; bh=zLOGjz9a4REOoQMamSXQ237JAIGhizMixlyiWIQW6EE=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Szn2y/eqvavKvyxQrOFkhoJISZR97JS7ud/Fh1Kmm6xgR+1E8elT+xiGiFYyfrF3L jNrS0nx/Pn04xuU4FkPBrdOn/oapGGxtpUhcYPsKJSqo4vkrRaViChZ04srOTc1phj sQTGLV8v0CEqCzoz6v5I380JeIF2sSrFYYKFfjWg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2D05DF802C2; Fri, 3 Jan 2020 09:17:27 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EB2E4F8028B; Fri, 3 Jan 2020 09:17:24 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 82839F8013E for ; Fri, 3 Jan 2020 09:17:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 82839F8013E X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id AE00CB200 for ; Fri, 3 Jan 2020 08:17:19 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:19 +0100 Message-Id: <20200103081714.9560-4-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 03/58] ALSA: core: Treat snd_device_ops as const X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This is a preliminary patch to allow const for snd_device_ops definitions in each driver's code. The ops reference is read-only, hence it can be declared as const for further optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- include/sound/core.h | 4 ++-- sound/core/device.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sound/core.h b/include/sound/core.h index af3dce956c17..0e14b7a3e67b 100644 --- a/include/sound/core.h +++ b/include/sound/core.h @@ -69,7 +69,7 @@ struct snd_device { enum snd_device_state state; /* state of the device */ enum snd_device_type type; /* device type */ void *device_data; /* device structure */ - struct snd_device_ops *ops; /* operations */ + const struct snd_device_ops *ops; /* operations */ }; #define snd_device(n) list_entry(n, struct snd_device, list) @@ -256,7 +256,7 @@ static inline void snd_card_unref(struct snd_card *card) /* device.c */ int snd_device_new(struct snd_card *card, enum snd_device_type type, - void *device_data, struct snd_device_ops *ops); + void *device_data, const struct snd_device_ops *ops); int snd_device_register(struct snd_card *card, void *device_data); int snd_device_register_all(struct snd_card *card); void snd_device_disconnect(struct snd_card *card, void *device_data); diff --git a/sound/core/device.c b/sound/core/device.c index 708b91944de3..cdc5af526739 100644 --- a/sound/core/device.c +++ b/sound/core/device.c @@ -27,7 +27,7 @@ * Return: Zero if successful, or a negative error code on failure. */ int snd_device_new(struct snd_card *card, enum snd_device_type type, - void *device_data, struct snd_device_ops *ops) + void *device_data, const struct snd_device_ops *ops) { struct snd_device *dev; struct list_head *p; From patchwork Fri Jan 3 08:16:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194015 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1554C00523 for ; Fri, 3 Jan 2020 08:21:31 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2C747206DB for ; Fri, 3 Jan 2020 08:21:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="nHif1CgU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C747206DB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 551961707; Fri, 3 Jan 2020 09:20:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 551961707 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039689; bh=FVpVLtbnkLJZrkCP6C80HRbVJaACob01HiOLj0615XE=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=nHif1CgUYI/wju4M+Cra4RIH0BWyAprn6JbKSIO8Ty259ieGtXHQxhpveXH7Mg4fy VC1aFfzS5vyZ5isJYm1O7C5hajnLNtaDla32Vvs5n/46Ve1nOJ4g7Ij2Q17UsyOpkT cqtn1iSRmJqOX9DeQNJWfOf7x1dHOcWaujWsu/bg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 626DFF8026F; Fri, 3 Jan 2020 09:17:43 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 65704F80160; Fri, 3 Jan 2020 09:17:34 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A2F1FF800FE for ; Fri, 3 Jan 2020 09:17:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A2F1FF800FE X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BB6F5B202 for ; Fri, 3 Jan 2020 08:17:19 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:20 +0100 Message-Id: <20200103081714.9560-5-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 04/58] ALSA: core: Constify snd_device_ops definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Now we may declare const for snd_device_ops definitions, so let's do it for optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/core/compress_offload.c | 2 +- sound/core/control.c | 2 +- sound/core/hwdep.c | 2 +- sound/core/jack.c | 2 +- sound/core/pcm.c | 4 ++-- sound/core/rawmidi.c | 2 +- sound/core/seq_device.c | 2 +- sound/core/timer.c | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sound/core/compress_offload.c b/sound/core/compress_offload.c index f34ce564d92c..9de1c9a0173e 100644 --- a/sound/core/compress_offload.c +++ b/sound/core/compress_offload.c @@ -1099,7 +1099,7 @@ static int snd_compress_dev_free(struct snd_device *device) int snd_compress_new(struct snd_card *card, int device, int dirn, const char *id, struct snd_compr *compr) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_compress_dev_free, .dev_register = snd_compress_dev_register, .dev_disconnect = snd_compress_dev_disconnect, diff --git a/sound/core/control.c b/sound/core/control.c index 4728f6828890..63bb2fcf13be 100644 --- a/sound/core/control.c +++ b/sound/core/control.c @@ -1823,7 +1823,7 @@ static int snd_ctl_dev_free(struct snd_device *device) */ int snd_ctl_create(struct snd_card *card) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ctl_dev_free, .dev_register = snd_ctl_dev_register, .dev_disconnect = snd_ctl_dev_disconnect, diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c index 00cb5aed10a9..b412d3b3d5ff 100644 --- a/sound/core/hwdep.c +++ b/sound/core/hwdep.c @@ -353,7 +353,7 @@ int snd_hwdep_new(struct snd_card *card, char *id, int device, { struct snd_hwdep *hwdep; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_hwdep_dev_free, .dev_register = snd_hwdep_dev_register, .dev_disconnect = snd_hwdep_dev_disconnect, diff --git a/sound/core/jack.c b/sound/core/jack.c index fb26196571a7..6590b1b8d62a 100644 --- a/sound/core/jack.c +++ b/sound/core/jack.c @@ -201,7 +201,7 @@ int snd_jack_new(struct snd_card *card, const char *id, int type, struct snd_jack *jack; struct snd_jack_kctl *jack_kctl = NULL; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_jack_dev_free, #ifdef CONFIG_SND_JACK_INPUT_DEV .dev_register = snd_jack_dev_register, diff --git a/sound/core/pcm.c b/sound/core/pcm.c index 85db55ea49fd..a0f704b72a78 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -706,12 +706,12 @@ static int _snd_pcm_new(struct snd_card *card, const char *id, int device, { struct snd_pcm *pcm; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_pcm_dev_free, .dev_register = snd_pcm_dev_register, .dev_disconnect = snd_pcm_dev_disconnect, }; - static struct snd_device_ops internal_ops = { + static const struct snd_device_ops internal_ops = { .dev_free = snd_pcm_dev_free, }; diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index cd9bbb546846..7bc95c24f724 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -1621,7 +1621,7 @@ int snd_rawmidi_new(struct snd_card *card, char *id, int device, { struct snd_rawmidi *rmidi; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_rawmidi_dev_free, .dev_register = snd_rawmidi_dev_register, .dev_disconnect = snd_rawmidi_dev_disconnect, diff --git a/sound/core/seq_device.c b/sound/core/seq_device.c index e9dbad93f9d0..7ed13cb32ef8 100644 --- a/sound/core/seq_device.c +++ b/sound/core/seq_device.c @@ -193,7 +193,7 @@ int snd_seq_device_new(struct snd_card *card, int device, const char *id, { struct snd_seq_device *dev; int err; - static struct snd_device_ops dops = { + static const struct snd_device_ops dops = { .dev_free = snd_seq_device_dev_free, .dev_register = snd_seq_device_dev_register, .dev_disconnect = snd_seq_device_dev_disconnect, diff --git a/sound/core/timer.c b/sound/core/timer.c index 4cfd8e691903..d53bc1f3a48a 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -936,7 +936,7 @@ int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid, { struct snd_timer *timer; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_timer_dev_free, .dev_register = snd_timer_dev_register, .dev_disconnect = snd_timer_dev_disconnect, From patchwork Fri Jan 3 08:16:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194016 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CECAAC00523 for ; Fri, 3 Jan 2020 08:20:06 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5668521835 for ; Fri, 3 Jan 2020 08:20:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="DHzchpvO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5668521835 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 99172170A; Fri, 3 Jan 2020 09:19:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 99172170A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039604; bh=/4xc8kRZZVgV+XDVlEw/48BYKSKiF3lXsQwAQF9OESc=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=DHzchpvOzrHV5p9/fc85GEpJwsUgz9eTfYuraT1EgD++mlGA3mfJW2Uc1hrMXsqkS 9PzamfUXuZ/oGTG4DzmWCKcI3NSZKnS9C2lm5tBTO7IbTCs0q2B2bWrzmp7OI+CrU/ GcmWHJK2hmLjg6PAOz1yId2Dcsb1rSslX5x+1R5Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AE1F5F8015E; Fri, 3 Jan 2020 09:17:35 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CAF54F80315; Fri, 3 Jan 2020 09:17:33 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D2DB9F80160 for ; Fri, 3 Jan 2020 09:17:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D2DB9F80160 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C7808B21A for ; Fri, 3 Jan 2020 08:17:19 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:21 +0100 Message-Id: <20200103081714.9560-6-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 05/58] ALSA: drivers: Constify snd_device_ops definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Now we may declare const for snd_device_ops definitions, so let's do it for optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/drivers/ml403-ac97cr.c | 2 +- sound/drivers/opl3/opl3_lib.c | 2 +- sound/drivers/opl4/opl4_lib.c | 2 +- sound/drivers/pcsp/pcsp.c | 2 +- sound/drivers/serial-u16550.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/drivers/ml403-ac97cr.c b/sound/drivers/ml403-ac97cr.c index d1e01d89c722..2cec7c5bf8fd 100644 --- a/sound/drivers/ml403-ac97cr.c +++ b/sound/drivers/ml403-ac97cr.c @@ -1076,7 +1076,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev, { struct snd_ml403_ac97cr *ml403_ac97cr; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ml403_ac97cr_dev_free, }; struct resource *resource; diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c index cbdec28e89af..6134e5ffea0b 100644 --- a/sound/drivers/opl3/opl3_lib.c +++ b/sound/drivers/opl3/opl3_lib.c @@ -332,7 +332,7 @@ int snd_opl3_new(struct snd_card *card, unsigned short hardware, struct snd_opl3 **ropl3) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_opl3_dev_free, }; struct snd_opl3 *opl3; diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c index 901d339703a9..035645eb5e8d 100644 --- a/sound/drivers/opl4/opl4_lib.c +++ b/sound/drivers/opl4/opl4_lib.c @@ -184,7 +184,7 @@ int snd_opl4_create(struct snd_card *card, struct snd_opl4 *opl4; struct snd_opl3 *opl3; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_opl4_dev_free }; diff --git a/sound/drivers/pcsp/pcsp.c b/sound/drivers/pcsp/pcsp.c index 14aacd8267d1..fd79e57c85ca 100644 --- a/sound/drivers/pcsp/pcsp.c +++ b/sound/drivers/pcsp/pcsp.c @@ -43,7 +43,7 @@ struct snd_pcsp pcsp_chip; static int snd_pcsp_create(struct snd_card *card) { - static struct snd_device_ops ops = { }; + static const struct snd_device_ops ops = { }; unsigned int resolution = hrtimer_resolution; int err, div, min_div, order; diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 4775f1b7b444..893c2b57331f 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c @@ -777,7 +777,7 @@ static int snd_uart16550_create(struct snd_card *card, int droponfull, struct snd_uart16550 **ruart) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_uart16550_dev_free, }; struct snd_uart16550 *uart; From patchwork Fri Jan 3 08:16:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194012 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 514D3C00523 for ; Fri, 3 Jan 2020 08:25:19 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D20D121734 for ; Fri, 3 Jan 2020 08:25:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="YLhep7g3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D20D121734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 17E0C171E; Fri, 3 Jan 2020 09:24:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 17E0C171E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039917; bh=xl0l/Pzx/tVJ+oGx8zNRR/CTq9lNH+X0+KuSdO2NKg8=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YLhep7g36z8/z3jQjWTSD3CbIqMfWhf1AkIFbydOTWKeItT/9RYWhMmx345Qvpsj5 52lUhNPFB/PIdLbx+ZN/eRWdahOFBhBp5ZlUgcgwfFQv0qXDgYcJePJzTuRCUVYUCp ZFw46nbu/0nTeuAEuAOsyv+A5Q6QS3gfUf7k1aEg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A882FF80346; Fri, 3 Jan 2020 09:18:04 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 29E80F80329; Fri, 3 Jan 2020 09:17:45 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 78807F80272 for ; Fri, 3 Jan 2020 09:17:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 78807F80272 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id EF6C5B21E for ; Fri, 3 Jan 2020 08:17:19 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:24 +0100 Message-Id: <20200103081714.9560-9-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 08/58] ALSA: hda: Constify snd_device_ops definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Now we may declare const for snd_device_ops definitions, so let's do it for optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_beep.c | 2 +- sound/pci/hda/hda_codec.c | 2 +- sound/pci/hda/hda_intel.c | 2 +- sound/pci/hda/hda_tegra.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/pci/hda/hda_beep.c b/sound/pci/hda/hda_beep.c index b7d9160ed868..f5fd62ed4df5 100644 --- a/sound/pci/hda/hda_beep.c +++ b/sound/pci/hda/hda_beep.c @@ -192,7 +192,7 @@ static int beep_dev_free(struct snd_device *device) */ int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_register = beep_dev_register, .dev_disconnect = beep_dev_disconnect, .dev_free = beep_dev_free, diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index a2fb19129219..8f166bbc438b 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -915,7 +915,7 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card, char component[31]; hda_nid_t fg; int err; - static struct snd_device_ops dev_ops = { + static const struct snd_device_ops dev_ops = { .dev_register = snd_hda_codec_dev_register, .dev_free = snd_hda_codec_dev_free, }; diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index c7efb6f66bdc..4733268ec74e 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1743,7 +1743,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, int dev, unsigned int driver_caps, struct azx **rchip) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_disconnect = azx_dev_disconnect, .dev_free = azx_dev_free, }; diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c index 9d0784aed9e4..567c9ebddb2e 100644 --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c @@ -366,7 +366,7 @@ static int hda_tegra_create(struct snd_card *card, unsigned int driver_caps, struct hda_tegra *hda) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_disconnect = hda_tegra_dev_disconnect, .dev_free = hda_tegra_dev_free, }; From patchwork Fri Jan 3 08:16:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194011 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6664EC00523 for ; Fri, 3 Jan 2020 08:26:43 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E675721734 for ; Fri, 3 Jan 2020 08:26:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="adWryAnE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E675721734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2FCB71714; Fri, 3 Jan 2020 09:25:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2FCB71714 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040001; bh=Z9D6F4h3MiPGMIfxdZBDrophu7KCd6OerJ10ENfoRGU=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=adWryAnE2iQ4WHOnamaLq6qHIXjyBhFFjpHmlu1dM7yqCtNs+vkEntTQZ+FSq715E dBuWDAA701mD8lPGWlmO6no4+IGur3NT4DZI5ZFRTIQQSS+Z4IGZQXPF4d5B5D2AvS UsX9CnJV+V96fhx3PpwjPDM2fzHeruaYEFdMw4Aw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6DB93F8034B; Fri, 3 Jan 2020 09:18:10 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9018CF80331; Fri, 3 Jan 2020 09:17:47 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0FA3EF8015F for ; Fri, 3 Jan 2020 09:17:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0FA3EF8015F X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0C3E7B22E for ; Fri, 3 Jan 2020 08:17:20 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:25 +0100 Message-Id: <20200103081714.9560-10-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 09/58] ALSA: pci: Constify snd_device_ops definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Now we may declare const for snd_device_ops definitions, so let's do it for optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/pci/ac97/ac97_codec.c | 4 ++-- sound/pci/ad1889.c | 2 +- sound/pci/ak4531_codec.c | 2 +- sound/pci/ali5451/ali5451.c | 2 +- sound/pci/als300.c | 2 +- sound/pci/atiixp.c | 2 +- sound/pci/atiixp_modem.c | 2 +- sound/pci/au88x0/au88x0.c | 2 +- sound/pci/aw2/aw2-alsa.c | 2 +- sound/pci/azt3328.c | 2 +- sound/pci/bt87x.c | 2 +- sound/pci/ca0106/ca0106_main.c | 2 +- sound/pci/cmipci.c | 2 +- sound/pci/cs4281.c | 2 +- sound/pci/cs46xx/cs46xx_lib.c | 2 +- sound/pci/cs5530.c | 2 +- sound/pci/cs5535audio/cs5535audio.c | 2 +- sound/pci/ctxfi/ctatc.c | 2 +- sound/pci/echoaudio/echoaudio.c | 2 +- sound/pci/emu10k1/emu10k1_main.c | 2 +- sound/pci/emu10k1/emu10k1x.c | 2 +- sound/pci/ens1370.c | 2 +- sound/pci/es1938.c | 2 +- sound/pci/es1968.c | 2 +- sound/pci/fm801.c | 2 +- sound/pci/ice1712/ice1712.c | 2 +- sound/pci/ice1712/ice1724.c | 2 +- sound/pci/intel8x0.c | 2 +- sound/pci/intel8x0m.c | 2 +- sound/pci/korg1212/korg1212.c | 2 +- sound/pci/lola/lola.c | 2 +- sound/pci/lx6464es/lx6464es.c | 2 +- sound/pci/maestro3.c | 2 +- sound/pci/mixart/mixart.c | 2 +- sound/pci/nm256/nm256.c | 2 +- sound/pci/pcxhr/pcxhr.c | 2 +- sound/pci/riptide/riptide.c | 2 +- sound/pci/sis7019.c | 2 +- sound/pci/sonicvibes.c | 2 +- sound/pci/trident/trident_main.c | 2 +- sound/pci/via82xx.c | 2 +- sound/pci/via82xx_modem.c | 2 +- sound/pci/vx222/vx222.c | 2 +- sound/pci/ymfpci/ymfpci_main.c | 2 +- 44 files changed, 45 insertions(+), 45 deletions(-) diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 66f6c3bf08e3..41bdec4249e1 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c @@ -1899,7 +1899,7 @@ int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops, { int err; struct snd_ac97_bus *bus; - static struct snd_device_ops dev_ops = { + static const struct snd_device_ops dev_ops = { .dev_free = snd_ac97_bus_dev_free, }; @@ -1999,7 +1999,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template, unsigned long end_time; unsigned int reg; const struct ac97_codec_id *pid; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ac97_dev_free, .dev_register = snd_ac97_dev_register, .dev_disconnect = snd_ac97_dev_disconnect, diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c index 7770157a3a8c..3daa978263f6 100644 --- a/sound/pci/ad1889.c +++ b/sound/pci/ad1889.c @@ -847,7 +847,7 @@ snd_ad1889_create(struct snd_card *card, int err; struct snd_ad1889 *chip; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ad1889_dev_free, }; diff --git a/sound/pci/ak4531_codec.c b/sound/pci/ak4531_codec.c index 7fa8106b5010..fbf9a93a8053 100644 --- a/sound/pci/ak4531_codec.c +++ b/sound/pci/ak4531_codec.c @@ -371,7 +371,7 @@ int snd_ak4531_mixer(struct snd_card *card, unsigned int idx; int err; struct snd_ak4531 *ak4531; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ak4531_dev_free, }; diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index 434077527b95..39c33a944e5d 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c @@ -2046,7 +2046,7 @@ static int snd_ali_create(struct snd_card *card, struct snd_ali *codec; int i, err; unsigned short cmdw; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ali_dev_free, }; diff --git a/sound/pci/als300.c b/sound/pci/als300.c index 6573a2259cb6..64d978307755 100644 --- a/sound/pci/als300.c +++ b/sound/pci/als300.c @@ -617,7 +617,7 @@ static int snd_als300_create(struct snd_card *card, void *irq_handler; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_als300_dev_free, }; *rchip = NULL; diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 684b4f18e52c..61ae4fe8d646 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c @@ -1557,7 +1557,7 @@ static int snd_atiixp_create(struct snd_card *card, struct pci_dev *pci, struct atiixp **r_chip) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_atiixp_dev_free, }; struct atiixp *chip; diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index 40cda5c3bfeb..b62cde3a00b2 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c @@ -1187,7 +1187,7 @@ static int snd_atiixp_create(struct snd_card *card, struct pci_dev *pci, struct atiixp_modem **r_chip) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_atiixp_dev_free, }; struct atiixp_modem *chip; diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c index c9e0159af2b1..be276fb3f5af 100644 --- a/sound/pci/au88x0/au88x0.c +++ b/sound/pci/au88x0/au88x0.c @@ -142,7 +142,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip) { vortex_t *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_vortex_dev_free, }; diff --git a/sound/pci/aw2/aw2-alsa.c b/sound/pci/aw2/aw2-alsa.c index 819b148573a6..b3be98e33845 100644 --- a/sound/pci/aw2/aw2-alsa.c +++ b/sound/pci/aw2/aw2-alsa.c @@ -223,7 +223,7 @@ static int snd_aw2_create(struct snd_card *card, { struct aw2 *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_aw2_dev_free, }; diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c index b36e7a64e268..810d5772f097 100644 --- a/sound/pci/azt3328.c +++ b/sound/pci/azt3328.c @@ -2355,7 +2355,7 @@ snd_azf3328_create(struct snd_card *card, { struct snd_azf3328 *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_azf3328_dev_free, }; u8 dma_init; diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c index 2e16604c31ce..ece3f8971145 100644 --- a/sound/pci/bt87x.c +++ b/sound/pci/bt87x.c @@ -705,7 +705,7 @@ static int snd_bt87x_create(struct snd_card *card, { struct snd_bt87x *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_bt87x_dev_free }; diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index a14e9b1e50b0..e65154cecad5 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -1595,7 +1595,7 @@ static int snd_ca0106_create(int dev, struct snd_card *card, struct snd_ca0106 *chip; struct snd_ca0106_details *c; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ca0106_dev_free, }; diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 266c4cf28b78..ff5525722d58 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c @@ -2976,7 +2976,7 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci, { struct cmipci *cm; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_cmipci_dev_free, }; unsigned int val; diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index e7294b9d2cb6..75450e329cee 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c @@ -1304,7 +1304,7 @@ static int snd_cs4281_create(struct snd_card *card, struct cs4281 *chip; unsigned int tmp; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_cs4281_dev_free, }; diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index adfc750bc61c..6251fa8da939 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -3864,7 +3864,7 @@ int snd_cs46xx_create(struct snd_card *card, struct snd_cs46xx_region *region; struct cs_card_type *cp; u16 ss_card, ss_vendor; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_cs46xx_dev_free, }; diff --git a/sound/pci/cs5530.c b/sound/pci/cs5530.c index 3ab7ec565071..20b4faea50a6 100644 --- a/sound/pci/cs5530.c +++ b/sound/pci/cs5530.c @@ -104,7 +104,7 @@ static int snd_cs5530_create(struct snd_card *card, void __iomem *mem; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_cs5530_dev_free, }; *rchip = NULL; diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c index 15126aff63fc..930c2ac405e5 100644 --- a/sound/pci/cs5535audio/cs5535audio.c +++ b/sound/pci/cs5535audio/cs5535audio.c @@ -261,7 +261,7 @@ static int snd_cs5535audio_create(struct snd_card *card, struct cs5535audio *cs5535au; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_cs5535audio_dev_free, }; diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index 055a71b0a643..8d92154ac262 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c @@ -1669,7 +1669,7 @@ int ct_atc_create(struct snd_card *card, struct pci_dev *pci, struct ct_atc **ratc) { struct ct_atc *atc; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = atc_dev_free, }; int err; diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c index abad652a4006..dae3a853a6e1 100644 --- a/sound/pci/echoaudio/echoaudio.c +++ b/sound/pci/echoaudio/echoaudio.c @@ -1856,7 +1856,7 @@ static int snd_echo_create(struct snd_card *card, struct echoaudio *chip; int err; size_t sz; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_echo_dev_free, }; diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index 65e9ec94b807..6a8fce8ac218 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -1791,7 +1791,7 @@ int snd_emu10k1_create(struct snd_card *card, size_t page_table_size; unsigned int silent_page; const struct snd_emu_chip_details *c; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_emu10k1_dev_free, }; diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index 6467142ec460..90ae1c72d663 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c @@ -886,7 +886,7 @@ static int snd_emu10k1x_create(struct snd_card *card, struct emu10k1x *chip; int err; int ch; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_emu10k1x_dev_free, }; diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 378141aa7c7d..7611e44e2af5 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c @@ -2041,7 +2041,7 @@ static int snd_ensoniq_create(struct snd_card *card, { struct ensoniq *ensoniq; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ensoniq_dev_free, }; diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index d9fba07d36d0..9d5568509387 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c @@ -1548,7 +1548,7 @@ static int snd_es1938_create(struct snd_card *card, { struct es1938 *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_es1938_dev_free, }; diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 3610aa1da94c..43cfdf02048b 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c @@ -2656,7 +2656,7 @@ static int snd_es1968_create(struct snd_card *card, int radio_nr, struct es1968 **chip_ret) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_es1968_dev_free, }; struct es1968 *chip; diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index 152fbc352123..bb5cffee5dac 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c @@ -1183,7 +1183,7 @@ static int snd_fm801_create(struct snd_card *card, { struct fm801 *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_fm801_dev_free, }; diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index ffacf5e6ac9a..15cb90dceeb8 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c @@ -2474,7 +2474,7 @@ static int snd_ice1712_create(struct snd_card *card, { struct snd_ice1712 *ice; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ice1712_dev_free, }; diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 14e4da08adfd..628b0581a4ff 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c @@ -2502,7 +2502,7 @@ static int snd_vt1724_create(struct snd_card *card, { struct snd_ice1712 *ice; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_vt1724_dev_free, }; diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index f88008465c44..563f3a3e820e 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -2897,7 +2897,7 @@ static int snd_intel8x0_create(struct snd_card *card, unsigned int i; unsigned int int_sta_masks; struct ichdev *ichdev; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_intel8x0_dev_free, }; diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c index 2f73b45c845c..c6dc36167a01 100644 --- a/sound/pci/intel8x0m.c +++ b/sound/pci/intel8x0m.c @@ -1079,7 +1079,7 @@ static int snd_intel8x0m_create(struct snd_card *card, unsigned int i; unsigned int int_sta_masks; struct ichdev *ichdev; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_intel8x0m_dev_free, }; static struct ich_reg_info intel_regs[2] = { diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index 5d48ff0b32a7..f605926a0709 100644 --- a/sound/pci/korg1212/korg1212.c +++ b/sound/pci/korg1212/korg1212.c @@ -2153,7 +2153,7 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci, struct snd_korg1212 * korg1212; const struct firmware *dsp_code; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_korg1212_dev_free, }; diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c index e7c620caa935..cdd8db79bcfa 100644 --- a/sound/pci/lola/lola.c +++ b/sound/pci/lola/lola.c @@ -559,7 +559,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci, struct lola *chip; int err; unsigned int dever; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = lola_dev_free, }; diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c index 7f6b1c6c2afe..b92ea074ff2a 100644 --- a/sound/pci/lx6464es/lx6464es.c +++ b/sound/pci/lx6464es/lx6464es.c @@ -938,7 +938,7 @@ static int snd_lx6464es_create(struct snd_card *card, struct lx6464es *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_lx6464es_dev_free, }; diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index 9f75cc0c01dd..b94e3ec5f158 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c @@ -2522,7 +2522,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci, struct snd_m3 *chip; int i, err; const struct snd_pci_quirk *quirk; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_m3_dev_free, }; diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index 18124bd97d80..44009c555322 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c @@ -1030,7 +1030,7 @@ static int snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card, int { int err; struct snd_mixart *chip; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_mixart_chip_dev_free, }; diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index 5da28b0adbd9..003a09788572 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c @@ -1471,7 +1471,7 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci, { struct nm256 *chip; int err, pval; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_nm256_dev_free, }; u32 addr; diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index f4330832e520..9e59d591217b 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -1179,7 +1179,7 @@ static int pcxhr_create(struct pcxhr_mgr *mgr, { int err; struct snd_pcxhr *chip; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = pcxhr_chip_dev_free, }; diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index af6956e26c29..6617bc347bfb 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c @@ -1824,7 +1824,7 @@ snd_riptide_create(struct snd_card *card, struct pci_dev *pci, struct snd_riptide *chip; struct riptideport *hwport; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_riptide_dev_free, }; diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c index 515598e3cacf..2e351bf1d792 100644 --- a/sound/pci/sis7019.c +++ b/sound/pci/sis7019.c @@ -1280,7 +1280,7 @@ static int sis_chip_create(struct snd_card *card, { struct sis7019 *sis = card->private_data; struct voice *voice; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = sis_dev_free, }; int rc; diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c index a2bff9431512..dcdf5a534c4e 100644 --- a/sound/pci/sonicvibes.c +++ b/sound/pci/sonicvibes.c @@ -1221,7 +1221,7 @@ static int snd_sonicvibes_create(struct snd_card *card, struct sonicvibes *sonic; unsigned int dmaa, dmac; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_sonicvibes_dev_free, }; diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index 0d039eacbf0a..ba4a9fcd5eba 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c @@ -3487,7 +3487,7 @@ int snd_trident_create(struct snd_card *card, int i, err; struct snd_trident_voice *voice; struct snd_trident_pcm_mixer *tmix; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_trident_dev_free, }; diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index e72050a9ffdb..090b0c47fbdd 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -2332,7 +2332,7 @@ static int snd_via82xx_create(struct snd_card *card, { struct via82xx *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_via82xx_dev_free, }; diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index 4e0858f8e372..7f138fa4e141 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c @@ -1074,7 +1074,7 @@ static int snd_via82xx_create(struct snd_card *card, { struct via82xx_modem *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_via82xx_dev_free, }; diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c index bc451224df16..b278c72797d5 100644 --- a/sound/pci/vx222/vx222.c +++ b/sound/pci/vx222/vx222.c @@ -128,7 +128,7 @@ static int snd_vx222_create(struct snd_card *card, struct pci_dev *pci, struct vx_core *chip; struct snd_vx222 *vx; int i, err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_vx222_dev_free, }; struct snd_vx_ops *vx_ops; diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index 3bc92d236508..2e20cd9d8cfc 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c @@ -2327,7 +2327,7 @@ int snd_ymfpci_create(struct snd_card *card, { struct snd_ymfpci *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ymfpci_dev_free, }; From patchwork Fri Jan 3 08:16:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194013 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 348A9C00523 for ; Fri, 3 Jan 2020 08:24:08 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3275206DB for ; Fri, 3 Jan 2020 08:24:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="PeUqJiW8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3275206DB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0C27D171E; Fri, 3 Jan 2020 09:23:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0C27D171E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039846; bh=3BsQAaVylN6ek2fw8fraiX8iy9XK+A0hdxMuV6Ext0s=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=PeUqJiW8A01+aUV7ccJZXl8QgL0ofhEU5xdM15dR12zMaambfG8LHt/q3HpRBPMWJ sOIydnIriKMXlb31HmkOaLvi1tYyl1OQk7OWOtlPlXr5LxTLrXeZxaYRIZA4Muc+kO 2O7JDB+/5hQYuOTvwK0Uq+wLzBPidWY13tpElecw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 32D1EF8033D; Fri, 3 Jan 2020 09:17:58 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 094FEF80321; Fri, 3 Jan 2020 09:17:41 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4CC58F8026F for ; Fri, 3 Jan 2020 09:17:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4CC58F8026F X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2643DB248 for ; Fri, 3 Jan 2020 08:17:20 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:27 +0100 Message-Id: <20200103081714.9560-12-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 11/58] ALSA: aoa: Constify snd_device_ops definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Now we may declare const for snd_device_ops definitions, so let's do it for optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/aoa/aoa.h | 2 +- sound/aoa/codecs/onyx.c | 2 +- sound/aoa/codecs/tas.c | 2 +- sound/aoa/codecs/toonie.c | 2 +- sound/aoa/core/alsa.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/aoa/aoa.h b/sound/aoa/aoa.h index 60ce9dedc737..3d2d03ff6337 100644 --- a/sound/aoa/aoa.h +++ b/sound/aoa/aoa.h @@ -116,7 +116,7 @@ struct aoa_card { }; extern int aoa_snd_device_new(enum snd_device_type type, - void * device_data, struct snd_device_ops * ops); + void *device_data, const struct snd_device_ops *ops); extern struct snd_card *aoa_get_card(void); extern int aoa_snd_ctl_add(struct snd_kcontrol* control); diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c index 9827bee109c1..83ab3e58a0d3 100644 --- a/sound/aoa/codecs/onyx.c +++ b/sound/aoa/codecs/onyx.c @@ -97,7 +97,7 @@ static int onyx_dev_register(struct snd_device *dev) return 0; } -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_register = onyx_dev_register, }; diff --git a/sound/aoa/codecs/tas.c b/sound/aoa/codecs/tas.c index 7af6129d1cd7..c60b78367fc9 100644 --- a/sound/aoa/codecs/tas.c +++ b/sound/aoa/codecs/tas.c @@ -217,7 +217,7 @@ static int tas_dev_register(struct snd_device *dev) return 0; } -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_register = tas_dev_register, }; diff --git a/sound/aoa/codecs/toonie.c b/sound/aoa/codecs/toonie.c index b43469f43d2d..c2d014486c33 100644 --- a/sound/aoa/codecs/toonie.c +++ b/sound/aoa/codecs/toonie.c @@ -30,7 +30,7 @@ static int toonie_dev_register(struct snd_device *dev) return 0; } -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_register = toonie_dev_register, }; diff --git a/sound/aoa/core/alsa.c b/sound/aoa/core/alsa.c index fcf30f0c3adb..b61081342266 100644 --- a/sound/aoa/core/alsa.c +++ b/sound/aoa/core/alsa.c @@ -59,7 +59,7 @@ void aoa_alsa_cleanup(void) } int aoa_snd_device_new(enum snd_device_type type, - void * device_data, struct snd_device_ops * ops) + void *device_data, const struct snd_device_ops *ops) { struct snd_card *card = aoa_get_card(); int err; From patchwork Fri Jan 3 08:16:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194010 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21FEFC00523 for ; Fri, 3 Jan 2020 08:28:07 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95A5821734 for ; Fri, 3 Jan 2020 08:28:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="F4R4Y/hA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95A5821734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DA0CD1742; Fri, 3 Jan 2020 09:27:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DA0CD1742 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040084; bh=t8vdN7lDKUH6xCJu4XFnkSNhmz1BKAwg8gUaY9DLk/s=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=F4R4Y/hAMdmvi+rK7AiLOH1RXuEw7gxv6ff0+F8ee25rrscRDxFeOrgImseK7myUc kNZP/kcLHwPKJjP9jocuhykjLuLrHv77hF6uBTM5/d4E9KWeJrcXInIRBw4bs5oGvw kTpQVcVirxmyjQgoWLTSBcdTtmvIDmVvrsLRbtBU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2304AF80362; Fri, 3 Jan 2020 09:18:17 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 08168F80332; Fri, 3 Jan 2020 09:17:49 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CCC02F80274 for ; Fri, 3 Jan 2020 09:17:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CCC02F80274 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 334B1B253 for ; Fri, 3 Jan 2020 08:17:20 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:28 +0100 Message-Id: <20200103081714.9560-13-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 12/58] ALSA: mips: Constify snd_device_ops definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Now we may declare const for snd_device_ops definitions, so let's do it for optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/mips/hal2.c | 2 +- sound/mips/sgio2audio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/mips/hal2.c b/sound/mips/hal2.c index db44d9d691db..ec84bc4c3a6e 100644 --- a/sound/mips/hal2.c +++ b/sound/mips/hal2.c @@ -732,7 +732,7 @@ static int hal2_dev_free(struct snd_device *device) return 0; } -static struct snd_device_ops hal2_ops = { +static const struct snd_device_ops hal2_ops = { .dev_free = hal2_dev_free, }; diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c index f10a08a8777f..9f60a5037f8b 100644 --- a/sound/mips/sgio2audio.c +++ b/sound/mips/sgio2audio.c @@ -787,7 +787,7 @@ static int snd_sgio2audio_dev_free(struct snd_device *device) return snd_sgio2audio_free(chip); } -static struct snd_device_ops ops = { +static const struct snd_device_ops ops = { .dev_free = snd_sgio2audio_dev_free, }; From patchwork Fri Jan 3 08:16:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194008 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE45EC00523 for ; Fri, 3 Jan 2020 08:30:38 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D4FB20848 for ; Fri, 3 Jan 2020 08:30:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="hln0gkK+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D4FB20848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BDFD81701; Fri, 3 Jan 2020 09:29:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BDFD81701 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040236; bh=G60yvej4kDT5ZGi1IkZenQFtOCGGIglEGgQcF1iRwBU=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hln0gkK+g5XtUeJqmeVOc1WX0LXTvHaxd2gWDjqjZz+5D1Bz9GPySxIRbFKONBiPg UKh+yFuXHGOOno2KWtkqUSb2MsjnuqXTPytFsI++xMds7/mV4e40jMLeA6HaeLtWeL pV/Af5N4r0lrx4I/owD+r5Fjyh4zG+f8qYroboXI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B7A33F80371; Fri, 3 Jan 2020 09:18:27 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BB0E7F80276; Fri, 3 Jan 2020 09:17:53 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2158CF80276 for ; Fri, 3 Jan 2020 09:17:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2158CF80276 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 40C23B257 for ; Fri, 3 Jan 2020 08:17:20 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:29 +0100 Message-Id: <20200103081714.9560-14-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 13/58] ALSA: parisc: Constify snd_device_ops definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Now we may declare const for snd_device_ops definitions, so let's do it for optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/parisc/harmony.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/parisc/harmony.c b/sound/parisc/harmony.c index ea3630217d39..d330f22a3e8f 100644 --- a/sound/parisc/harmony.c +++ b/sound/parisc/harmony.c @@ -881,7 +881,7 @@ snd_harmony_create(struct snd_card *card, { int err; struct snd_harmony *h; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_harmony_dev_free, }; From patchwork Fri Jan 3 08:16:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89811C00523 for ; Fri, 3 Jan 2020 08:37:17 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 06C8B21D7D for ; Fri, 3 Jan 2020 08:37:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="SfpfcJuT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 06C8B21D7D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 670221768; Fri, 3 Jan 2020 09:36:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 670221768 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040635; bh=simStvUf5goVp4S8xtN1RGDFD+QN3Iei7JPpS6jmDyk=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SfpfcJuT9gqRg+llT7VYhm5DS4+4uhLFmuN5eOgeYhAZQrY7FTMj1Qc4qAsbSxqci mBmnZXsUYSkul1HIMzYLH7r8PH2mdAouW6YJ3pbrpLbYUUa8PlXnCRgD/XTZ9micFJ OCWjp8wChS7gvkXdQGUjwCbexXVHufOvIi10lujg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 10C30F802E3; Fri, 3 Jan 2020 09:18:57 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6619AF80351; Fri, 3 Jan 2020 09:18:14 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F3CE7F8013E for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F3CE7F8013E X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 75741B266 for ; Fri, 3 Jan 2020 08:17:20 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:34 +0100 Message-Id: <20200103081714.9560-19-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 18/58] ALSA: spi: Constify snd_device_ops definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Now we may declare const for snd_device_ops definitions, so let's do it for optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/spi/at73c213.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/spi/at73c213.c b/sound/spi/at73c213.c index 77563baf7a8f..d6f2b19cfa39 100644 --- a/sound/spi/at73c213.c +++ b/sound/spi/at73c213.c @@ -874,7 +874,7 @@ static int snd_at73c213_dev_free(struct snd_device *device) static int snd_at73c213_dev_init(struct snd_card *card, struct spi_device *spi) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_at73c213_dev_free, }; struct snd_at73c213 *chip = get_chip(card); From patchwork Fri Jan 3 08:16:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194009 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76E53C00523 for ; Fri, 3 Jan 2020 08:29:21 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED6BE20848 for ; Fri, 3 Jan 2020 08:29:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="fUoRltQS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ED6BE20848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 466FA1744; Fri, 3 Jan 2020 09:28:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 466FA1744 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040159; bh=teqsTpECef2w6r4yN6XkOEQCS0YOBfyWGq2RSC4Xx2E=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=fUoRltQSLjtLGOYvL6SHrp7Mb7fJlUHOR8pmiFvB6C/n6ODaDwhM/aI5IImr7M34n gMdw/6uFl3hev40qSKBFDuET1+QJb0WIuO7Y+mLhn+7SNMf3wMUyeghR0jkmBBHAiC tZOwB5+jWOyoyrVrN95aRrc0r1baL4EhZSa943PA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 18008F8036E; Fri, 3 Jan 2020 09:18:22 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C01F8F80331; Fri, 3 Jan 2020 09:17:52 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 76207F80278 for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 76207F80278 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 84AB0B269 for ; Fri, 3 Jan 2020 08:17:20 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:36 +0100 Message-Id: <20200103081714.9560-21-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 20/58] ALSA: timer: Constify snd_timer_hardware definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Most of snd_timer_hardware definitions do simply copying to another struct as-is. Mark them as const for further optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/core/pcm_timer.c | 2 +- sound/core/timer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/core/pcm_timer.c b/sound/core/pcm_timer.c index 7928bda235c1..c43484b22b34 100644 --- a/sound/core/pcm_timer.c +++ b/sound/core/pcm_timer.c @@ -75,7 +75,7 @@ static int snd_pcm_timer_stop(struct snd_timer * timer) return 0; } -static struct snd_timer_hardware snd_pcm_timer = +static const struct snd_timer_hardware snd_pcm_timer = { .flags = SNDRV_TIMER_HW_AUTO | SNDRV_TIMER_HW_SLAVE, .resolution = 0, diff --git a/sound/core/timer.c b/sound/core/timer.c index d53bc1f3a48a..8835ff91a893 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c @@ -1199,7 +1199,7 @@ static int snd_timer_s_close(struct snd_timer *timer) return 0; } -static struct snd_timer_hardware snd_timer_system = +static const struct snd_timer_hardware snd_timer_system = { .flags = SNDRV_TIMER_HW_FIRST | SNDRV_TIMER_HW_TASKLET, .resolution = 1000000000L / HZ, From patchwork Fri Jan 3 08:16:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194007 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA202C00523 for ; Fri, 3 Jan 2020 08:31:58 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 34C8F20866 for ; Fri, 3 Jan 2020 08:31:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="TJBUMTjH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34C8F20866 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 90637174D; Fri, 3 Jan 2020 09:31:06 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 90637174D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040316; bh=ohlQA5VRGsFdMjSOk72uuQAzBSFMlq/65UPLP8aGBvU=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TJBUMTjHdGnN/Nzi2NVf+JZLXl2s4LeWbQy9VF7rzT//EeCvlAYLzc2NYBJ3TUcyy 9YbvfnwdqvNFZfH1IFQVqm3yiKyU76eDDDUzu6YGa0PhpY0cBU3BaFv+DEwFicgrAr VSGrOAiHE30itxJkjF7a2HPCYACkV631jRmf35gE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E136EF8037F; Fri, 3 Jan 2020 09:18:34 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B707BF80340; Fri, 3 Jan 2020 09:17:58 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B94BCF8027C for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B94BCF8027C X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BD0F7B26C for ; Fri, 3 Jan 2020 08:17:20 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:40 +0100 Message-Id: <20200103081714.9560-25-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 24/58] ALSA: arm: Constify snd_ac97_bus_ops definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Now snd_ac97_bus() takes the const ops pointer, so we can define the snd_ac97_bus_ops locally as const as well for further optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/arm/aaci.c | 2 +- sound/arm/pxa2xx-ac97.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index d1b5dbcd9e87..d663bd7adae6 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -811,7 +811,7 @@ static const struct ac97_pcm ac97_defs[] = { } }; -static struct snd_ac97_bus_ops aaci_bus_ops = { +static const struct snd_ac97_bus_ops aaci_bus_ops = { .write = aaci_ac97_write, .read = aaci_ac97_read, }; diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index 08ae55166890..ea8e233150c8 100644 --- a/sound/arm/pxa2xx-ac97.c +++ b/sound/arm/pxa2xx-ac97.c @@ -52,7 +52,7 @@ static void pxa2xx_ac97_legacy_write(struct snd_ac97 *ac97, ret = pxa2xx_ac97_write(ac97->num, reg, val); } -static struct snd_ac97_bus_ops pxa2xx_ac97_ops = { +static const struct snd_ac97_bus_ops pxa2xx_ac97_ops = { .read = pxa2xx_ac97_legacy_read, .write = pxa2xx_ac97_legacy_write, .reset = pxa2xx_ac97_legacy_reset, From patchwork Fri Jan 3 08:16:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194005 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F968C00523 for ; Fri, 3 Jan 2020 08:34:42 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1674020866 for ; Fri, 3 Jan 2020 08:34:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="cMMNFonY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1674020866 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 517BA1758; Fri, 3 Jan 2020 09:33:50 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 517BA1758 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040480; bh=JN4D1SVqoQy4RYpICB5Yief23ufk1yE5jplYMLKx4oU=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=cMMNFonYn4Ue8VK+OG5APU+E8sRU6MvtXQTafBmJE0MRKykR9Vc/7i1QIbncG/CqQ 53qPui8AhTJDKUURtaO/UY0ztD7Aql7L/n8i3li3/7Xo980M76rOmlRkhgZNRFiOec 2Pr/hg2CxOZW15fbGfcH/SROpxpNSXeCAik3ghgs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A8B5AF803BD; Fri, 3 Jan 2020 09:18:46 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B925DF8034A; Fri, 3 Jan 2020 09:18:07 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CF6B4F80279 for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CF6B4F80279 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E5ECBB26F for ; Fri, 3 Jan 2020 08:17:20 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:43 +0100 Message-Id: <20200103081714.9560-28-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 27/58] ALSA: pci: Constify snd_ac97_bus_ops definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Now snd_ac97_bus() takes the const ops pointer, so we can define the snd_ac97_bus_ops locally as const as well for further optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/pci/ad1889.c | 2 +- sound/pci/ali5451/ali5451.c | 2 +- sound/pci/als300.c | 2 +- sound/pci/atiixp.c | 2 +- sound/pci/atiixp_modem.c | 2 +- sound/pci/au88x0/au88x0_mixer.c | 2 +- sound/pci/azt3328.c | 2 +- sound/pci/ca0106/ca0106_main.c | 2 +- sound/pci/cs4281.c | 2 +- sound/pci/cs46xx/cs46xx_lib.c | 2 +- sound/pci/cs5535audio/cs5535audio.c | 2 +- sound/pci/emu10k1/emu10k1x.c | 2 +- sound/pci/emu10k1/emumixer.c | 2 +- sound/pci/ens1370.c | 2 +- sound/pci/es1968.c | 2 +- sound/pci/fm801.c | 2 +- sound/pci/ice1712/ice1712.c | 4 ++-- sound/pci/ice1712/ice1724.c | 2 +- sound/pci/intel8x0.c | 6 +++--- sound/pci/intel8x0m.c | 2 +- sound/pci/maestro3.c | 2 +- sound/pci/nm256/nm256.c | 2 +- sound/pci/riptide/riptide.c | 2 +- sound/pci/sis7019.c | 2 +- sound/pci/trident/trident_main.c | 2 +- sound/pci/via82xx.c | 2 +- sound/pci/via82xx_modem.c | 2 +- sound/pci/ymfpci/ymfpci_main.c | 2 +- 28 files changed, 31 insertions(+), 31 deletions(-) diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c index 3daa978263f6..5d42c42491bf 100644 --- a/sound/pci/ad1889.c +++ b/sound/pci/ad1889.c @@ -760,7 +760,7 @@ snd_ad1889_ac97_init(struct snd_ad1889 *chip, const char *quirk_override) { int err; struct snd_ac97_template ac97; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_ad1889_ac97_write, .read = snd_ad1889_ac97_read, }; diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index 39c33a944e5d..b2374266c52c 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c @@ -1791,7 +1791,7 @@ static int snd_ali_mixer(struct snd_ali *codec) struct snd_ac97_template ac97; unsigned int idx; int i, err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_ali_codec_write, .read = snd_ali_codec_read, }; diff --git a/sound/pci/als300.c b/sound/pci/als300.c index 64d978307755..8d2471ea090b 100644 --- a/sound/pci/als300.c +++ b/sound/pci/als300.c @@ -294,7 +294,7 @@ static int snd_als300_ac97(struct snd_als300 *chip) struct snd_ac97_bus *bus; struct snd_ac97_template ac97; int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_als300_ac97_write, .read = snd_als300_ac97_read, }; diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 61ae4fe8d646..c3281fab365d 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c @@ -1403,7 +1403,7 @@ static int snd_atiixp_mixer_new(struct atiixp *chip, int clock, struct snd_ac97_template ac97; int i, err; int codec_count; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_atiixp_ac97_write, .read = snd_atiixp_ac97_read, }; diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index b62cde3a00b2..3ec34e78ffef 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c @@ -1046,7 +1046,7 @@ static int snd_atiixp_mixer_new(struct atiixp_modem *chip, int clock) struct snd_ac97_template ac97; int i, err; int codec_count; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_atiixp_ac97_write, .read = snd_atiixp_ac97_read, }; diff --git a/sound/pci/au88x0/au88x0_mixer.c b/sound/pci/au88x0/au88x0_mixer.c index 60dd8a091bc3..5b647682b683 100644 --- a/sound/pci/au88x0/au88x0_mixer.c +++ b/sound/pci/au88x0/au88x0_mixer.c @@ -25,7 +25,7 @@ static int snd_vortex_mixer(vortex_t *vortex) struct snd_ac97_bus *pbus; struct snd_ac97_template ac97; int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = vortex_codec_write, .read = vortex_codec_read, }; diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c index 810d5772f097..898ba55fc0dd 100644 --- a/sound/pci/azt3328.c +++ b/sound/pci/azt3328.c @@ -757,7 +757,7 @@ snd_azf3328_mixer_new(struct snd_azf3328 *chip) { struct snd_ac97_bus *bus; struct snd_ac97_template ac97; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_azf3328_mixer_ac97_write, .read = snd_azf3328_mixer_ac97_read, }; diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index e65154cecad5..d3bd27ddb049 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -1161,7 +1161,7 @@ static int snd_ca0106_ac97(struct snd_ca0106 *chip) struct snd_ac97_bus *pbus; struct snd_ac97_template ac97; int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_ca0106_ac97_write, .read = snd_ca0106_ac97_read, }; diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index 75450e329cee..8fd64dab372d 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c @@ -1064,7 +1064,7 @@ static int snd_cs4281_mixer(struct cs4281 *chip) struct snd_card *card = chip->card; struct snd_ac97_template ac97; int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_cs4281_ac97_write, .read = snd_cs4281_ac97_read, }; diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 6251fa8da939..3f2fe26efee3 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -2465,7 +2465,7 @@ int snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device) struct snd_ctl_elem_id id; int err; unsigned int idx; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { #ifdef CONFIG_SND_CS46XX_NEW_DSP .reset = snd_cs46xx_codec_reset, #endif diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c index 930c2ac405e5..11ce3c4589fa 100644 --- a/sound/pci/cs5535audio/cs5535audio.c +++ b/sound/pci/cs5535audio/cs5535audio.c @@ -138,7 +138,7 @@ static int snd_cs5535audio_mixer(struct cs5535audio *cs5535au) struct snd_ac97_bus *pbus; struct snd_ac97_template ac97; int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_cs5535audio_ac97_codec_write, .read = snd_cs5535audio_ac97_codec_read, }; diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index 90ae1c72d663..ddb7c2ce3f7c 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c @@ -718,7 +718,7 @@ static int snd_emu10k1x_ac97(struct emu10k1x *chip) struct snd_ac97_bus *pbus; struct snd_ac97_template ac97; int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_emu10k1x_ac97_write, .read = snd_emu10k1x_ac97_read, }; diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index 7c0417253cb5..0b3dfc71fa69 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c @@ -1898,7 +1898,7 @@ int snd_emu10k1_mixer(struct snd_emu10k1 *emu, if (emu->card_capabilities->ac97_chip) { struct snd_ac97_bus *pbus; struct snd_ac97_template ac97; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_emu10k1_ac97_write, .read = snd_emu10k1_ac97_read, }; diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 7611e44e2af5..15e6d2377ecf 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c @@ -1596,7 +1596,7 @@ static int snd_ensoniq_1371_mixer(struct ensoniq *ensoniq, struct snd_ac97_bus *pbus; struct snd_ac97_template ac97; int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_es1371_codec_write, .read = snd_es1371_codec_read, .wait = snd_es1371_codec_wait, diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index 43cfdf02048b..f23a935267c3 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c @@ -2007,7 +2007,7 @@ snd_es1968_mixer(struct es1968 *chip) struct snd_ctl_elem_id elem_id; #endif int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_es1968_ac97_write, .read = snd_es1968_ac97_read, }; diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index bb5cffee5dac..ae2b413ff489 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c @@ -1020,7 +1020,7 @@ static int snd_fm801_mixer(struct fm801 *chip) struct snd_ac97_template ac97; unsigned int i; int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_fm801_codec_write, .read = snd_fm801_codec_read, }; diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 15cb90dceeb8..9794bbedffc3 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c @@ -1464,11 +1464,11 @@ static int snd_ice1712_ac97_mixer(struct snd_ice1712 *ice) int err, bus_num = 0; struct snd_ac97_template ac97; struct snd_ac97_bus *pbus; - static struct snd_ac97_bus_ops con_ops = { + static const struct snd_ac97_bus_ops con_ops = { .write = snd_ice1712_ac97_write, .read = snd_ice1712_ac97_read, }; - static struct snd_ac97_bus_ops pro_ops = { + static const struct snd_ac97_bus_ops pro_ops = { .write = snd_ice1712_pro_ac97_write, .read = snd_ice1712_pro_ac97_read, }; diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 628b0581a4ff..4630a8c42aa9 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c @@ -1463,7 +1463,7 @@ static int snd_vt1724_ac97_mixer(struct snd_ice1712 *ice) if (!(ice->eeprom.data[ICE_EEP2_ACLINK] & VT1724_CFG_PRO_I2S)) { struct snd_ac97_bus *pbus; struct snd_ac97_template ac97; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_vt1724_ac97_write, .read = snd_vt1724_ac97_read, }; diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index 563f3a3e820e..de875ea8ecbe 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -2138,12 +2138,12 @@ static int snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock, int err; unsigned int i, codecs; unsigned int glob_sta = 0; - struct snd_ac97_bus_ops *ops; - static struct snd_ac97_bus_ops standard_bus_ops = { + const struct snd_ac97_bus_ops *ops; + static const struct snd_ac97_bus_ops standard_bus_ops = { .write = snd_intel8x0_codec_write, .read = snd_intel8x0_codec_read, }; - static struct snd_ac97_bus_ops ali_bus_ops = { + static const struct snd_ac97_bus_ops ali_bus_ops = { .write = snd_intel8x0_ali_codec_write, .read = snd_intel8x0_ali_codec_read, }; diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c index c6dc36167a01..74d45b9a1571 100644 --- a/sound/pci/intel8x0m.c +++ b/sound/pci/intel8x0m.c @@ -801,7 +801,7 @@ static int snd_intel8x0m_mixer(struct intel8x0m *chip, int ac97_clock) struct snd_ac97 *x97; int err; unsigned int glob_sta = 0; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_intel8x0m_codec_write, .read = snd_intel8x0m_codec_read, }; diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index b94e3ec5f158..89018d44d777 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c @@ -2036,7 +2036,7 @@ static int snd_m3_mixer(struct snd_m3 *chip) struct snd_ctl_elem_id elem_id; #endif int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_m3_ac97_write, .read = snd_m3_ac97_read, }; diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index 003a09788572..99228b93b3c6 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c @@ -1309,7 +1309,7 @@ snd_nm256_mixer(struct nm256 *chip) struct snd_ac97_bus *pbus; struct snd_ac97_template ac97; int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .reset = snd_nm256_ac97_reset, .write = snd_nm256_ac97_write, .read = snd_nm256_ac97_read, diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index 6617bc347bfb..625c85428955 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c @@ -1963,7 +1963,7 @@ static int snd_riptide_mixer(struct snd_riptide *chip) struct snd_ac97_bus *pbus; struct snd_ac97_template ac97; int err = 0; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_riptide_codec_write, .read = snd_riptide_codec_read, }; diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c index 2e351bf1d792..4977ab0b8b3d 100644 --- a/sound/pci/sis7019.c +++ b/sound/pci/sis7019.c @@ -983,7 +983,7 @@ static int sis_mixer_create(struct sis7019 *sis) { struct snd_ac97_bus *bus; struct snd_ac97_template ac97; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = sis_ac97_write, .read = sis_ac97_read, }; diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c index ba4a9fcd5eba..6e50376163a2 100644 --- a/sound/pci/trident/trident_main.c +++ b/sound/pci/trident/trident_main.c @@ -2912,7 +2912,7 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device) struct snd_kcontrol *kctl; struct snd_ctl_elem_value *uctl; int idx, err, retries = 2; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_trident_codec_write, .read = snd_trident_codec_read, }; diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index 090b0c47fbdd..c8fb51885b6d 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -1868,7 +1868,7 @@ static int snd_via82xx_mixer_new(struct via82xx *chip, const char *quirk_overrid { struct snd_ac97_template ac97; int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_via82xx_codec_write, .read = snd_via82xx_codec_read, .wait = snd_via82xx_codec_wait, diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index 7f138fa4e141..84e589803e2e 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c @@ -871,7 +871,7 @@ static int snd_via82xx_mixer_new(struct via82xx_modem *chip) { struct snd_ac97_template ac97; int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_via82xx_codec_write, .read = snd_via82xx_codec_read, .wait = snd_via82xx_codec_wait, diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index 1d9295bb00a9..a531f4d2605d 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c @@ -1780,7 +1780,7 @@ int snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch) struct snd_pcm_substream *substream; unsigned int idx; int err; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = snd_ymfpci_codec_write, .read = snd_ymfpci_codec_read, }; From patchwork Fri Jan 3 08:16:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 359ABC00523 for ; Fri, 3 Jan 2020 08:39:49 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AEBA421D7D for ; Fri, 3 Jan 2020 08:39:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="DHdoKIGe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AEBA421D7D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0A80B176E; Fri, 3 Jan 2020 09:38:57 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0A80B176E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040787; bh=KS8kVIuzZkUNz+hs2qne/xRUy5d5r9jFFd6OPItyLhI=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=DHdoKIGevAVXPpb2NgQpWbPke/vGhwmThhA+PzZi/uTzgzMznh2JLNI89OOb0Rb/6 mak6ZCW1tD0q5h2rsJa2gIjw+5R0z8YpfAR0umsKNhv3w4uaSyBMecUgukx7Kiyhtq aQMaKAdwG29zZK8cjdoOYpbRu9cCDQfLvwqbj3rU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6F445F803FB; Fri, 3 Jan 2020 09:19:05 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 59CE0F8028F; Fri, 3 Jan 2020 09:18:21 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 64684F80290 for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 64684F80290 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0CC71B271 for ; Fri, 3 Jan 2020 08:17:21 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:45 +0100 Message-Id: <20200103081714.9560-30-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 29/58] ALSA: seq: Constify struct snd_midi_op X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Change the argument of snd_midi_process_event() to receive a const snd_midi_op pointer and its callers respectively. This allows further optimizations. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- include/sound/seq_midi_emul.h | 3 ++- sound/core/seq/seq_midi_emul.c | 37 ++++++++++++++++++++++--------------- sound/drivers/opl3/opl3_seq.c | 2 +- sound/drivers/opl3/opl3_voice.h | 2 +- sound/drivers/opl4/opl4_seq.c | 2 +- sound/synth/emux/emux_seq.c | 2 +- 6 files changed, 28 insertions(+), 20 deletions(-) diff --git a/include/sound/seq_midi_emul.h b/include/sound/seq_midi_emul.h index d6b74059b4b1..88799d1e1f53 100644 --- a/include/sound/seq_midi_emul.h +++ b/include/sound/seq_midi_emul.h @@ -174,7 +174,8 @@ enum { }; /* Prototypes for midi_process.c */ -void snd_midi_process_event(struct snd_midi_op *ops, struct snd_seq_event *ev, +void snd_midi_process_event(const struct snd_midi_op *ops, + struct snd_seq_event *ev, struct snd_midi_channel_set *chanset); void snd_midi_channel_set_clear(struct snd_midi_channel_set *chset); struct snd_midi_channel_set *snd_midi_channel_alloc_set(int n); diff --git a/sound/core/seq/seq_midi_emul.c b/sound/core/seq/seq_midi_emul.c index 770d3f4eee7c..536ccf48ee72 100644 --- a/sound/core/seq/seq_midi_emul.c +++ b/sound/core/seq/seq_midi_emul.c @@ -30,22 +30,25 @@ MODULE_DESCRIPTION("Advanced Linux Sound Architecture sequencer MIDI emulation." MODULE_LICENSE("GPL"); /* Prototypes for static functions */ -static void note_off(struct snd_midi_op *ops, void *drv, +static void note_off(const struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, int note, int vel); -static void do_control(struct snd_midi_op *ops, void *private, +static void do_control(const struct snd_midi_op *ops, void *private, struct snd_midi_channel_set *chset, struct snd_midi_channel *chan, int control, int value); -static void rpn(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, +static void rpn(const struct snd_midi_op *ops, void *drv, + struct snd_midi_channel *chan, struct snd_midi_channel_set *chset); -static void nrpn(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, +static void nrpn(const struct snd_midi_op *ops, void *drv, + struct snd_midi_channel *chan, struct snd_midi_channel_set *chset); -static void sysex(struct snd_midi_op *ops, void *private, unsigned char *sysex, +static void sysex(const struct snd_midi_op *ops, void *private, + unsigned char *sysex, int len, struct snd_midi_channel_set *chset); -static void all_sounds_off(struct snd_midi_op *ops, void *private, +static void all_sounds_off(const struct snd_midi_op *ops, void *private, struct snd_midi_channel *chan); -static void all_notes_off(struct snd_midi_op *ops, void *private, +static void all_notes_off(const struct snd_midi_op *ops, void *private, struct snd_midi_channel *chan); static void snd_midi_reset_controllers(struct snd_midi_channel *chan); static void reset_all_channels(struct snd_midi_channel_set *chset); @@ -66,7 +69,7 @@ static void reset_all_channels(struct snd_midi_channel_set *chset); * be interpreted. */ void -snd_midi_process_event(struct snd_midi_op *ops, +snd_midi_process_event(const struct snd_midi_op *ops, struct snd_seq_event *ev, struct snd_midi_channel_set *chanset) { @@ -229,7 +232,8 @@ EXPORT_SYMBOL(snd_midi_process_event); * release note */ static void -note_off(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, +note_off(const struct snd_midi_op *ops, void *drv, + struct snd_midi_channel *chan, int note, int vel) { if (chan->gm_hold) { @@ -251,7 +255,8 @@ note_off(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, * events that need to take place immediately to the driver. */ static void -do_control(struct snd_midi_op *ops, void *drv, struct snd_midi_channel_set *chset, +do_control(const struct snd_midi_op *ops, void *drv, + struct snd_midi_channel_set *chset, struct snd_midi_channel *chan, int control, int value) { int i; @@ -402,7 +407,7 @@ EXPORT_SYMBOL(snd_midi_channel_set_clear); * Process a rpn message. */ static void -rpn(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, +rpn(const struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, struct snd_midi_channel_set *chset) { int type; @@ -442,7 +447,7 @@ rpn(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, * Process an nrpn message. */ static void -nrpn(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, +nrpn(const struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan, struct snd_midi_channel_set *chset) { /* parse XG NRPNs here if possible */ @@ -470,7 +475,7 @@ get_channel(unsigned char cmd) * Process a sysex message. */ static void -sysex(struct snd_midi_op *ops, void *private, unsigned char *buf, int len, +sysex(const struct snd_midi_op *ops, void *private, unsigned char *buf, int len, struct snd_midi_channel_set *chset) { /* GM on */ @@ -584,7 +589,8 @@ sysex(struct snd_midi_op *ops, void *private, unsigned char *buf, int len, * all sound off */ static void -all_sounds_off(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan) +all_sounds_off(const struct snd_midi_op *ops, void *drv, + struct snd_midi_channel *chan) { int n; @@ -602,7 +608,8 @@ all_sounds_off(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan * all notes off */ static void -all_notes_off(struct snd_midi_op *ops, void *drv, struct snd_midi_channel *chan) +all_notes_off(const struct snd_midi_op *ops, void *drv, + struct snd_midi_channel *chan) { int n; diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c index 20f2f5125394..cd2a01b5e2e1 100644 --- a/sound/drivers/opl3/opl3_seq.c +++ b/sound/drivers/opl3/opl3_seq.c @@ -128,7 +128,7 @@ static int snd_opl3_synth_unuse(void *private_data, struct snd_seq_port_subscrib /* * MIDI emulation operators */ -struct snd_midi_op opl3_ops = { +const struct snd_midi_op opl3_ops = { .note_on = snd_opl3_note_on, .note_off = snd_opl3_note_off, .key_press = snd_opl3_key_press, diff --git a/sound/drivers/opl3/opl3_voice.h b/sound/drivers/opl3/opl3_voice.h index dc0626a2dd61..be9ccca2d952 100644 --- a/sound/drivers/opl3/opl3_voice.h +++ b/sound/drivers/opl3/opl3_voice.h @@ -41,6 +41,6 @@ void snd_opl3_free_seq_oss(struct snd_opl3 *opl3); extern char snd_opl3_regmap[MAX_OPL2_VOICES][4]; extern bool use_internal_drums; -extern struct snd_midi_op opl3_ops; +extern const struct snd_midi_op opl3_ops; #endif diff --git a/sound/drivers/opl4/opl4_seq.c b/sound/drivers/opl4/opl4_seq.c index 03d6202f4829..f59ca660c616 100644 --- a/sound/drivers/opl4/opl4_seq.c +++ b/sound/drivers/opl4/opl4_seq.c @@ -100,7 +100,7 @@ static int snd_opl4_seq_unuse(void *private_data, struct snd_seq_port_subscribe return 0; } -static struct snd_midi_op opl4_ops = { +static const struct snd_midi_op opl4_ops = { .note_on = snd_opl4_note_on, .note_off = snd_opl4_note_off, .note_terminate = snd_opl4_terminate_note, diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c index 9d8a69f1a644..b227c7e0bc2a 100644 --- a/sound/synth/emux/emux_seq.c +++ b/sound/synth/emux/emux_seq.c @@ -19,7 +19,7 @@ static int snd_emux_unuse(void *private_data, struct snd_seq_port_subscribe *inf /* * MIDI emulation operators */ -static struct snd_midi_op emux_ops = { +static const struct snd_midi_op emux_ops = { .note_on = snd_emux_note_on, .note_off = snd_emux_note_off, .key_press = snd_emux_key_press, From patchwork Fri Jan 3 08:16:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194006 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7EDEC00523 for ; Fri, 3 Jan 2020 08:33:12 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 543DF20866 for ; Fri, 3 Jan 2020 08:33:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Xe7s6XQQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 543DF20866 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A4272172F; Fri, 3 Jan 2020 09:32:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A4272172F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040390; bh=L1t9scsuwjb6EwO6Zo/zlqmGvx1zzUjLseqBtQQEDTw=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Xe7s6XQQkUXA11oj9oPX5oRNwtYL15lMUxyDYitkGsEdunany4Rhtofhf2Ng7qRiF JJl4tjmcSYfZVppyfgURcpzIO4Yefw5w9iTlf9UBkeGH9FKVuFksQP8cySRB8j5SLG 7QaSy+XuYTXP1nsphpZdzc93jdUQ61+505gLY/VE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 71A27F802A2; Fri, 3 Jan 2020 09:18:40 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 515EDF80349; Fri, 3 Jan 2020 09:18:05 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 234B5F8028D for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 234B5F8028D X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 1C6AEB272 for ; Fri, 3 Jan 2020 08:17:21 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:46 +0100 Message-Id: <20200103081714.9560-31-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 30/58] ALSA: vx: Constify snd_vx_hardware and snd_vx_ops definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Both snd_vx_hardware and snd_vx_ops are only referred without modification, hence they can be constified gracefully for further optimizations. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- include/sound/vx_core.h | 9 +++++---- sound/drivers/vx/vx_core.c | 5 +++-- sound/pci/vx222/vx222.c | 12 ++++++------ sound/pci/vx222/vx222.h | 4 ++-- sound/pci/vx222/vx222_ops.c | 4 ++-- sound/pcmcia/vx/vxp_ops.c | 2 +- sound/pcmcia/vx/vxpocket.c | 4 ++-- sound/pcmcia/vx/vxpocket.h | 2 +- 8 files changed, 22 insertions(+), 20 deletions(-) diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h index 84569ddf85e1..1ddd3036bdfc 100644 --- a/include/sound/vx_core.h +++ b/include/sound/vx_core.h @@ -147,8 +147,8 @@ struct vx_core { /* ports are defined externally */ /* low-level functions */ - struct snd_vx_hardware *hw; - struct snd_vx_ops *ops; + const struct snd_vx_hardware *hw; + const struct snd_vx_ops *ops; struct mutex lock; @@ -193,8 +193,9 @@ struct vx_core { /* * constructor */ -struct vx_core *snd_vx_create(struct snd_card *card, struct snd_vx_hardware *hw, - struct snd_vx_ops *ops, int extra_size); +struct vx_core *snd_vx_create(struct snd_card *card, + const struct snd_vx_hardware *hw, + const struct snd_vx_ops *ops, int extra_size); int snd_vx_setup_firmware(struct vx_core *chip); int snd_vx_load_boot_image(struct vx_core *chip, const struct firmware *dsp); int snd_vx_dsp_boot(struct vx_core *chip, const struct firmware *dsp); diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c index 6bbc2a4f85c1..dd35de3f2434 100644 --- a/sound/drivers/vx/vx_core.c +++ b/sound/drivers/vx/vx_core.c @@ -765,8 +765,9 @@ EXPORT_SYMBOL(snd_vx_resume); * * return the instance pointer if successful, NULL in error. */ -struct vx_core *snd_vx_create(struct snd_card *card, struct snd_vx_hardware *hw, - struct snd_vx_ops *ops, +struct vx_core *snd_vx_create(struct snd_card *card, + const struct snd_vx_hardware *hw, + const struct snd_vx_ops *ops, int extra_size) { struct vx_core *chip; diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c index b278c72797d5..f7800ed1b67e 100644 --- a/sound/pci/vx222/vx222.c +++ b/sound/pci/vx222/vx222.c @@ -62,7 +62,7 @@ MODULE_DEVICE_TABLE(pci, snd_vx222_ids); static const DECLARE_TLV_DB_SCALE(db_scale_old_vol, -11350, 50, 0); static const DECLARE_TLV_DB_SCALE(db_scale_akm, -7350, 50, 0); -static struct snd_vx_hardware vx222_old_hw = { +static const struct snd_vx_hardware vx222_old_hw = { .name = "VX222/Old", .type = VX_TYPE_BOARD, @@ -74,7 +74,7 @@ static struct snd_vx_hardware vx222_old_hw = { .output_level_db_scale = db_scale_old_vol, }; -static struct snd_vx_hardware vx222_v2_hw = { +static const struct snd_vx_hardware vx222_v2_hw = { .name = "VX222/v2", .type = VX_TYPE_V2, @@ -86,7 +86,7 @@ static struct snd_vx_hardware vx222_v2_hw = { .output_level_db_scale = db_scale_akm, }; -static struct snd_vx_hardware vx222_mic_hw = { +static const struct snd_vx_hardware vx222_mic_hw = { .name = "VX222/Mic", .type = VX_TYPE_MIC, @@ -122,7 +122,7 @@ static int snd_vx222_dev_free(struct snd_device *device) static int snd_vx222_create(struct snd_card *card, struct pci_dev *pci, - struct snd_vx_hardware *hw, + const struct snd_vx_hardware *hw, struct snd_vx222 **rchip) { struct vx_core *chip; @@ -131,7 +131,7 @@ static int snd_vx222_create(struct snd_card *card, struct pci_dev *pci, static const struct snd_device_ops ops = { .dev_free = snd_vx222_dev_free, }; - struct snd_vx_ops *vx_ops; + const struct snd_vx_ops *vx_ops; /* enable PCI device */ if ((err = pci_enable_device(pci)) < 0) @@ -180,7 +180,7 @@ static int snd_vx222_probe(struct pci_dev *pci, { static int dev; struct snd_card *card; - struct snd_vx_hardware *hw; + const struct snd_vx_hardware *hw; struct snd_vx222 *vx; int err; diff --git a/sound/pci/vx222/vx222.h b/sound/pci/vx222/vx222.h index d27af637125c..46ddc6858a61 100644 --- a/sound/pci/vx222/vx222.h +++ b/sound/pci/vx222/vx222.h @@ -31,8 +31,8 @@ struct snd_vx222 { /* we use a lookup table with 148 values, see vx_mixer.c */ #define VX2_AKM_LEVEL_MAX 0x93 -extern struct snd_vx_ops vx222_ops; -extern struct snd_vx_ops vx222_old_ops; +extern const struct snd_vx_ops vx222_ops; +extern const struct snd_vx_ops vx222_old_ops; /* Offset of registers with base equal to portDSP. */ #define VX_RESET_DMA_REGISTER_OFFSET 0x00000008 diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c index c145951e2fc6..6245240d8768 100644 --- a/sound/pci/vx222/vx222_ops.c +++ b/sound/pci/vx222/vx222_ops.c @@ -984,7 +984,7 @@ static int vx2_add_mic_controls(struct vx_core *_chip) /* * callbacks */ -struct snd_vx_ops vx222_ops = { +const struct snd_vx_ops vx222_ops = { .in8 = vx2_inb, .in32 = vx2_inl, .out8 = vx2_outb, @@ -1004,7 +1004,7 @@ struct snd_vx_ops vx222_ops = { }; /* for old VX222 board */ -struct snd_vx_ops vx222_old_ops = { +const struct snd_vx_ops vx222_old_ops = { .in8 = vx2_inb, .in32 = vx2_inl, .out8 = vx2_outb, diff --git a/sound/pcmcia/vx/vxp_ops.c b/sound/pcmcia/vx/vxp_ops.c index 447c6342eec8..f7cf707d315f 100644 --- a/sound/pcmcia/vx/vxp_ops.c +++ b/sound/pcmcia/vx/vxp_ops.c @@ -581,7 +581,7 @@ static void vxp_reset_board(struct vx_core *_chip, int cold_reset) * callbacks */ /* exported */ -struct snd_vx_ops snd_vxpocket_ops = { +const struct snd_vx_ops snd_vxpocket_ops = { .in8 = vxp_inb, .out8 = vxp_outb, .test_and_ack = vxp_test_and_ack, diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index cad603ca0d93..afd30a90c807 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c @@ -82,7 +82,7 @@ static int snd_vxpocket_dev_free(struct snd_device *device) static const DECLARE_TLV_DB_SCALE(db_scale_old_vol, -11350, 50, 0); -static struct snd_vx_hardware vxpocket_hw = { +static const struct snd_vx_hardware vxpocket_hw = { .name = "VXPocket", .type = VX_TYPE_VXPOCKET, @@ -104,7 +104,7 @@ static struct snd_vx_hardware vxpocket_hw = { * UER, but only for the first two inputs and outputs. */ -static struct snd_vx_hardware vxp440_hw = { +static const struct snd_vx_hardware vxp440_hw = { .name = "VXPocket440", .type = VX_TYPE_VXP440, diff --git a/sound/pcmcia/vx/vxpocket.h b/sound/pcmcia/vx/vxpocket.h index 6dbd9f6bd2ff..bce616cc3aca 100644 --- a/sound/pcmcia/vx/vxpocket.h +++ b/sound/pcmcia/vx/vxpocket.h @@ -32,7 +32,7 @@ struct snd_vxpocket { #define to_vxpocket(x) container_of(x, struct snd_vxpocket, core) -extern struct snd_vx_ops snd_vxpocket_ops; +extern const struct snd_vx_ops snd_vxpocket_ops; void vx_set_mic_boost(struct vx_core *chip, int boost); void vx_set_mic_level(struct vx_core *chip, int level); From patchwork Fri Jan 3 08:16:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194002 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6F61C00523 for ; Fri, 3 Jan 2020 08:38:31 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 423CD2253D for ; Fri, 3 Jan 2020 08:38:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="SCDHu0xJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 423CD2253D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8E62716F4; Fri, 3 Jan 2020 09:37:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8E62716F4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040709; bh=eu6weXSOr97qIQt5rhiVQHFLC980dIbjNtbyUB5nVcM=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SCDHu0xJB4t6epGlIYy0MdK9P1UAYv8V/YCcodtrG6orLRCQJpoS86SVjzHOzDfE8 aoXX1DvtYQ5MGMGzwiC41JcwfHbBqs6yaY/+H1OYusMI+bfxV29d0MeIM2GkT1FTJO KGIjQmDspU+Bz0gfd7CnaS9P+wgSaC6NGWKwuBcM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D82DFF802F8; Fri, 3 Jan 2020 09:19:02 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5316CF802C2; Fri, 3 Jan 2020 09:18:19 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 4E411F8028A for ; Fri, 3 Jan 2020 09:17:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4E411F8028A X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 29FA8B273 for ; Fri, 3 Jan 2020 08:17:21 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:47 +0100 Message-Id: <20200103081714.9560-32-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 31/58] ALSA: mixer: oss: Constify snd_mixer_oss_assign_table definition X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The snd_mixer_oss_assign_table is read-only, and can it be declared as const. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/core/oss/mixer_oss.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index 7eb54df5556d..26502294f7d8 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c @@ -486,7 +486,7 @@ struct slot { unsigned int channels; unsigned int numid[SNDRV_MIXER_OSS_ITEM_COUNT]; unsigned int capture_item; - struct snd_mixer_oss_assign_table *assigned; + const struct snd_mixer_oss_assign_table *assigned; unsigned int allocated: 1; }; @@ -934,8 +934,8 @@ static void snd_mixer_oss_slot_free(struct snd_mixer_oss_slot *chn) struct slot *p = chn->private_data; if (p) { if (p->allocated && p->assigned) { - kfree(p->assigned->name); - kfree(p->assigned); + kfree_const(p->assigned->name); + kfree_const(p->assigned); } kfree(p); } @@ -953,7 +953,7 @@ static void mixer_slot_clear(struct snd_mixer_oss_slot *rslot) /* In a separate function to keep gcc 3.2 happy - do NOT merge this in snd_mixer_oss_build_input! */ static int snd_mixer_oss_build_test_all(struct snd_mixer_oss *mixer, - struct snd_mixer_oss_assign_table *ptr, + const struct snd_mixer_oss_assign_table *ptr, struct slot *slot) { char str[64]; @@ -1017,7 +1017,9 @@ static int snd_mixer_oss_build_test_all(struct snd_mixer_oss *mixer, * ptr_allocated means the entry is dynamically allocated (change via proc file). * when replace_old = 1, the old entry is replaced with the new one. */ -static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, struct snd_mixer_oss_assign_table *ptr, int ptr_allocated, int replace_old) +static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, + const struct snd_mixer_oss_assign_table *ptr, + int ptr_allocated, int replace_old) { struct slot slot; struct slot *pslot; @@ -1255,7 +1257,7 @@ static void snd_mixer_oss_proc_done(struct snd_mixer_oss *mixer) static void snd_mixer_oss_build(struct snd_mixer_oss *mixer) { - static struct snd_mixer_oss_assign_table table[] = { + static const struct snd_mixer_oss_assign_table table[] = { { SOUND_MIXER_VOLUME, "Master", 0 }, { SOUND_MIXER_VOLUME, "Front", 0 }, /* fallback */ { SOUND_MIXER_BASS, "Tone Control - Bass", 0 }, From patchwork Fri Jan 3 08:16:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194004 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38A04C00523 for ; Fri, 3 Jan 2020 08:36:00 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B72E02253D for ; Fri, 3 Jan 2020 08:35:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="abOu6PPF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B72E02253D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E728D1762; Fri, 3 Jan 2020 09:35:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E728D1762 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040558; bh=muqudHSv8MBs4fiqG8H5FWwdJRhgpG1V5/yNsZ1SVVw=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=abOu6PPFv+WGeADnhDghXgy/Pxd4aQSLF2WDUjMdkBRddo12f73dxEJtWnM1lTnAy 16Lz5S/A/h/SrpT2qpbQbvYRmWlsi3QT8Y1vblfNLCyQiSaL1c3KDV32z2Ba7841hs 03gofTVTOhsUVyYjlml0qTosOBqaQw+PDt+T0Kho= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1DED7F803CE; Fri, 3 Jan 2020 09:18:52 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EF1E3F8034E; Fri, 3 Jan 2020 09:18:11 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7F31BF80299 for ; Fri, 3 Jan 2020 09:17:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7F31BF80299 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 2CB39B274 for ; Fri, 3 Jan 2020 08:17:21 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:48 +0100 Message-Id: <20200103081714.9560-33-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 32/58] ALSA: aoa: Constify snd_kcontrol_new items X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Most of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/aoa/codecs/onyx.c | 2 +- sound/aoa/codecs/tas.c | 2 +- sound/aoa/fabrics/layout.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c index 83ab3e58a0d3..f85bc8a1e2a6 100644 --- a/sound/aoa/codecs/onyx.c +++ b/sound/aoa/codecs/onyx.c @@ -413,7 +413,7 @@ static int onyx_snd_single_bit_put(struct snd_kcontrol *kcontrol, } #define SINGLE_BIT(n, type, description, address, mask, flags) \ -static struct snd_kcontrol_new n##_control = { \ +static const struct snd_kcontrol_new n##_control = { \ .iface = SNDRV_CTL_ELEM_IFACE_##type, \ .name = description, \ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \ diff --git a/sound/aoa/codecs/tas.c b/sound/aoa/codecs/tas.c index c60b78367fc9..d3e37577b529 100644 --- a/sound/aoa/codecs/tas.c +++ b/sound/aoa/codecs/tas.c @@ -369,7 +369,7 @@ static int tas_snd_mixer_put(struct snd_kcontrol *kcontrol, } #define MIXER_CONTROL(n,descr,idx) \ -static struct snd_kcontrol_new n##_control = { \ +static const struct snd_kcontrol_new n##_control = { \ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ .name = descr " Playback Volume", \ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \ diff --git a/sound/aoa/fabrics/layout.c b/sound/aoa/fabrics/layout.c index 801b2f7699c2..d2e85b83f7ed 100644 --- a/sound/aoa/fabrics/layout.c +++ b/sound/aoa/fabrics/layout.c @@ -655,7 +655,7 @@ static int n##_control_put(struct snd_kcontrol *kcontrol, \ !!ucontrol->value.integer.value[0]); \ return 1; \ } \ -static struct snd_kcontrol_new n##_ctl = { \ +static const struct snd_kcontrol_new n##_ctl = { \ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \ .name = description, \ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, \ From patchwork Fri Jan 3 08:16:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 194000 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31E48C00523 for ; Fri, 3 Jan 2020 08:41:06 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B219921D7D for ; Fri, 3 Jan 2020 08:41:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="rogr1OrK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B219921D7D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 17A3D1779; Fri, 3 Jan 2020 09:40:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 17A3D1779 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040863; bh=2I42lxjs5llm+MomhDOsGczMpi7m+JULJcNZwc8N/v4=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rogr1OrKW3NnY0YJaHz7DAAE7oEAMCj13roiSYuQRawDSmCYCmS+yfnfV939MDKS0 ixkVO+7Hqr/RTk4cKFPpYDMecndpV4aWJ0pU4q0qXtog2dzFbidYNRlO1kULrnSTLp ADKFN6al1ochlfEx9hZ7F3c1iLaYQl8Tu79Bu6wQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 339BEF8042A; Fri, 3 Jan 2020 09:19:07 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E4DA4F8036D; Fri, 3 Jan 2020 09:18:22 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0BEC1F802A1 for ; Fri, 3 Jan 2020 09:17:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0BEC1F802A1 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4758FB276 for ; Fri, 3 Jan 2020 08:17:21 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:50 +0100 Message-Id: <20200103081714.9560-35-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 34/58] ALSA: i2c: Constify snd_kcontrol_new items X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Most of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/i2c/cs8427.c | 2 +- sound/i2c/other/ak4113.c | 2 +- sound/i2c/other/ak4114.c | 2 +- sound/i2c/other/ak4117.c | 2 +- sound/i2c/tea6330t.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/i2c/cs8427.c b/sound/i2c/cs8427.c index bac4f0036cd6..8634d4f466b3 100644 --- a/sound/i2c/cs8427.c +++ b/sound/i2c/cs8427.c @@ -459,7 +459,7 @@ static int snd_cs8427_spdif_mask_get(struct snd_kcontrol *kcontrol, return 0; } -static struct snd_kcontrol_new snd_cs8427_iec958_controls[] = { +static const struct snd_kcontrol_new snd_cs8427_iec958_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .info = snd_cs8427_in_status_info, diff --git a/sound/i2c/other/ak4113.c b/sound/i2c/other/ak4113.c index 2700a8470388..e7213092eb4f 100644 --- a/sound/i2c/other/ak4113.c +++ b/sound/i2c/other/ak4113.c @@ -349,7 +349,7 @@ static int snd_ak4113_spdif_qget(struct snd_kcontrol *kcontrol, } /* Don't forget to change AK4113_CONTROLS define!!! */ -static struct snd_kcontrol_new snd_ak4113_iec958_controls[] = { +static const struct snd_kcontrol_new snd_ak4113_iec958_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = "IEC958 Parity Errors", diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c index e7325af8af5b..2ce0a97957ab 100644 --- a/sound/i2c/other/ak4114.c +++ b/sound/i2c/other/ak4114.c @@ -318,7 +318,7 @@ static int snd_ak4114_spdif_qget(struct snd_kcontrol *kcontrol, } /* Don't forget to change AK4114_CONTROLS define!!! */ -static struct snd_kcontrol_new snd_ak4114_iec958_controls[] = { +static const struct snd_kcontrol_new snd_ak4114_iec958_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = "IEC958 Parity Errors", diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c index 0d9e8252cc27..905be2d0780b 100644 --- a/sound/i2c/other/ak4117.c +++ b/sound/i2c/other/ak4117.c @@ -305,7 +305,7 @@ static int snd_ak4117_spdif_qget(struct snd_kcontrol *kcontrol, } /* Don't forget to change AK4117_CONTROLS define!!! */ -static struct snd_kcontrol_new snd_ak4117_iec958_controls[] = { +static const struct snd_kcontrol_new snd_ak4117_iec958_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = "IEC958 Parity Errors", diff --git a/sound/i2c/tea6330t.c b/sound/i2c/tea6330t.c index 93ca8bb71f54..08eb6a873768 100644 --- a/sound/i2c/tea6330t.c +++ b/sound/i2c/tea6330t.c @@ -260,7 +260,7 @@ static int snd_tea6330t_put_treble(struct snd_kcontrol *kcontrol, return change; } -static struct snd_kcontrol_new snd_tea6330t_controls[] = { +static const struct snd_kcontrol_new snd_tea6330t_controls[] = { TEA6330T_MASTER_SWITCH("Master Playback Switch", 0), TEA6330T_MASTER_VOLUME("Master Playback Volume", 0), TEA6330T_BASS("Tone Control - Bass", 0), @@ -278,7 +278,7 @@ int snd_tea6330t_update_mixer(struct snd_card *card, { struct snd_i2c_device *device; struct tea6330t *tea; - struct snd_kcontrol_new *knew; + const struct snd_kcontrol_new *knew; unsigned int idx; int err = -ENOMEM; u8 default_treble, default_bass; From patchwork Fri Jan 3 08:16:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193998 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 139CCC00523 for ; Fri, 3 Jan 2020 08:44:00 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9402821D7D for ; Fri, 3 Jan 2020 08:43:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="cQtwZ3RJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9402821D7D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E09371753; Fri, 3 Jan 2020 09:43:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E09371753 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041038; bh=V6y9fYAUN6Y9DFms3qS9tUkTnYA9M4TjwdmNwHGcC60=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=cQtwZ3RJxWOVPT1lDc/2SykgaQhvMSmaKLt+ZGmME5Op9K4WVhvIc6Zyqh1raGZzz afmhDBfaKSTwEN/C07GpUvxwhZMvemwDTZk0AOYAbU7dsiBLE5XEpKadrvEu5qeYYO vD8/fAkzZyOMUtzhCdE0Gy082gTXuClMs1844MF8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 89E8DF80472; Fri, 3 Jan 2020 09:19:12 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7593AF80384; Fri, 3 Jan 2020 09:18:33 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6DAB5F802A7 for ; Fri, 3 Jan 2020 09:17:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6DAB5F802A7 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5850AB277 for ; Fri, 3 Jan 2020 08:17:21 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:51 +0100 Message-Id: <20200103081714.9560-36-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 35/58] ALSA: isa: Constify snd_kcontrol_new items X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Most of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/isa/ad1816a/ad1816a_lib.c | 2 +- sound/isa/cmi8330.c | 2 +- sound/isa/cs423x/cs4236_lib.c | 14 +++++++------- sound/isa/es1688/es1688_lib.c | 2 +- sound/isa/es18xx.c | 26 +++++++++++++------------- sound/isa/gus/gus_mixer.c | 4 ++-- sound/isa/msnd/msnd_pinnacle_mixer.c | 2 +- sound/isa/opl3sa2.c | 4 ++-- sound/isa/opti9xx/miro.c | 14 +++++++------- sound/isa/opti9xx/opti92x-ad1848.c | 2 +- sound/isa/sb/emu8000.c | 14 +++++++------- sound/isa/sb/sb_mixer.c | 2 +- sound/isa/wss/wss_lib.c | 2 +- 13 files changed, 45 insertions(+), 45 deletions(-) diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c index 560885fbc983..01381fe7c0c9 100644 --- a/sound/isa/ad1816a/ad1816a_lib.c +++ b/sound/isa/ad1816a/ad1816a_lib.c @@ -884,7 +884,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_6bit, -9450, 150, 0); static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0); static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0); -static struct snd_kcontrol_new snd_ad1816a_controls[] = { +static const struct snd_kcontrol_new snd_ad1816a_controls[] = { AD1816A_DOUBLE("Master Playback Switch", AD1816A_MASTER_ATT, 15, 7, 1, 1), AD1816A_DOUBLE_TLV("Master Playback Volume", AD1816A_MASTER_ATT, 8, 0, 31, 1, db_scale_5bit), diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index f8ec59a5bb8f..61d6944a69c7 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c @@ -179,7 +179,7 @@ MODULE_DEVICE_TABLE(pnp_card, snd_cmi8330_pnpids); #endif -static struct snd_kcontrol_new snd_cmi8330_controls[] = { +static const struct snd_kcontrol_new snd_cmi8330_controls[] = { WSS_DOUBLE("Master Playback Volume", 0, CMI8330_MASTVOL, CMI8330_MASTVOL, 4, 0, 15, 0), WSS_SINGLE("Loud Playback Switch", 0, diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c index be48c60355d0..ca6646f9b58d 100644 --- a/sound/isa/cs423x/cs4236_lib.c +++ b/sound/isa/cs423x/cs4236_lib.c @@ -758,7 +758,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_4bit, -4500, 300, 0); static const DECLARE_TLV_DB_SCALE(db_scale_2bit, -1800, 600, 0); static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0); -static struct snd_kcontrol_new snd_cs4236_controls[] = { +static const struct snd_kcontrol_new snd_cs4236_controls[] = { CS4236_DOUBLE("Master Digital Playback Switch", 0, CS4236_LEFT_MASTER, CS4236_RIGHT_MASTER, 7, 7, 1, 1), @@ -853,7 +853,7 @@ CS4236_DOUBLE1_TLV("Loopback Digital Playback Volume", 0, static const DECLARE_TLV_DB_SCALE(db_scale_5bit_6db_max, -5600, 200, 0); static const DECLARE_TLV_DB_SCALE(db_scale_2bit_16db_max, -2400, 800, 0); -static struct snd_kcontrol_new snd_cs4235_controls[] = { +static const struct snd_kcontrol_new snd_cs4235_controls[] = { WSS_DOUBLE("Master Playback Switch", 0, CS4235_LEFT_MASTER, CS4235_RIGHT_MASTER, 7, 7, 1, 1), @@ -986,7 +986,7 @@ static int snd_cs4236_put_iec958_switch(struct snd_kcontrol *kcontrol, struct sn return change; } -static struct snd_kcontrol_new snd_cs4236_iec958_controls[] = { +static const struct snd_kcontrol_new snd_cs4236_iec958_controls[] = { CS4236_IEC958_ENABLE("IEC958 Output Enable", 0), CS4236_SINGLEC("IEC958 Output Validity", 0, 4, 4, 1, 0), CS4236_SINGLEC("IEC958 Output User", 0, 4, 5, 1, 0), @@ -995,12 +995,12 @@ CS4236_SINGLEC("IEC958 Output Channel Status Low", 0, 5, 1, 127, 0), CS4236_SINGLEC("IEC958 Output Channel Status High", 0, 6, 0, 255, 0) }; -static struct snd_kcontrol_new snd_cs4236_3d_controls_cs4235[] = { +static const struct snd_kcontrol_new snd_cs4236_3d_controls_cs4235[] = { CS4236_SINGLEC("3D Control - Switch", 0, 3, 4, 1, 0), CS4236_SINGLEC("3D Control - Space", 0, 2, 4, 15, 1) }; -static struct snd_kcontrol_new snd_cs4236_3d_controls_cs4237[] = { +static const struct snd_kcontrol_new snd_cs4236_3d_controls_cs4237[] = { CS4236_SINGLEC("3D Control - Switch", 0, 3, 7, 1, 0), CS4236_SINGLEC("3D Control - Space", 0, 2, 4, 15, 1), CS4236_SINGLEC("3D Control - Center", 0, 2, 0, 15, 1), @@ -1008,7 +1008,7 @@ CS4236_SINGLEC("3D Control - Mono", 0, 3, 6, 1, 0), CS4236_SINGLEC("3D Control - IEC958", 0, 3, 5, 1, 0) }; -static struct snd_kcontrol_new snd_cs4236_3d_controls_cs4238[] = { +static const struct snd_kcontrol_new snd_cs4236_3d_controls_cs4238[] = { CS4236_SINGLEC("3D Control - Switch", 0, 3, 4, 1, 0), CS4236_SINGLEC("3D Control - Space", 0, 2, 4, 15, 1), CS4236_SINGLEC("3D Control - Volume", 0, 2, 0, 15, 1), @@ -1020,7 +1020,7 @@ int snd_cs4236_mixer(struct snd_wss *chip) struct snd_card *card; unsigned int idx, count; int err; - struct snd_kcontrol_new *kcontrol; + const struct snd_kcontrol_new *kcontrol; if (snd_BUG_ON(!chip || !chip->card)) return -EINVAL; diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c index 99a833f29544..1568d0bfd1a8 100644 --- a/sound/isa/es1688/es1688_lib.c +++ b/sound/isa/es1688/es1688_lib.c @@ -924,7 +924,7 @@ static int snd_es1688_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_e return change; } -static struct snd_kcontrol_new snd_es1688_controls[] = { +static const struct snd_kcontrol_new snd_es1688_controls[] = { ES1688_DOUBLE("Master Playback Volume", 0, ES1688_MASTER_DEV, ES1688_MASTER_DEV, 4, 0, 15, 0), ES1688_DOUBLE("PCM Playback Volume", 0, ES1688_PCM_DEV, ES1688_PCM_DEV, 4, 0, 15, 0), ES1688_DOUBLE("Line Playback Volume", 0, ES1688_LINE_DEV, ES1688_LINE_DEV, 4, 0, 15, 0), diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index f9cd05d2b3bd..6ce5b5c76980 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c @@ -1246,7 +1246,7 @@ static int snd_es18xx_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_e * The controls that are universal to all chipsets are fully initialized * here. */ -static struct snd_kcontrol_new snd_es18xx_base_controls[] = { +static const struct snd_kcontrol_new snd_es18xx_base_controls[] = { ES18XX_DOUBLE("Master Playback Volume", 0, 0x60, 0x62, 0, 0, 63, 0), ES18XX_DOUBLE("Master Playback Switch", 0, 0x60, 0x62, 6, 6, 1, 1), ES18XX_DOUBLE("Line Playback Volume", 0, 0x3e, 0x3e, 4, 0, 15, 0), @@ -1265,7 +1265,7 @@ ES18XX_DOUBLE("Capture Volume", 0, 0xb4, 0xb4, 4, 0, 15, 0), } }; -static struct snd_kcontrol_new snd_es18xx_recmix_controls[] = { +static const struct snd_kcontrol_new snd_es18xx_recmix_controls[] = { ES18XX_DOUBLE("PCM Capture Volume", 0, 0x69, 0x69, 4, 0, 15, 0), ES18XX_DOUBLE("Mic Capture Volume", 0, 0x68, 0x68, 4, 0, 15, 0), ES18XX_DOUBLE("Line Capture Volume", 0, 0x6e, 0x6e, 4, 0, 15, 0), @@ -1277,35 +1277,35 @@ ES18XX_DOUBLE("Aux Capture Volume", 0, 0x6c, 0x6c, 4, 0, 15, 0) /* * The chipset specific mixer controls */ -static struct snd_kcontrol_new snd_es18xx_opt_speaker = +static const struct snd_kcontrol_new snd_es18xx_opt_speaker = ES18XX_SINGLE("Beep Playback Volume", 0, 0x3c, 0, 7, 0); -static struct snd_kcontrol_new snd_es18xx_opt_1869[] = { +static const struct snd_kcontrol_new snd_es18xx_opt_1869[] = { ES18XX_SINGLE("Capture Switch", 0, 0x1c, 4, 1, ES18XX_FL_INVERT), ES18XX_SINGLE("Video Playback Switch", 0, 0x7f, 0, 1, 0), ES18XX_DOUBLE("Mono Playback Volume", 0, 0x6d, 0x6d, 4, 0, 15, 0), ES18XX_DOUBLE("Mono Capture Volume", 0, 0x6f, 0x6f, 4, 0, 15, 0) }; -static struct snd_kcontrol_new snd_es18xx_opt_1878 = +static const struct snd_kcontrol_new snd_es18xx_opt_1878 = ES18XX_DOUBLE("Video Playback Volume", 0, 0x68, 0x68, 4, 0, 15, 0); -static struct snd_kcontrol_new snd_es18xx_opt_1879[] = { +static const struct snd_kcontrol_new snd_es18xx_opt_1879[] = { ES18XX_SINGLE("Video Playback Switch", 0, 0x71, 6, 1, 0), ES18XX_DOUBLE("Video Playback Volume", 0, 0x6d, 0x6d, 4, 0, 15, 0), ES18XX_DOUBLE("Video Capture Volume", 0, 0x6f, 0x6f, 4, 0, 15, 0) }; -static struct snd_kcontrol_new snd_es18xx_pcm1_controls[] = { +static const struct snd_kcontrol_new snd_es18xx_pcm1_controls[] = { ES18XX_DOUBLE("PCM Playback Volume", 0, 0x14, 0x14, 4, 0, 15, 0), }; -static struct snd_kcontrol_new snd_es18xx_pcm2_controls[] = { +static const struct snd_kcontrol_new snd_es18xx_pcm2_controls[] = { ES18XX_DOUBLE("PCM Playback Volume", 0, 0x7c, 0x7c, 4, 0, 15, 0), ES18XX_DOUBLE("PCM Playback Volume", 1, 0x14, 0x14, 4, 0, 15, 0) }; -static struct snd_kcontrol_new snd_es18xx_spatializer_controls[] = { +static const struct snd_kcontrol_new snd_es18xx_spatializer_controls[] = { ES18XX_SINGLE("3D Control - Level", 0, 0x52, 0, 63, 0), { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, @@ -1316,13 +1316,13 @@ ES18XX_SINGLE("3D Control - Level", 0, 0x52, 0, 63, 0), } }; -static struct snd_kcontrol_new snd_es18xx_micpre1_control = +static const struct snd_kcontrol_new snd_es18xx_micpre1_control = ES18XX_SINGLE("Mic Boost (+26dB)", 0, 0xa9, 2, 1, 0); -static struct snd_kcontrol_new snd_es18xx_micpre2_control = +static const struct snd_kcontrol_new snd_es18xx_micpre2_control = ES18XX_SINGLE("Mic Boost (+26dB)", 0, 0x7d, 3, 1, 0); -static struct snd_kcontrol_new snd_es18xx_hw_volume_controls[] = { +static const struct snd_kcontrol_new snd_es18xx_hw_volume_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Hardware Master Playback Volume", @@ -1340,7 +1340,7 @@ static struct snd_kcontrol_new snd_es18xx_hw_volume_controls[] = { ES18XX_SINGLE("Hardware Master Volume Split", 0, 0x64, 7, 1, 0), }; -static struct snd_kcontrol_new snd_es18xx_opt_gpo_2bit[] = { +static const struct snd_kcontrol_new snd_es18xx_opt_gpo_2bit[] = { ES18XX_SINGLE("GPO0 Switch", 0, ES18XX_PM, 0, 1, ES18XX_FL_PMPORT), ES18XX_SINGLE("GPO1 Switch", 0, ES18XX_PM, 1, 1, ES18XX_FL_PMPORT), }; diff --git a/sound/isa/gus/gus_mixer.c b/sound/isa/gus/gus_mixer.c index 94e0c75ee417..201d0c40d0d9 100644 --- a/sound/isa/gus/gus_mixer.c +++ b/sound/isa/gus/gus_mixer.c @@ -120,13 +120,13 @@ static int snd_ics_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem return change; } -static struct snd_kcontrol_new snd_gf1_controls[] = { +static const struct snd_kcontrol_new snd_gf1_controls[] = { GF1_SINGLE("Master Playback Switch", 0, 1, 1), GF1_SINGLE("Line Switch", 0, 0, 1), GF1_SINGLE("Mic Switch", 0, 2, 0) }; -static struct snd_kcontrol_new snd_ics_controls[] = { +static const struct snd_kcontrol_new snd_ics_controls[] = { GF1_SINGLE("Master Playback Switch", 0, 1, 1), ICS_DOUBLE("Master Playback Volume", 0, SNDRV_ICS_MASTER_DEV), ICS_DOUBLE("Synth Playback Volume", 0, SNDRV_ICS_GF1_DEV), diff --git a/sound/isa/msnd/msnd_pinnacle_mixer.c b/sound/isa/msnd/msnd_pinnacle_mixer.c index d0770e2aedca..02c566fca9e5 100644 --- a/sound/isa/msnd/msnd_pinnacle_mixer.c +++ b/sound/isa/msnd/msnd_pinnacle_mixer.c @@ -275,7 +275,7 @@ static int snd_msndmix_volume_put(struct snd_kcontrol *kcontrol, .private_value = addr } -static struct snd_kcontrol_new snd_msnd_controls[] = { +static const struct snd_kcontrol_new snd_msnd_controls[] = { DUMMY_VOLUME("Master Volume", 0, MSND_MIXER_VOLUME), DUMMY_VOLUME("PCM Volume", 0, MSND_MIXER_PCM), DUMMY_VOLUME("Aux Volume", 0, MSND_MIXER_AUX), diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 6d19ab458291..85a181acd388 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c @@ -457,7 +457,7 @@ static int snd_opl3sa2_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_ static const DECLARE_TLV_DB_SCALE(db_scale_master, -3000, 200, 0); static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0); -static struct snd_kcontrol_new snd_opl3sa2_controls[] = { +static const struct snd_kcontrol_new snd_opl3sa2_controls[] = { OPL3SA2_DOUBLE("Master Playback Switch", 0, 0x07, 0x08, 7, 7, 1, 1), OPL3SA2_DOUBLE_TLV("Master Playback Volume", 0, 0x07, 0x08, 0, 0, 15, 1, db_scale_master), @@ -467,7 +467,7 @@ OPL3SA2_SINGLE_TLV("Mic Playback Volume", 0, 0x09, 0, 31, 1, OPL3SA2_SINGLE("ZV Port Switch", 0, 0x02, 0, 1, 0), }; -static struct snd_kcontrol_new snd_opl3sa2_tone_controls[] = { +static const struct snd_kcontrol_new snd_opl3sa2_tone_controls[] = { OPL3SA2_DOUBLE("3D Control - Wide", 0, 0x14, 0x14, 4, 0, 7, 0), OPL3SA2_DOUBLE("Tone Control - Bass", 0, 0x15, 0x15, 4, 0, 7, 0), OPL3SA2_DOUBLE("Tone Control - Treble", 0, 0x16, 0x16, 4, 0, 7, 0) diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c index 0458934de1c7..a9c773b9f471 100644 --- a/sound/isa/opti9xx/miro.c +++ b/sound/isa/opti9xx/miro.c @@ -577,7 +577,7 @@ static int snd_miro_put_double(struct snd_kcontrol *kcontrol, return change; } -static struct snd_kcontrol_new snd_miro_controls[] = { +static const struct snd_kcontrol_new snd_miro_controls[] = { MIRO_DOUBLE("Master Playback Volume", 0, ACI_GET_MASTER, ACI_SET_MASTER), MIRO_DOUBLE("Mic Playback Volume", 1, ACI_GET_MIC, ACI_SET_MIC), MIRO_DOUBLE("Line Playback Volume", 1, ACI_GET_LINE, ACI_SET_LINE), @@ -589,7 +589,7 @@ MIRO_DOUBLE("Aux Playback Volume", 2, ACI_GET_LINE2, ACI_SET_LINE2), /* Equalizer with seven bands (only PCM20) from -12dB up to +12dB on each band */ -static struct snd_kcontrol_new snd_miro_eq_controls[] = { +static const struct snd_kcontrol_new snd_miro_eq_controls[] = { MIRO_DOUBLE("Tone Control - 28 Hz", 0, ACI_GET_EQ1, ACI_SET_EQ1), MIRO_DOUBLE("Tone Control - 160 Hz", 0, ACI_GET_EQ2, ACI_SET_EQ2), MIRO_DOUBLE("Tone Control - 400 Hz", 0, ACI_GET_EQ3, ACI_SET_EQ3), @@ -599,15 +599,15 @@ MIRO_DOUBLE("Tone Control - 6.3 kHz", 0, ACI_GET_EQ6, ACI_SET_EQ6), MIRO_DOUBLE("Tone Control - 16 kHz", 0, ACI_GET_EQ7, ACI_SET_EQ7), }; -static struct snd_kcontrol_new snd_miro_radio_control[] = { +static const struct snd_kcontrol_new snd_miro_radio_control[] = { MIRO_DOUBLE("Radio Playback Volume", 0, ACI_GET_LINE1, ACI_SET_LINE1), }; -static struct snd_kcontrol_new snd_miro_line_control[] = { +static const struct snd_kcontrol_new snd_miro_line_control[] = { MIRO_DOUBLE("Line Playback Volume", 2, ACI_GET_LINE1, ACI_SET_LINE1), }; -static struct snd_kcontrol_new snd_miro_preamp_control[] = { +static const struct snd_kcontrol_new snd_miro_preamp_control[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Mic Boost", @@ -617,7 +617,7 @@ static struct snd_kcontrol_new snd_miro_preamp_control[] = { .put = snd_miro_put_preamp, }}; -static struct snd_kcontrol_new snd_miro_amp_control[] = { +static const struct snd_kcontrol_new snd_miro_amp_control[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Line Boost", @@ -627,7 +627,7 @@ static struct snd_kcontrol_new snd_miro_amp_control[] = { .put = snd_miro_put_amp, }}; -static struct snd_kcontrol_new snd_miro_capture_control[] = { +static const struct snd_kcontrol_new snd_miro_capture_control[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "PCM Capture Switch", diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index b40ab806c349..697576459f71 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c @@ -550,7 +550,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_5bit_3db_step, -9300, 300, 0); static const DECLARE_TLV_DB_SCALE(db_scale_5bit, -4650, 150, 0); static const DECLARE_TLV_DB_SCALE(db_scale_4bit_12db_max, -3300, 300, 0); -static struct snd_kcontrol_new snd_opti93x_controls[] = { +static const struct snd_kcontrol_new snd_opti93x_controls[] = { WSS_DOUBLE("Master Playback Switch", 0, OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1), WSS_DOUBLE_TLV("Master Playback Volume", 0, diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c index bc47e8e51523..455dd5fa3ccb 100644 --- a/sound/isa/sb/emu8000.c +++ b/sound/isa/sb/emu8000.c @@ -855,7 +855,7 @@ static int mixer_bass_treble_put(struct snd_kcontrol *kcontrol, struct snd_ctl_e return change; } -static struct snd_kcontrol_new mixer_bass_control = +static const struct snd_kcontrol_new mixer_bass_control = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Synth Tone Control - Bass", @@ -865,7 +865,7 @@ static struct snd_kcontrol_new mixer_bass_control = .private_value = 0, }; -static struct snd_kcontrol_new mixer_treble_control = +static const struct snd_kcontrol_new mixer_treble_control = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Synth Tone Control - Treble", @@ -922,7 +922,7 @@ static int mixer_chorus_reverb_put(struct snd_kcontrol *kcontrol, struct snd_ctl return change; } -static struct snd_kcontrol_new mixer_chorus_mode_control = +static const struct snd_kcontrol_new mixer_chorus_mode_control = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Chorus Mode", @@ -932,7 +932,7 @@ static struct snd_kcontrol_new mixer_chorus_mode_control = .private_value = 1, }; -static struct snd_kcontrol_new mixer_reverb_mode_control = +static const struct snd_kcontrol_new mixer_reverb_mode_control = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Reverb Mode", @@ -984,7 +984,7 @@ static int mixer_fm_depth_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem return change; } -static struct snd_kcontrol_new mixer_fm_chorus_depth_control = +static const struct snd_kcontrol_new mixer_fm_chorus_depth_control = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "FM Chorus Depth", @@ -994,7 +994,7 @@ static struct snd_kcontrol_new mixer_fm_chorus_depth_control = .private_value = 1, }; -static struct snd_kcontrol_new mixer_fm_reverb_depth_control = +static const struct snd_kcontrol_new mixer_fm_reverb_depth_control = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "FM Reverb Depth", @@ -1005,7 +1005,7 @@ static struct snd_kcontrol_new mixer_fm_reverb_depth_control = }; -static struct snd_kcontrol_new *mixer_defs[EMU8000_NUM_CONTROLS] = { +static const struct snd_kcontrol_new *mixer_defs[EMU8000_NUM_CONTROLS] = { &mixer_bass_control, &mixer_treble_control, &mixer_chorus_mode_control, diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c index bd65ef0412a6..789dcf279a26 100644 --- a/sound/isa/sb/sb_mixer.c +++ b/sound/isa/sb/sb_mixer.c @@ -438,7 +438,7 @@ static int snd_sb16mixer_put_input_sw(struct snd_kcontrol *kcontrol, struct snd_ */ int snd_sbmixer_add_ctl(struct snd_sb *chip, const char *name, int index, int type, unsigned long value) { - static struct snd_kcontrol_new newctls[] = { + static const struct snd_kcontrol_new newctls[] = { [SB_MIX_SINGLE] = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .info = snd_sbmixer_info_single, diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c index 0d019b238399..d37f4642162a 100644 --- a/sound/isa/wss/wss_lib.c +++ b/sound/isa/wss/wss_lib.c @@ -2157,7 +2157,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0); static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0); static const DECLARE_TLV_DB_SCALE(db_scale_4bit, -4500, 300, 0); -static struct snd_kcontrol_new snd_wss_controls[] = { +static const struct snd_kcontrol_new snd_wss_controls[] = { WSS_DOUBLE("PCM Playback Switch", 0, CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1), WSS_DOUBLE_TLV("PCM Playback Volume", 0, From patchwork Fri Jan 3 08:16:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193999 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 123B8C00523 for ; Fri, 3 Jan 2020 08:42:24 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9275D21D7D for ; Fri, 3 Jan 2020 08:42:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="SjsNMrGE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9275D21D7D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C25AF177F; Fri, 3 Jan 2020 09:41:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C25AF177F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040941; bh=2jEnE52DpJJn0Nyf/XgIhGS/eQAfRYdiZd0fd41vNqY=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SjsNMrGEWcm23ZxP8PglPGvbiExAvTBg67egoLMxfnZw2H69LrCejjuSO82o+w2Tf hkrpb9xc7nDvwoW4tvjirYOrh0enQM7dNwXsTzq1xPk2kU3RLteopHOCjBhwF5vBAr qdeAY06ZrOTLFkvQqqvaYRA3uWb0Gp2PbYZzb2us= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E59A7F80443; Fri, 3 Jan 2020 09:19:08 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 879B4F80377; Fri, 3 Jan 2020 09:18:28 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2B6C3F802A0 for ; Fri, 3 Jan 2020 09:17:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2B6C3F802A0 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8C03DB27C for ; Fri, 3 Jan 2020 08:17:21 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:55 +0100 Message-Id: <20200103081714.9560-40-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 39/58] ALSA: sparc: Constify snd_kcontrol_new items X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Most of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/sparc/amd7930.c | 2 +- sound/sparc/cs4231.c | 2 +- sound/sparc/dbri.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c index 916bed46be06..9d0da5fa1c70 100644 --- a/sound/sparc/amd7930.c +++ b/sound/sparc/amd7930.c @@ -837,7 +837,7 @@ static int snd_amd7930_put_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem return change; } -static struct snd_kcontrol_new amd7930_controls[] = { +static const struct snd_kcontrol_new amd7930_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Monitor Volume", diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index b0e5b4a83a26..59f812b5ce59 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c @@ -1479,7 +1479,7 @@ static int snd_cs4231_put_double(struct snd_kcontrol *kcontrol, .private_value = (left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | \ ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22) } -static struct snd_kcontrol_new snd_cs4231_controls[] = { +static const struct snd_kcontrol_new snd_cs4231_controls[] = { CS4231_DOUBLE("PCM Playback Switch", 0, CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1), CS4231_DOUBLE("PCM Playback Volume", 0, CS4231_LEFT_OUTPUT, diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index 1390a52d6cfd..aaa1493b9ef9 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c @@ -2410,7 +2410,7 @@ static int snd_cs4215_put_single(struct snd_kcontrol *kcontrol, .private_value = (entry) | ((shift) << 8) | ((mask) << 16) | \ ((invert) << 24) }, -static struct snd_kcontrol_new dbri_controls[] = { +static const struct snd_kcontrol_new dbri_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Playback Volume", From patchwork Fri Jan 3 08:16:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193997 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED8BFC00523 for ; Fri, 3 Jan 2020 08:45:11 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 78D42227BF for ; Fri, 3 Jan 2020 08:45:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="WkveBL8N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78D42227BF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BB3B41791; Fri, 3 Jan 2020 09:44:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BB3B41791 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041109; bh=UfhGBpnngWUTkupXm/cBKMOknE86nkAa/Kf1E4TrM/A=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WkveBL8NVDLCJewGqsCMiKsOBHrbm9CPebeFfKJweaAVYWhkyDMui3jo0yilQ6yZU PCBVe0Ku6P8rYpNNymPgP5zmkQD7GYCznHMGs1SCUM7N7mddu/Xd6eU42XVJVjtya8 /dBLgvcMHEvT9u5OMcAjoRQJAohxFGmo6BwDHv7o= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 98E38F8047E; Fri, 3 Jan 2020 09:19:14 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 36346F8038D; Fri, 3 Jan 2020 09:18:37 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2C060F802BE for ; Fri, 3 Jan 2020 09:17:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2C060F802BE X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B331FB27E for ; Fri, 3 Jan 2020 08:17:21 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:58 +0100 Message-Id: <20200103081714.9560-43-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 42/58] ALSA: parisc: Constify snd_kcontrol_new items X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Most of snd_kcontrol_new definitions are read-only and passed as-is. Let's declare them as const for further optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/parisc/harmony.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/parisc/harmony.c b/sound/parisc/harmony.c index d330f22a3e8f..97241d984c6c 100644 --- a/sound/parisc/harmony.c +++ b/sound/parisc/harmony.c @@ -797,7 +797,7 @@ snd_harmony_captureroute_put(struct snd_kcontrol *kc, .private_value = ((left_shift) | ((right_shift) << 8) | \ ((mask) << 16) | ((invert) << 24)) } -static struct snd_kcontrol_new snd_harmony_controls[] = { +static const struct snd_kcontrol_new snd_harmony_controls[] = { HARMONY_VOLUME("Master Playback Volume", HARMONY_GAIN_LO_SHIFT, HARMONY_GAIN_RO_SHIFT, HARMONY_GAIN_OUT, 1), HARMONY_VOLUME("Capture Volume", HARMONY_GAIN_LI_SHIFT, From patchwork Fri Jan 3 08:16:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193996 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8396C00523 for ; Fri, 3 Jan 2020 08:46:52 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 335FC21D7D for ; Fri, 3 Jan 2020 08:46:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="XJNj4s0r" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 335FC21D7D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 578AA178C; Fri, 3 Jan 2020 09:46:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 578AA178C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041210; bh=s3v/DO1zoB/OcCbS+8BpdVu9fveFBKl+V/5COFGs5/k=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XJNj4s0rEZRvHBX7Z6B3NYrg7nqPfGMa82yG38KpQ7cTLsmdPbbgALgVoO1dv2Xqh djHORQTcry5ui5RS0PxbXvV+EsQoAMxkJTI/qZVh5WSfqUbmytR6N5183ccOZzDXBN vz8KGzEmF7lecqPZlVtHh6jhkM8+J77GbLiwUuVU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8B8CFF804B2; Fri, 3 Jan 2020 09:19:18 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 700F1F80393; Fri, 3 Jan 2020 09:18:41 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 470B7F802BD for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 470B7F802BD X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B7052B280 for ; Fri, 3 Jan 2020 08:17:21 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:16:59 +0100 Message-Id: <20200103081714.9560-44-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 43/58] ALSA: dummy: Constify snd_pcm_ops definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The snd_pcm_ops items defined in snd-dummy driver can be gracefully declared as const. Let's mark them for further optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/drivers/dummy.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index cec682a7b88d..46fa60e7f722 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -644,7 +644,7 @@ static struct page *dummy_pcm_page(struct snd_pcm_substream *substream, return virt_to_page(dummy_page[substream->stream]); /* the same page */ } -static struct snd_pcm_ops dummy_pcm_ops = { +static const struct snd_pcm_ops dummy_pcm_ops = { .open = dummy_pcm_open, .close = dummy_pcm_close, .hw_params = dummy_pcm_hw_params, @@ -653,7 +653,7 @@ static struct snd_pcm_ops dummy_pcm_ops = { .pointer = dummy_pcm_pointer, }; -static struct snd_pcm_ops dummy_pcm_ops_no_buf = { +static const struct snd_pcm_ops dummy_pcm_ops_no_buf = { .open = dummy_pcm_open, .close = dummy_pcm_close, .hw_params = dummy_pcm_hw_params, @@ -670,7 +670,7 @@ static int snd_card_dummy_pcm(struct snd_dummy *dummy, int device, int substreams) { struct snd_pcm *pcm; - struct snd_pcm_ops *ops; + const struct snd_pcm_ops *ops; int err; err = snd_pcm_new(dummy->card, "Dummy PCM", device, From patchwork Fri Jan 3 08:17:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193995 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 080A3C00523 for ; Fri, 3 Jan 2020 08:48:02 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D2D821734 for ; Fri, 3 Jan 2020 08:48:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="KJopQfTw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D2D821734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CC0A117A3; Fri, 3 Jan 2020 09:47:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CC0A117A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041279; bh=MomDSQ2hMVcteCxp3WbM30zPZhbfyqHHJCgIjKQV6u8=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=KJopQfTwIItAcMzWOYxs5iBjSNsFFi1a7agiq+tpUh6WoB8tqyAacz8ig97XeRpqB Rs3okPb6Yqy8HbIsLpmUXw7VJUKba02R8SnjDEf8M3R3fPrl+b9KI0Hgdd/Xh5+Eiv OwA8zCgbfSVCFoFp5/rj7KA2uSHUghqU4Xs8Q5gs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 93B9DF804D0; Fri, 3 Jan 2020 09:19:20 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8C700F803B1; Fri, 3 Jan 2020 09:18:44 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7C9B7F802C4 for ; Fri, 3 Jan 2020 09:17:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7C9B7F802C4 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C7339B282 for ; Fri, 3 Jan 2020 08:17:21 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:17:00 +0100 Message-Id: <20200103081714.9560-45-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 44/58] ALSA: opl3: Constify snd_opl3_drum_voice definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The snd_opl3_drum_voice items are all read-only, hence they can be declared as const. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/drivers/opl3/opl3_drums.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sound/drivers/opl3/opl3_drums.c b/sound/drivers/opl3/opl3_drums.c index cc7fb35e521b..318cd8a2ee3a 100644 --- a/sound/drivers/opl3/opl3_drums.c +++ b/sound/drivers/opl3/opl3_drums.c @@ -47,25 +47,25 @@ struct snd_opl3_drum_note { unsigned char feedback_connection; }; -static struct snd_opl3_drum_voice bass_op0 = {6, 0, 0x00, 0x32, 0xf8, 0x66, 0x30, 0x00}; -static struct snd_opl3_drum_voice bass_op1 = {6, 1, 0x00, 0x03, 0xf6, 0x57, 0x30, 0x00}; -static struct snd_opl3_drum_note bass_note = {6, 0x90, 0x09}; +static const struct snd_opl3_drum_voice bass_op0 = {6, 0, 0x00, 0x32, 0xf8, 0x66, 0x30, 0x00}; +static const struct snd_opl3_drum_voice bass_op1 = {6, 1, 0x00, 0x03, 0xf6, 0x57, 0x30, 0x00}; +static const struct snd_opl3_drum_note bass_note = {6, 0x90, 0x09}; -static struct snd_opl3_drum_voice hihat = {7, 0, 0x00, 0x03, 0xf0, 0x06, 0x20, 0x00}; +static const struct snd_opl3_drum_voice hihat = {7, 0, 0x00, 0x03, 0xf0, 0x06, 0x20, 0x00}; -static struct snd_opl3_drum_voice snare = {7, 1, 0x00, 0x03, 0xf0, 0x07, 0x20, 0x02}; -static struct snd_opl3_drum_note snare_note = {7, 0xf4, 0x0d}; +static const struct snd_opl3_drum_voice snare = {7, 1, 0x00, 0x03, 0xf0, 0x07, 0x20, 0x02}; +static const struct snd_opl3_drum_note snare_note = {7, 0xf4, 0x0d}; -static struct snd_opl3_drum_voice tomtom = {8, 0, 0x02, 0x03, 0xf0, 0x06, 0x10, 0x00}; -static struct snd_opl3_drum_note tomtom_note = {8, 0xf4, 0x09}; +static const struct snd_opl3_drum_voice tomtom = {8, 0, 0x02, 0x03, 0xf0, 0x06, 0x10, 0x00}; +static const struct snd_opl3_drum_note tomtom_note = {8, 0xf4, 0x09}; -static struct snd_opl3_drum_voice cymbal = {8, 1, 0x04, 0x03, 0xf0, 0x06, 0x10, 0x00}; +static const struct snd_opl3_drum_voice cymbal = {8, 1, 0x04, 0x03, 0xf0, 0x06, 0x10, 0x00}; /* * set drum voice characteristics */ static void snd_opl3_drum_voice_set(struct snd_opl3 *opl3, - struct snd_opl3_drum_voice *data) + const struct snd_opl3_drum_voice *data) { unsigned char op_offset = snd_opl3_regmap[data->voice][data->op]; unsigned char voice_offset = data->voice; @@ -100,7 +100,7 @@ static void snd_opl3_drum_voice_set(struct snd_opl3 *opl3, * Set drum voice pitch */ static void snd_opl3_drum_note_set(struct snd_opl3 *opl3, - struct snd_opl3_drum_note *data) + const struct snd_opl3_drum_note *data) { unsigned char voice_offset = data->voice; unsigned short opl3_reg; @@ -118,7 +118,7 @@ static void snd_opl3_drum_note_set(struct snd_opl3 *opl3, * Set drum voice volume and position */ static void snd_opl3_drum_vol_set(struct snd_opl3 *opl3, - struct snd_opl3_drum_voice *data, + const struct snd_opl3_drum_voice *data, int vel, struct snd_midi_channel *chan) { unsigned char op_offset = snd_opl3_regmap[data->voice][data->op]; @@ -170,7 +170,7 @@ void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int vel, int on_off, struct snd_midi_channel *chan) { unsigned char drum_mask; - struct snd_opl3_drum_voice *drum_voice; + const struct snd_opl3_drum_voice *drum_voice; if (!(opl3->drum_reg & OPL3_PERCUSSION_ENABLE)) return; From patchwork Fri Jan 3 08:17:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193990 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E82FEC00523 for ; Fri, 3 Jan 2020 08:54:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7276C21734 for ; Fri, 3 Jan 2020 08:54:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Y35yu8y1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7276C21734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BA5CB17B8; Fri, 3 Jan 2020 09:53:47 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BA5CB17B8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041677; bh=caHLSYPXCFrTZbm550fLufCBu2RmlfsO2coouyz+MTA=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Y35yu8y1Rzu74t05OFipoJxrBmpHP5eXRllxt+XbziefkR/QXqLKFN4Y+gGd7K7BV IdqZwonDeV29ZAo599RBpDC2L9VyAMDkXdCtdLXVsUDHMAnEiAFsLveidy27X77QAk bMgI023RxQD0FQ1FwlxNivaIU6+SGhlIoYAHFJ2Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2A623F80543; Fri, 3 Jan 2020 09:19:31 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 22BE1F803DE; Fri, 3 Jan 2020 09:18:58 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 09339F802E7 for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 09339F802E7 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 08EF1B284 for ; Fri, 3 Jan 2020 08:17:22 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:17:04 +0100 Message-Id: <20200103081714.9560-49-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 48/58] ALSA: ice17xx: Constify snd_ice1712_card_info X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The snd_ice1712_card_info objects are referred only as read-only. Let's make them const for further optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/pci/ice1712/ice1712.c | 6 +++--- sound/pci/ice1712/ice1712.h | 2 +- sound/pci/ice1712/ice1724.c | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 5202e4c06fc4..884d0cdec08c 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c @@ -2218,7 +2218,7 @@ static const struct snd_kcontrol_new snd_ice1712_mixer_pro_peak = { /* * list of available boards */ -static struct snd_ice1712_card_info *card_tables[] = { +static const struct snd_ice1712_card_info *card_tables[] = { snd_ice1712_hoontech_cards, snd_ice1712_delta_cards, snd_ice1712_ews_cards, @@ -2242,7 +2242,7 @@ static int snd_ice1712_read_eeprom(struct snd_ice1712 *ice, { int dev = ICE_I2C_EEPROM_ADDR; /* I2C EEPROM device address */ unsigned int i, size; - struct snd_ice1712_card_info * const *tbl, *c; + const struct snd_ice1712_card_info * const *tbl, *c; if (!modelname || !*modelname) { ice->eeprom.subvendor = 0; @@ -2587,7 +2587,7 @@ static int snd_ice1712_probe(struct pci_dev *pci, struct snd_card *card; struct snd_ice1712 *ice; int pcm_dev = 0, err; - struct snd_ice1712_card_info * const *tbl, *c; + const struct snd_ice1712_card_info * const *tbl, *c; if (dev >= SNDRV_CARDS) return -ENODEV; diff --git a/sound/pci/ice1712/ice1712.h b/sound/pci/ice1712/ice1712.h index 88145708a8a7..cd02710d8271 100644 --- a/sound/pci/ice1712/ice1712.h +++ b/sound/pci/ice1712/ice1712.h @@ -316,7 +316,7 @@ struct snd_ice1712 { struct snd_info_entry *proc_entry; struct snd_ice1712_eeprom eeprom; - struct snd_ice1712_card_info *card_info; + const struct snd_ice1712_card_info *card_info; unsigned int pro_volumes[20]; unsigned int omni:1; /* Delta Omni I/O */ diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 4630a8c42aa9..f4d69b8197ed 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c @@ -2170,13 +2170,13 @@ static const struct snd_kcontrol_new snd_vt1724_mixer_pro_peak = { * */ -static struct snd_ice1712_card_info no_matched; +static const struct snd_ice1712_card_info no_matched; /* ooAoo cards with no controls */ -static unsigned char ooaoo_sq210_eeprom[] = { +static const unsigned char ooaoo_sq210_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x4c, /* 49MHz crystal, no mpu401, no ADC, 1xDACs */ [ICE_EEP2_ACLINK] = 0x80, /* I2S */ @@ -2196,7 +2196,7 @@ static unsigned char ooaoo_sq210_eeprom[] = { }; -static struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] = { +static const struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] = { { .name = "ooAoo SQ210a", .model = "sq210a", @@ -2206,7 +2206,7 @@ static struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] = { { } /* terminator */ }; -static struct snd_ice1712_card_info *card_tables[] = { +static const struct snd_ice1712_card_info *card_tables[] = { snd_vt1724_revo_cards, snd_vt1724_amp_cards, snd_vt1724_aureon_cards, @@ -2276,7 +2276,7 @@ static int snd_vt1724_read_eeprom(struct snd_ice1712 *ice, { const int dev = 0xa0; /* EEPROM device address */ unsigned int i, size; - struct snd_ice1712_card_info * const *tbl, *c; + const struct snd_ice1712_card_info * const *tbl, *c; if (!modelname || !*modelname) { ice->eeprom.subvendor = 0; @@ -2590,7 +2590,7 @@ static int snd_vt1724_probe(struct pci_dev *pci, struct snd_card *card; struct snd_ice1712 *ice; int pcm_dev = 0, err; - struct snd_ice1712_card_info * const *tbl, *c; + const struct snd_ice1712_card_info * const *tbl, *c; if (dev >= SNDRV_CARDS) return -ENODEV; From patchwork Fri Jan 3 08:17:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193992 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECDDAC00523 for ; Fri, 3 Jan 2020 08:52:04 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 70A3D222C4 for ; Fri, 3 Jan 2020 08:52:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="qYf7CpHb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70A3D222C4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A932517C0; Fri, 3 Jan 2020 09:51:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A932517C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041522; bh=0mEQifAWxygZYxt0kHzfdq++ZpR+PsP9jV2li1YorC0=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qYf7CpHb7diCxQQyVHmTg1dr2QjToErYSXdhVp7xB998FHEAbk5jsSgzQ65K6U+2w cy973sso7WezRyblodPJuEcAl2WGmUoxULHIMV83AcNJNoCnPuvRM6YoN8u4vepbOt HjKRnJV6KkgxA/CRNdDtfo80CaldBdUIFMwh4zRs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D59BAF8051C; Fri, 3 Jan 2020 09:19:26 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B2998F803CC; Fri, 3 Jan 2020 09:18:51 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C0A13F802E0 for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C0A13F802E0 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 09946B285 for ; Fri, 3 Jan 2020 08:17:22 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:17:05 +0100 Message-Id: <20200103081714.9560-50-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 49/58] ALSA: ice1712: Constify wm-specific tables X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The tables defined in wm8766.c and wm8776.c are referred as read-only, hence they can be declared as const gracefully. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/pci/ice1712/wm8766.c | 2 +- sound/pci/ice1712/wm8776.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/ice1712/wm8766.c b/sound/pci/ice1712/wm8766.c index 0943f9ef73cf..fe3e243b3854 100644 --- a/sound/pci/ice1712/wm8766.c +++ b/sound/pci/ice1712/wm8766.c @@ -26,7 +26,7 @@ static void snd_wm8766_write(struct snd_wm8766 *wm, u16 addr, u16 data) static const DECLARE_TLV_DB_SCALE(wm8766_tlv, -12750, 50, 1); -static struct snd_wm8766_ctl snd_wm8766_default_ctl[WM8766_CTL_COUNT] = { +static const struct snd_wm8766_ctl snd_wm8766_default_ctl[WM8766_CTL_COUNT] = { [WM8766_CTL_CH1_VOL] = { .name = "Channel 1 Playback Volume", .type = SNDRV_CTL_ELEM_TYPE_INTEGER, diff --git a/sound/pci/ice1712/wm8776.c b/sound/pci/ice1712/wm8776.c index d696a7c29f7e..d96008df880d 100644 --- a/sound/pci/ice1712/wm8776.c +++ b/sound/pci/ice1712/wm8776.c @@ -129,7 +129,7 @@ static const DECLARE_TLV_DB_SCALE(wm8776_ngth_tlv, -7800, 600, 0); static const DECLARE_TLV_DB_SCALE(wm8776_maxatten_lim_tlv, -1200, 100, 0); static const DECLARE_TLV_DB_SCALE(wm8776_maxatten_alc_tlv, -2100, 400, 0); -static struct snd_wm8776_ctl snd_wm8776_default_ctl[WM8776_CTL_COUNT] = { +static const struct snd_wm8776_ctl snd_wm8776_default_ctl[WM8776_CTL_COUNT] = { [WM8776_CTL_DAC_VOL] = { .name = "Master Playback Volume", .type = SNDRV_CTL_ELEM_TYPE_INTEGER, From patchwork Fri Jan 3 08:17:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193994 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F530C00523 for ; Fri, 3 Jan 2020 08:49:25 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A238321734 for ; Fri, 3 Jan 2020 08:49:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="UWBc6Lvv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A238321734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E782117AB; Fri, 3 Jan 2020 09:48:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E782117AB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041363; bh=l3pqrPB7dTvzzFltt7Sh+LrY4s231xUJqcQWp+1ZyIA=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UWBc6Lvv2Ynx4IVgqZ/CMyEqxeGzm0f4lpSaA+iKb7+fR2qq8KBJ0LIcVd3RC/hPN 5gbHt6NSPyaesLcP3s5gmQKU9yMmyZhUsBK5gOwQUxAIAS1USNZ7dhyTn683c5++FQ m+j5bk6EFIJx5aLX8TcenWnE0hjENwGrBKAsb4tg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 803FFF804DD; Fri, 3 Jan 2020 09:19:22 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6D631F802DC; Fri, 3 Jan 2020 09:18:47 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 94BA4F802DC for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 94BA4F802DC X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 16F23B1F7 for ; Fri, 3 Jan 2020 08:17:22 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:17:06 +0100 Message-Id: <20200103081714.9560-51-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 50/58] ALSA: line6: Constify snd_ratden definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The snd_ratden definitions used in line6 drivers are all read-only, so they can be marked as const. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/usb/line6/pod.c | 2 +- sound/usb/line6/podhd.c | 2 +- sound/usb/line6/toneport.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/usb/line6/pod.c b/sound/usb/line6/pod.c index ee4c9d220fdf..cd44cb5f1310 100644 --- a/sound/usb/line6/pod.c +++ b/sound/usb/line6/pod.c @@ -110,7 +110,7 @@ enum { POD_BUSY_MIDISEND }; -static struct snd_ratden pod_ratden = { +static const struct snd_ratden pod_ratden = { .num_min = 78125, .num_max = 78125, .num_step = 1, diff --git a/sound/usb/line6/podhd.c b/sound/usb/line6/podhd.c index 27bf61c177c0..d37db32ecd3b 100644 --- a/sound/usb/line6/podhd.c +++ b/sound/usb/line6/podhd.c @@ -42,7 +42,7 @@ struct usb_line6_podhd { #define line6_to_podhd(x) container_of(x, struct usb_line6_podhd, line6) -static struct snd_ratden podhd_ratden = { +static const struct snd_ratden podhd_ratden = { .num_min = 48000, .num_max = 48000, .num_step = 1, diff --git a/sound/usb/line6/toneport.c b/sound/usb/line6/toneport.c index d0a555dbe324..94dd5e7ab2e6 100644 --- a/sound/usb/line6/toneport.c +++ b/sound/usb/line6/toneport.c @@ -63,7 +63,7 @@ static int toneport_send_cmd(struct usb_device *usbdev, int cmd1, int cmd2); #define TONEPORT_PCM_DELAY 1 -static struct snd_ratden toneport_ratden = { +static const struct snd_ratden toneport_ratden = { .num_min = 44100, .num_max = 44100, .num_step = 1, From patchwork Fri Jan 3 08:17:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193993 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25833C00523 for ; Fri, 3 Jan 2020 08:50:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A2D9221D7D for ; Fri, 3 Jan 2020 08:50:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="F6sBwTzT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2D9221D7D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D0AD41781; Fri, 3 Jan 2020 09:49:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D0AD41781 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041436; bh=Dy3CUkE4Af37R1p3LK/D2RN5Vkgl7psxVNczqk5l/CY=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=F6sBwTzTQXKMC+xB7hxNqQGqvReRJgtWoQLh7/rqhiULxmG1UAw6B6ovJ1Q0nEtSj 5YVO0Pgb/SMMxkmBum5qWwdgj4Li33T0iyPVDS6D6e0czi7IY74XyehLC3umrxteiH Q3eoGjMYG7YUkfsQs7MYpyTTYbMLqLig4S/1pEOA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 45703F804E7; Fri, 3 Jan 2020 09:19:24 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 02C01F803CD; Fri, 3 Jan 2020 09:18:50 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9C61CF802DB for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9C61CF802DB X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 31F2FB287 for ; Fri, 3 Jan 2020 08:17:22 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:17:08 +0100 Message-Id: <20200103081714.9560-53-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 52/58] ALSA: seq: oss: Constify snd_seq_oss_callback definitions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The snd_seq_oss_callback items are just copied to another struct as-is, hence they can be declared as const. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/drivers/opl3/opl3_oss.c | 2 +- sound/synth/emux/emux_oss.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/drivers/opl3/opl3_oss.c b/sound/drivers/opl3/opl3_oss.c index d0cf2fb02cce..7bf0d5f3fedd 100644 --- a/sound/drivers/opl3/opl3_oss.c +++ b/sound/drivers/opl3/opl3_oss.c @@ -16,7 +16,7 @@ static int snd_opl3_reset_seq_oss(struct snd_seq_oss_arg *arg); /* operators */ -static struct snd_seq_oss_callback oss_callback = { +static const struct snd_seq_oss_callback oss_callback = { .owner = THIS_MODULE, .open = snd_opl3_open_seq_oss, .close = snd_opl3_close_seq_oss, diff --git a/sound/synth/emux/emux_oss.c b/sound/synth/emux/emux_oss.c index a14fc6562664..d8d32671f703 100644 --- a/sound/synth/emux/emux_oss.c +++ b/sound/synth/emux/emux_oss.c @@ -34,7 +34,7 @@ static void fake_event(struct snd_emux *emu, struct snd_emux_port *port, int ch, int param, int val, int atomic, int hop); /* operators */ -static struct snd_seq_oss_callback oss_callback = { +static const struct snd_seq_oss_callback oss_callback = { .owner = THIS_MODULE, .open = snd_emux_open_seq_oss, .close = snd_emux_close_seq_oss, From patchwork Fri Jan 3 08:17:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193991 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D1BAC00523 for ; Fri, 3 Jan 2020 08:53:22 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F379E21734 for ; Fri, 3 Jan 2020 08:53:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="k+bD+ILN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F379E21734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 50BF117CC; Fri, 3 Jan 2020 09:52:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 50BF117CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041600; bh=QyT5mIDQ2jzHigrFSsrkjWo3gdqszPzUWxGA8muq1hg=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=k+bD+ILNbZXwwZ4cjLaS74Bwz4OF2dzm8MBKo1mNoAAWO5NZ71bgEc2JVkkXZZmry ayVP+uLFcSzsMaUrCbLmuWifSgR2LIpGMo6Pi4/OaPa+uYIA3WsfiaSqeAR+ORkegx Ek3nOyVHbcC9uA62bJoDrwXemjXP7bgwR0UzCbfc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 064FAF80527; Fri, 3 Jan 2020 09:19:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4BD0FF803D7; Fri, 3 Jan 2020 09:18:56 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DECD0F802E3 for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DECD0F802E3 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5EA10B28A for ; Fri, 3 Jan 2020 08:17:22 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:17:11 +0100 Message-Id: <20200103081714.9560-56-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 55/58] ALSA: es1968: Constify snd_es1968_tea575x_gpios X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The snd_es1968_tea575x_gpios table is referred as read-only, hence it can be declared as const gracefully. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/pci/es1968.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index f23a935267c3..affd3e8d7a67 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c @@ -2529,7 +2529,7 @@ struct snd_es1968_tea575x_gpio { char *name; }; -static struct snd_es1968_tea575x_gpio snd_es1968_tea575x_gpios[] = { +static const struct snd_es1968_tea575x_gpio snd_es1968_tea575x_gpios[] = { { .data = 6, .clk = 7, .wren = 8, .most = 9, .name = "SF64-PCE2" }, { .data = 7, .clk = 8, .wren = 6, .most = 10, .name = "M56VAP" }, }; From patchwork Fri Jan 3 08:17:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193989 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17803C00523 for ; Fri, 3 Jan 2020 08:56:09 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9450721734 for ; Fri, 3 Jan 2020 08:56:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="eu6lEYsi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9450721734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B6A9217AD; Fri, 3 Jan 2020 09:55:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B6A9217AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041766; bh=QHNUIAX46RafiW4ZgF3YSywxakT8CtrIoUmj0QKvCa8=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eu6lEYsicOo6F8DVdH3bBYVlgMkQuImLhDcTKEG06+SNT5PgkH2Tgp4OubScWCh8K LbnmMj23/xV8CelZQ62iyajhYWBrogzky+cPZju46kcjqUQid4zmNd7ro7UdsdnNaW sPtfLlnYiKx8sLJAqdeGR4CXbzupSVSixF1GSzc8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D5FF9F80564; Fri, 3 Jan 2020 09:19:34 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B2B3DF803E0; Fri, 3 Jan 2020 09:19:00 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 61EF1F802EC for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 61EF1F802EC X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7A27AB28D for ; Fri, 3 Jan 2020 08:17:22 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:17:13 +0100 Message-Id: <20200103081714.9560-58-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 57/58] ALSA: hda: Constify snd_pci_quirk tables X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The snd_pci_quirk tables are referred as read-only, hence they can be declared as const gracefully. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/pci/hda/hda_intel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 4733268ec74e..bebc31024737 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1490,7 +1490,7 @@ static bool check_hdmi_disabled(struct pci_dev *pci) /* * white/black-listing for position_fix */ -static struct snd_pci_quirk position_fix_list[] = { +static const struct snd_pci_quirk position_fix_list[] = { SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB), SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB), SND_PCI_QUIRK(0x103c, 0x306d, "HP dv3", POS_FIX_LPIB), @@ -1583,7 +1583,7 @@ static void assign_position_fix(struct azx *chip, int fix) /* * black-lists for probe_mask */ -static struct snd_pci_quirk probe_mask_list[] = { +static const struct snd_pci_quirk probe_mask_list[] = { /* Thinkpad often breaks the controller communication when accessing * to the non-working (or non-existing) modem codec slot. */ @@ -1631,7 +1631,7 @@ static void check_probe_mask(struct azx *chip, int dev) /* * white/black-list for enable_msi */ -static struct snd_pci_quirk msi_black_list[] = { +static const struct snd_pci_quirk msi_black_list[] = { SND_PCI_QUIRK(0x103c, 0x2191, "HP", 0), /* AMD Hudson */ SND_PCI_QUIRK(0x103c, 0x2192, "HP", 0), /* AMD Hudson */ SND_PCI_QUIRK(0x103c, 0x21f7, "HP", 0), /* AMD Hudson */ @@ -2164,7 +2164,7 @@ static int azx_probe(struct pci_dev *pci, * So we keep a list of devices where we disable powersaving as its known * to causes problems on these devices. */ -static struct snd_pci_quirk power_save_blacklist[] = { +static const struct snd_pci_quirk power_save_blacklist[] = { /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ SND_PCI_QUIRK(0x1849, 0xc892, "Asrock B85M-ITX", 0), /* https://bugzilla.redhat.com/show_bug.cgi?id=1525104 */ From patchwork Fri Jan 3 08:17:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193988 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7FEBC3F68F for ; Fri, 3 Jan 2020 08:57:21 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6196821734 for ; Fri, 3 Jan 2020 08:57:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="LeQo6J6Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6196821734 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BA7E717E0; Fri, 3 Jan 2020 09:56:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BA7E717E0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041839; bh=GvXOzOsZdZL6hByjHC9/C3VV+N/eeJJtlRQf2rQ8NrM=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LeQo6J6YNrAA9TECytbdq9nZ532ObcNlT8nhdbExRE+tOYoQ2lAfkBD+V8q8mnYle 3XzZ5lfO/Hbfy+A5ywUWop8ArPyn/vQngGfUIgjLutFhJOdRagsJGKGd0SFk2HNuF/ IBgD54N0bfLxgajPZn5vIIgkIpRM92lfNwigvcT0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 29655F805A8; Fri, 3 Jan 2020 09:19:37 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E1447F803E0; Fri, 3 Jan 2020 09:19:01 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 66006F802F8 for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 66006F802F8 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 892E0B28E for ; Fri, 3 Jan 2020 08:17:22 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Fri, 3 Jan 2020 09:17:14 +0100 Message-Id: <20200103081714.9560-59-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200103081714.9560-1-tiwai@suse.de> References: <20200103081714.9560-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 58/58] ALSA: pci: Constify snd_pci_quirk tables X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The snd_pci_quirk tables are referred as read-only, hence they can be declared as const gracefully. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/pci/atiixp.c | 2 +- sound/pci/ctxfi/ctatc.c | 4 ++-- sound/pci/ens1370.c | 8 ++++---- sound/pci/intel8x0.c | 6 +++--- sound/pci/maestro3.c | 8 ++++---- sound/pci/nm256/nm256.c | 2 +- sound/pci/via82xx.c | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index c3281fab365d..4a840734e7a7 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c @@ -282,7 +282,7 @@ static const struct pci_device_id snd_atiixp_ids[] = { MODULE_DEVICE_TABLE(pci, snd_atiixp_ids); -static struct snd_pci_quirk atiixp_quirks[] = { +static const struct snd_pci_quirk atiixp_quirks[] = { SND_PCI_QUIRK(0x105b, 0x0c81, "Foxconn RC4107MA-RS2", 0), SND_PCI_QUIRK(0x15bd, 0x3100, "DFI RS482", 0), { } /* terminator */ diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c index 8d92154ac262..e56a230f6a9c 100644 --- a/sound/pci/ctxfi/ctatc.c +++ b/sound/pci/ctxfi/ctatc.c @@ -35,7 +35,7 @@ | (0x10 << 16) \ | ((IEC958_AES3_CON_FS_48000) << 24)) -static struct snd_pci_quirk subsys_20k1_list[] = { +static const struct snd_pci_quirk subsys_20k1_list[] = { SND_PCI_QUIRK(PCI_VENDOR_ID_CREATIVE, 0x0022, "SB055x", CTSB055X), SND_PCI_QUIRK(PCI_VENDOR_ID_CREATIVE, 0x002f, "SB055x", CTSB055X), SND_PCI_QUIRK(PCI_VENDOR_ID_CREATIVE, 0x0029, "SB073x", CTSB073X), @@ -45,7 +45,7 @@ static struct snd_pci_quirk subsys_20k1_list[] = { { } /* terminator */ }; -static struct snd_pci_quirk subsys_20k2_list[] = { +static const struct snd_pci_quirk subsys_20k2_list[] = { SND_PCI_QUIRK(PCI_VENDOR_ID_CREATIVE, PCI_SUBDEVICE_ID_CREATIVE_SB0760, "SB0760", CTSB0760), SND_PCI_QUIRK(PCI_VENDOR_ID_CREATIVE, PCI_SUBDEVICE_ID_CREATIVE_SB1270, diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 4f8202980b61..7ef9b7a1b2e6 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c @@ -1562,7 +1562,7 @@ struct es1371_quirk { }; static int es1371_quirk_lookup(struct ensoniq *ensoniq, - struct es1371_quirk *list) + const struct es1371_quirk *list) { while (list->vid != (unsigned short)PCI_ANY_ID) { if (ensoniq->pci->vendor == list->vid && @@ -1583,7 +1583,7 @@ static struct es1371_quirk es1371_spdif_present[] = { { .vid = PCI_ANY_ID, .did = PCI_ANY_ID } }; -static struct snd_pci_quirk ens1373_line_quirk[] = { +static const struct snd_pci_quirk ens1373_line_quirk[] = { SND_PCI_QUIRK_ID(0x1274, 0x2000), /* GA-7DXR */ SND_PCI_QUIRK_ID(0x1458, 0xa000), /* GA-8IEXP */ { } /* end */ @@ -1909,7 +1909,7 @@ static int snd_ensoniq_dev_free(struct snd_device *device) } #ifdef CHIP1371 -static struct snd_pci_quirk es1371_amplifier_hack[] = { +static const struct snd_pci_quirk es1371_amplifier_hack[] = { SND_PCI_QUIRK_ID(0x107b, 0x2150), /* Gateway Solo 2150 */ SND_PCI_QUIRK_ID(0x13bd, 0x100c), /* EV1938 on Mebius PC-MJ100V */ SND_PCI_QUIRK_ID(0x1102, 0x5938), /* Targa Xtender300 */ @@ -1917,7 +1917,7 @@ static struct snd_pci_quirk es1371_amplifier_hack[] = { { } /* end */ }; -static struct es1371_quirk es1371_ac97_reset_hack[] = { +static const struct es1371_quirk es1371_ac97_reset_hack[] = { { .vid = PCI_VENDOR_ID_ENSONIQ, .did = PCI_DEVICE_ID_ENSONIQ_CT5880, .rev = CT5880REV_CT5880_C }, { .vid = PCI_VENDOR_ID_ENSONIQ, .did = PCI_DEVICE_ID_ENSONIQ_CT5880, .rev = CT5880REV_CT5880_D }, { .vid = PCI_VENDOR_ID_ENSONIQ, .did = PCI_DEVICE_ID_ENSONIQ_CT5880, .rev = CT5880REV_CT5880_E }, diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index de875ea8ecbe..5bdd25815fc7 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -2328,7 +2328,7 @@ static void do_ali_reset(struct intel8x0 *chip) } #ifdef CONFIG_SND_AC97_POWER_SAVE -static struct snd_pci_quirk ich_chip_reset_mode[] = { +static const struct snd_pci_quirk ich_chip_reset_mode[] = { SND_PCI_QUIRK(0x1014, 0x051f, "Thinkpad R32", 1), { } /* end */ }; @@ -2774,7 +2774,7 @@ static void intel8x0_measure_ac97_clock(struct intel8x0 *chip) snd_ac97_update_power(chip->ac97[0], AC97_PCM_FRONT_DAC_RATE, 0); } -static struct snd_pci_quirk intel8x0_clock_list[] = { +static const struct snd_pci_quirk intel8x0_clock_list[] = { SND_PCI_QUIRK(0x0e11, 0x008a, "AD1885", 41000), SND_PCI_QUIRK(0x1014, 0x0581, "AD1981B", 48000), SND_PCI_QUIRK(0x1028, 0x00be, "AD1885", 44100), @@ -3133,7 +3133,7 @@ static struct shortname_table { { 0, NULL }, }; -static struct snd_pci_quirk spdif_aclink_defaults[] = { +static const struct snd_pci_quirk spdif_aclink_defaults[] = { SND_PCI_QUIRK(0x147b, 0x1c1a, "ASUS KN8", 1), { } /* end */ }; diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index 89018d44d777..40232a278b1a 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c @@ -807,7 +807,7 @@ static const struct pci_device_id snd_m3_ids[] = { MODULE_DEVICE_TABLE(pci, snd_m3_ids); -static struct snd_pci_quirk m3_amp_quirk_list[] = { +static const struct snd_pci_quirk m3_amp_quirk_list[] = { SND_PCI_QUIRK(0x0E11, 0x0094, "Compaq Evo N600c", 0x0c), SND_PCI_QUIRK(0x10f7, 0x833e, "Panasonic CF-28", 0x0d), SND_PCI_QUIRK(0x10f7, 0x833d, "Panasonic CF-72", 0x0d), @@ -816,7 +816,7 @@ static struct snd_pci_quirk m3_amp_quirk_list[] = { { } /* END */ }; -static struct snd_pci_quirk m3_irda_quirk_list[] = { +static const struct snd_pci_quirk m3_irda_quirk_list[] = { SND_PCI_QUIRK(0x1028, 0x00b0, "Dell Inspiron 4000", 1), SND_PCI_QUIRK(0x1028, 0x00a4, "Dell Inspiron 8000", 1), SND_PCI_QUIRK(0x1028, 0x00e6, "Dell Inspiron 8100", 1), @@ -824,7 +824,7 @@ static struct snd_pci_quirk m3_irda_quirk_list[] = { }; /* hardware volume quirks */ -static struct snd_pci_quirk m3_hv_quirk_list[] = { +static const struct snd_pci_quirk m3_hv_quirk_list[] = { /* Allegro chips */ SND_PCI_QUIRK(0x0E11, 0x002E, NULL, HV_CTRL_ENABLE | HV_BUTTON_FROM_GD), SND_PCI_QUIRK(0x0E11, 0x0094, NULL, HV_CTRL_ENABLE | HV_BUTTON_FROM_GD), @@ -902,7 +902,7 @@ static struct snd_pci_quirk m3_hv_quirk_list[] = { }; /* HP Omnibook quirks */ -static struct snd_pci_quirk m3_omnibook_quirk_list[] = { +static const struct snd_pci_quirk m3_omnibook_quirk_list[] = { SND_PCI_QUIRK_ID(0x103c, 0x0010), /* HP OmniBook 6000 */ SND_PCI_QUIRK_ID(0x103c, 0x0011), /* HP OmniBook 500 */ { } /* END */ diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index 99228b93b3c6..25275a98e950 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c @@ -1634,7 +1634,7 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci, enum { NM_BLACKLISTED, NM_RESET_WORKAROUND, NM_RESET_WORKAROUND_2 }; -static struct snd_pci_quirk nm256_quirks[] = { +static const struct snd_pci_quirk nm256_quirks[] = { /* HP omnibook 4150 has cs4232 codec internally */ SND_PCI_QUIRK(0x103c, 0x0007, "HP omnibook 4150", NM_BLACKLISTED), /* Reset workarounds to avoid lock-ups */ diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index c8fb51885b6d..6c83ad3275f9 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -2417,7 +2417,7 @@ static struct via823x_info via823x_cards[] = { * auto detection of DXS channel supports. */ -static struct snd_pci_quirk dxs_whitelist[] = { +static const struct snd_pci_quirk dxs_whitelist[] = { SND_PCI_QUIRK(0x1005, 0x4710, "Avance Logic Mobo", VIA_DXS_ENABLE), SND_PCI_QUIRK(0x1019, 0x0996, "ESC Mobo", VIA_DXS_48K), SND_PCI_QUIRK(0x1019, 0x0a81, "ECS K7VTA3 v8.0", VIA_DXS_NO_VRA),