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: 11316565 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1D67A139A for ; Fri, 3 Jan 2020 08:22:41 +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 A8878206DB for ; Fri, 3 Jan 2020 08:22:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="erpwH8LW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A8878206DB 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 EA5C71719; Fri, 3 Jan 2020 09:21:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EA5C71719 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039759; 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=erpwH8LWIkexzDuNcfobpTuD2sEYzcSSxnEu8L7SgfaABi6l2v/yt+CykD87Rawk7 2tdUFQopuM6Hmt71tuAKiugtHKKDBH/z2vtuBHfvtGuRlJ28VQ3sHaJXJU+JWSPZaK K+e/t/NcgPXEkTvl0QdWYasiwL9LGux/WU05jy0M= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 02064F80315; Fri, 3 Jan 2020 09:17:36 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316557 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC17C930 for ; Fri, 3 Jan 2020 08:20:47 +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 60D09206DB for ; Fri, 3 Jan 2020 08:20:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="uBLmgeEt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60D09206DB 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 8531516FD; Fri, 3 Jan 2020 09:19:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8531516FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039645; bh=1VFzdJ/Xk/PoHrMBHSodcYRcYi7NnR0MGa1e5KBFD4k=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=uBLmgeEtcO+sFw1+Rj9gNX9/gEE8mJE9ubGNXHHjt7yS15M0ljUdDYXYcv4WRRR9J R7LPCOmDeXRjOZrxjEIADuUa1fkYEENv8NJV5T8Bv8fdIwpvlJJBz9bHbC2JXJEBpb fPp77M+a39b3xswr1lhheRhWZj6Sx1Y66msY1qnM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3BD49F80315; Fri, 3 Jan 2020 09:17:38 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 50F02F80308; Fri, 3 Jan 2020 09:17:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 A6084F8015E for ; Fri, 3 Jan 2020 09:17:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A6084F8015E 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 9DE0FB1FF 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:18 +0100 Message-Id: <20200103081714.9560-3-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 02/58] ALSA: usb: 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/usb/caiaq/audio.c | 2 +- sound/usb/usx2y/usbusx2yaudio.c | 2 +- sound/usb/usx2y/usx2yhwdeppcm.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index 72212153cb1f..41993a5c0537 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c @@ -30,7 +30,7 @@ #define MAKE_CHECKBYTE(cdev,stream,i) \ (stream << 1) | (~(i / (cdev->n_streams * BYTES_PER_SAMPLE_USB)) & 1) -static struct snd_pcm_hardware snd_usb_caiaq_pcm_hardware = { +static const struct snd_pcm_hardware snd_usb_caiaq_pcm_hardware = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER), .formats = SNDRV_PCM_FMTBIT_S24_3BE, diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index 8ac4ce0e8965..c7dbc0f94efb 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c @@ -838,7 +838,7 @@ static int snd_usX2Y_pcm_prepare(struct snd_pcm_substream *substream) return err; } -static struct snd_pcm_hardware snd_usX2Y_2c = +static const struct snd_pcm_hardware snd_usX2Y_2c = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index d8d91f2fb799..8253669c6a7d 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/sound/usb/usx2y/usx2yhwdeppcm.c @@ -528,7 +528,7 @@ static int snd_usX2Y_usbpcm_prepare(struct snd_pcm_substream *substream) return err; } -static struct snd_pcm_hardware snd_usX2Y_4c = +static const struct snd_pcm_hardware snd_usX2Y_4c = { .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | 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: 11316539 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79638930 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 973A12253D 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 973A12253D 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 7229F16E6; Fri, 3 Jan 2020 09:17:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7229F16E6 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id EB2E4F8028B; Fri, 3 Jan 2020 09:17:24 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316561 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75CAD139A for ; Fri, 3 Jan 2020 08:21:32 +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 0D14922314 for ; Fri, 3 Jan 2020 08:21:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="d4rACiN+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D14922314 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 50ECF170A; Fri, 3 Jan 2020 09:20:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 50ECF170A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039690; 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=d4rACiN+tLa2Zzgrw0P4vq7CqNgi/4N1OrIwGb+Csio7zJy/t3VDPc/NGbJ/UmWo3 mf6NFsfiWdqNBtg3AcUYQdx9LoDpRltOndyYpLHX567qqdvSDo9SPYfwx2VSdb8YSO OPl/oNovKKW1rP1h/h7U8PCNsgM1vLhnBPijacR8= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 65704F80160; Fri, 3 Jan 2020 09:17:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316555 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E775F930 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 7A4A92253D 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 7A4A92253D 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 B4039170B; Fri, 3 Jan 2020 09:19:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B4039170B 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id CAF54F80315; Fri, 3 Jan 2020 09:17:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316563 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D44E6930 for ; Fri, 3 Jan 2020 08:21:57 +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 6C68021734 for ; Fri, 3 Jan 2020 08:21:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="X7mXlyqD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C68021734 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 A7E8E170D; Fri, 3 Jan 2020 09:21:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A7E8E170D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039715; bh=0sJ9CaJrHQkTIBVUpDCRDrnvBFhglUualiA5du+4neE=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=X7mXlyqDO3eYlybBelgwt1k2bCtsy6/YZccMSdsOJuWG5JR1jdoxFCTAmJPsfZUb7 sjhjMmHvu1tl5C/VJaa0bbuYq6fXWctk/tyLKtO61Oa2FUvG6t8Pk025twUkG18Q+6 bKhrE5ehiV7bn8nAzd9bVcYAT0TQVyKSE250a8rU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 56EC2F80323; Fri, 3 Jan 2020 09:17:46 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1D309F80160; Fri, 3 Jan 2020 09:17:35 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 DF30FF8021D for ; Fri, 3 Jan 2020 09:17:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DF30FF8021D 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 D4832B21C 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:22 +0100 Message-Id: <20200103081714.9560-7-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 06/58] ALSA: i2c: 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/i2c/i2c.c | 2 +- sound/i2c/other/ak4113.c | 2 +- sound/i2c/other/ak4114.c | 2 +- sound/i2c/other/ak4117.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/i2c/i2c.c b/sound/i2c/i2c.c index 37b3c6940cac..a684faa771ef 100644 --- a/sound/i2c/i2c.c +++ b/sound/i2c/i2c.c @@ -67,7 +67,7 @@ int snd_i2c_bus_create(struct snd_card *card, const char *name, { struct snd_i2c_bus *bus; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_i2c_bus_dev_free, }; diff --git a/sound/i2c/other/ak4113.c b/sound/i2c/other/ak4113.c index 775f9a354a86..2700a8470388 100644 --- a/sound/i2c/other/ak4113.c +++ b/sound/i2c/other/ak4113.c @@ -60,7 +60,7 @@ int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, struct ak4113 *chip; int err; unsigned char reg; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ak4113_dev_free, }; diff --git a/sound/i2c/other/ak4114.c b/sound/i2c/other/ak4114.c index 6611c7debf23..e7325af8af5b 100644 --- a/sound/i2c/other/ak4114.c +++ b/sound/i2c/other/ak4114.c @@ -71,7 +71,7 @@ int snd_ak4114_create(struct snd_card *card, struct ak4114 *chip; int err = 0; unsigned char reg; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ak4114_dev_free, }; diff --git a/sound/i2c/other/ak4117.c b/sound/i2c/other/ak4117.c index 381949c8f15f..0d9e8252cc27 100644 --- a/sound/i2c/other/ak4117.c +++ b/sound/i2c/other/ak4117.c @@ -64,7 +64,7 @@ int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t struct ak4117 *chip; int err = 0; unsigned char reg; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ak4117_dev_free, }; From patchwork Fri Jan 3 08:16:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316571 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17146139A for ; Fri, 3 Jan 2020 08:24:45 +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 A380621734 for ; Fri, 3 Jan 2020 08:24:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="FumC50c+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A380621734 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 EF5A01727; Fri, 3 Jan 2020 09:23:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EF5A01727 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039883; bh=WIDUAJnszKi34EuovTVUS7ZStC7bbR4XjwekplPhfpg=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FumC50c+wGRemyV8ufujOCI2iLydklOjV5tgzO6BzaxR24f4QwvNFZrfZJwu7/b4N WVszhF04l+Tmhpn3OHNqN1z4H5jX84+RkFgHUeUE8KZMvQNxiiklBOTDOQKl85nOcj TtvS+2OkkccSS6DpBcV27o/pO/7UEFX8QZwnpDAo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 28928F80341; Fri, 3 Jan 2020 09:18:01 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 94DAFF80316; Fri, 3 Jan 2020 09:17:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 57D49F80271 for ; Fri, 3 Jan 2020 09:17:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 57D49F80271 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 E2EA0B21D 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:23 +0100 Message-Id: <20200103081714.9560-8-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 07/58] ALSA: isa: 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/isa/ad1816a/ad1816a_lib.c | 2 +- sound/isa/es1688/es1688_lib.c | 2 +- sound/isa/es18xx.c | 2 +- sound/isa/gus/gus_main.c | 2 +- sound/isa/msnd/msnd_pinnacle.c | 2 +- sound/isa/sb/emu8000.c | 2 +- sound/isa/sb/sb_common.c | 2 +- sound/isa/wss/wss_lib.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c index da6f68b8c248..560885fbc983 100644 --- a/sound/isa/ad1816a/ad1816a_lib.c +++ b/sound/isa/ad1816a/ad1816a_lib.c @@ -577,7 +577,7 @@ int snd_ad1816a_create(struct snd_card *card, unsigned long port, int irq, int dma1, int dma2, struct snd_ad1816a *chip) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_ad1816a_dev_free, }; int error; diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c index 632e867c5766..99a833f29544 100644 --- a/sound/isa/es1688/es1688_lib.c +++ b/sound/isa/es1688/es1688_lib.c @@ -612,7 +612,7 @@ int snd_es1688_create(struct snd_card *card, int dma8, unsigned short hardware) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_es1688_dev_free, }; diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index a581083b876b..f9cd05d2b3bd 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c @@ -1753,7 +1753,7 @@ static int snd_es18xx_new_device(struct snd_card *card, int irq, int dma1, int dma2) { struct snd_es18xx *chip = card->private_data; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_es18xx_dev_free, }; int err; diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c index 9f94b5f3b029..e9fc333c0fcb 100644 --- a/sound/isa/gus/gus_main.c +++ b/sound/isa/gus/gus_main.c @@ -134,7 +134,7 @@ int snd_gus_create(struct snd_card *card, { struct snd_gus_card *gus; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_gus_dev_free, }; diff --git a/sound/isa/msnd/msnd_pinnacle.c b/sound/isa/msnd/msnd_pinnacle.c index 9e7f03eec7e6..7fca418a64f8 100644 --- a/sound/isa/msnd/msnd_pinnacle.c +++ b/sound/isa/msnd/msnd_pinnacle.c @@ -528,7 +528,7 @@ static int snd_msnd_attach(struct snd_card *card) { struct snd_msnd *chip = card->private_data; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_msnd_dev_free, }; diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c index 433e32e254f9..bc47e8e51523 100644 --- a/sound/isa/sb/emu8000.c +++ b/sound/isa/sb/emu8000.c @@ -1075,7 +1075,7 @@ snd_emu8000_new(struct snd_card *card, int index, long port, int seq_ports, struct snd_seq_device *awe; struct snd_emu8000 *hw; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_emu8000_dev_free, }; diff --git a/sound/isa/sb/sb_common.c b/sound/isa/sb/sb_common.c index 4aaf9ab82afe..61ea4078aa95 100644 --- a/sound/isa/sb/sb_common.c +++ b/sound/isa/sb/sb_common.c @@ -204,7 +204,7 @@ int snd_sbdsp_create(struct snd_card *card, { struct snd_sb *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_sbdsp_dev_free, }; diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c index 100e8b547d27..b51b50154e8a 100644 --- a/sound/isa/wss/wss_lib.c +++ b/sound/isa/wss/wss_lib.c @@ -1772,7 +1772,7 @@ int snd_wss_create(struct snd_card *card, unsigned short hwshare, struct snd_wss **rchip) { - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_wss_dev_free, }; struct snd_wss *chip; 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: 11316573 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F29E1930 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 8B16F21734 for ; Fri, 3 Jan 2020 08:25:19 +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 8B16F21734 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 C4EF2172C; Fri, 3 Jan 2020 09:24:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C4EF2172C 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 29E80F80329; Fri, 3 Jan 2020 09:17:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316577 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9062C14E3 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 26C93227BF for ; Fri, 3 Jan 2020 08:26:43 +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 26C93227BF 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 30C6A1732; Fri, 3 Jan 2020 09:25:51 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 30C6A1732 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9018CF80331; Fri, 3 Jan 2020 09:17:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316567 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C66DF930 for ; Fri, 3 Jan 2020 08:23:30 +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 526922253D for ; Fri, 3 Jan 2020 08:23:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="ua/eaZHM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 526922253D 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 A0179167C; Fri, 3 Jan 2020 09:22:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A0179167C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039808; bh=JgysEWxNn3i2d/QCejmPc79K0aIVaPPJHQp6o6dDLgg=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ua/eaZHM+OgAd6IDnw+cT9sR4oBb4l1m/oNAdD9XND02ZUEMPRG/5eoh40sECZRsl 4kYLOhffE2q64NGYvJvX+BEETEodXnUNz+U57LMGzpLzATXEUQeAgM6m7yUuiwAFrl 8M/kY0T/9KKwsJY+nJdgBTwTiZAZgFG9jWyLE7xA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C83DEF8027D; Fri, 3 Jan 2020 09:17:55 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 338A3F80257; Fri, 3 Jan 2020 09:17:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 13C35F80257 for ; Fri, 3 Jan 2020 09:17:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 13C35F80257 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 19540B23A 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:26 +0100 Message-Id: <20200103081714.9560-11-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 10/58] ALSA: usb: 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/usb/mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 6cd4ff09c5ee..f60e0869c096 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -3407,7 +3407,7 @@ static int create_keep_iface_ctl(struct usb_mixer_interface *mixer) int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif, int ignore_error) { - static struct snd_device_ops dev_ops = { + static const struct snd_device_ops dev_ops = { .dev_free = snd_usb_mixer_dev_free }; struct usb_mixer_interface *mixer; 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: 11316569 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B214D930 for ; Fri, 3 Jan 2020 08:24: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 493E3206DB for ; Fri, 3 Jan 2020 08:24: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="LG4xXv68" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 493E3206DB 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 87A211724; Fri, 3 Jan 2020 09:23:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 87A211724 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039849; 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=LG4xXv68Yb56DkBnQFzk4QfiKvFdB6Agta/pc/Xf0lCf6/zKWqI53OHEBBfJuDX5V RIyo2L2e1OQt1gon150SdTT5IziRoxZrZt2YpYN1edJHqEom4axFGo7Azrx49mCmMx Da/taXa51gMaQf94wBI0sINVYfcjcHo4wpwRO7kk= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 094FEF80321; Fri, 3 Jan 2020 09:17:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316581 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 237E3138D 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 AEF022253D 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 AEF022253D 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 E27381734; Fri, 3 Jan 2020 09:27:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E27381734 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 08168F80332; Fri, 3 Jan 2020 09:17:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316589 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 497C0109A for ; Fri, 3 Jan 2020 08:30:41 +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 D427D20848 for ; Fri, 3 Jan 2020 08:30:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="uRR+X1Ry" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D427D20848 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 170C31707; Fri, 3 Jan 2020 09:29:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 170C31707 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040239; 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=uRR+X1RyZLZ8qBUUBuICZD+4QmF/sAq3GVtuBPfJkMPYblBbeLHsJY90EAb8iOG+/ wo1qNQpPuvOyW+ExiEKZ7VEy+xRtxVg3cAe4qXQVjMinE7tdUT2wkqu0QoQIO6XaxF 5h5gCr/FU/LsOSGkJ4Uzbp3yz4tF8tYBJFBuw90s= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id BB0E7F80276; Fri, 3 Jan 2020 09:17:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316575 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D61CB138C for ; Fri, 3 Jan 2020 08:26: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 5F2CB206DB for ; Fri, 3 Jan 2020 08:26: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="uJ3arJCE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F2CB206DB 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 AB2BB1729; Fri, 3 Jan 2020 09:25:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AB2BB1729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578039962; bh=MV2/CXoX92hSCtAg8kFIVrHJNnUnbYu6otu3q8zRuhE=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=uJ3arJCE34UptCRzWSNJ+JSs5Z5ZGG0rPOoX4hIDVNtTJX1PmkDRNHnCEbGApec7h mnnb4xdEZp55i7RRuUxDG96qyQ4Ic5QCKPVq8oKpge0gdw7i52KuhQSc4mU4iZZN/7 idxi7BHR2pTa5fpXlyUEbu9xeM2hOGkqLZSnuxg0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D7A7EF80279; Fri, 3 Jan 2020 09:18:07 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 61A23F80328; Fri, 3 Jan 2020 09:17:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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 9E9C3F8023E for ; Fri, 3 Jan 2020 09:17:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9E9C3F8023E 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 4DEF8B25A 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:30 +0100 Message-Id: <20200103081714.9560-15-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 14/58] ALSA: pcmcia: 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/pcmcia/pdaudiocf/pdaudiocf.c | 2 +- sound/pcmcia/vx/vxpocket.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pcmcia/pdaudiocf/pdaudiocf.c b/sound/pcmcia/pdaudiocf/pdaudiocf.c index eed2d60178e4..6c33ea91cc05 100644 --- a/sound/pcmcia/pdaudiocf/pdaudiocf.c +++ b/sound/pcmcia/pdaudiocf/pdaudiocf.c @@ -82,7 +82,7 @@ static int snd_pdacf_probe(struct pcmcia_device *link) int i, err; struct snd_pdacf *pdacf; struct snd_card *card; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_pdacf_dev_free, }; diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c index f924d8819f9d..cad603ca0d93 100644 --- a/sound/pcmcia/vx/vxpocket.c +++ b/sound/pcmcia/vx/vxpocket.c @@ -126,7 +126,7 @@ static int snd_vxpocket_new(struct snd_card *card, int ibl, { struct vx_core *chip; struct snd_vxpocket *vxp; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_vxpocket_dev_free, }; int err; From patchwork Fri Jan 3 08:16:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316583 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 388E8930 for ; Fri, 3 Jan 2020 08:28:36 +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 BA4C620848 for ; Fri, 3 Jan 2020 08:28:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="me8oGNt9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA4C620848 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 1EC121723; Fri, 3 Jan 2020 09:27:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1EC121723 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040114; bh=qPUD3AW+/woLLOw8A2cC5DMl8i22zgLh0+V1CQeeH70=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=me8oGNt9bvQZH2S+135qAUGHLzx6i8L4RSfHSKLVsibPMZcD625U5Z0aGFvdGrYGL uUttfACb5pUUyswrW+LoTzL59trKnTdIniGx//48m9U7lNahQlt2T1uVpqBePN30KF GeNCJf3HrucxabUqV5EHtDOqvbWMNz5/rt+vPmj8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D30CFF8036A; Fri, 3 Jan 2020 09:18:18 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E6194F80332; Fri, 3 Jan 2020 09:17:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 4B613F80273 for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4B613F80273 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 5A761B262 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:31 +0100 Message-Id: <20200103081714.9560-16-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 15/58] ALSA: ppc: 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/ppc/pmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 026410c7dd71..6ee97008c8f0 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -1143,7 +1143,7 @@ int snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) int i, err; unsigned int irq; unsigned long ctrl_addr, txdma_addr, rxdma_addr; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_pmac_dev_free, }; From patchwork Fri Jan 3 08:16:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316579 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 97025138D for ; Fri, 3 Jan 2020 08:27:16 +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 245C42253D for ; Fri, 3 Jan 2020 08:27:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="u8jjlFwr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 245C42253D 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 6999A172E; Fri, 3 Jan 2020 09:26:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6999A172E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040034; bh=uwzZFnEA0o96aUoO8tYqvxkBMdczH0830PIzQ8o+Ax0=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=u8jjlFwrz6T0+VLoXbdEDn0798zbkmgQGXG5xrIxMdT0KXEI5wLpaqgmxQ7WRBC5Z hmIl6uH8BgOvrp09s/YusIWdV8tStevYUIUSy5hpeMEw3pu742Lg4UqDgOA7X8eZow 3l24+C/3T/NJhZjHVKIGNT735PzvA3QdqaEMOruw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D7688F8034C; Fri, 3 Jan 2020 09:18:12 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id DB757F80328; Fri, 3 Jan 2020 09:17:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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 3BD95F80277 for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3BD95F80277 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 60E0EB263 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:32 +0100 Message-Id: <20200103081714.9560-17-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 16/58] ALSA: sparc: 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/sparc/amd7930.c | 2 +- sound/sparc/cs4231.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c index df1b16c97d16..916bed46be06 100644 --- a/sound/sparc/amd7930.c +++ b/sound/sparc/amd7930.c @@ -912,7 +912,7 @@ static int snd_amd7930_dev_free(struct snd_device *device) return snd_amd7930_free(amd); } -static struct snd_device_ops snd_amd7930_dev_ops = { +static const struct snd_device_ops snd_amd7930_dev_ops = { .dev_free = snd_amd7930_dev_free, }; diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index 1676d44769ad..476ffaa413d9 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c @@ -1771,7 +1771,7 @@ static int snd_cs4231_sbus_dev_free(struct snd_device *device) return snd_cs4231_sbus_free(cp); } -static struct snd_device_ops snd_cs4231_sbus_dev_ops = { +static const struct snd_device_ops snd_cs4231_sbus_dev_ops = { .dev_free = snd_cs4231_sbus_dev_free, }; @@ -1937,7 +1937,7 @@ static int snd_cs4231_ebus_dev_free(struct snd_device *device) return snd_cs4231_ebus_free(cp); } -static struct snd_device_ops snd_cs4231_ebus_dev_ops = { +static const struct snd_device_ops snd_cs4231_ebus_dev_ops = { .dev_free = snd_cs4231_ebus_dev_free, }; From patchwork Fri Jan 3 08:16:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316611 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9799B109A for ; Fri, 3 Jan 2020 08:37:53 +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 2525921D7D for ; Fri, 3 Jan 2020 08:37:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="UrVaFeyj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2525921D7D 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 731661765; Fri, 3 Jan 2020 09:37:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 731661765 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040671; bh=o8Kycd09j5jWLMuxEk6FDP1V3nomIO4gf0tuFfTz/KE=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UrVaFeyjbYvwxmoF4JB77QM18XxuKmT8iQU1NvFv/AIQ3qYmxqGGA1fWZO4s/UKXu i2TeD8yJtPSApj57TM8WQ7CKmDOgeJKlnmLVbJ9EoyAmJwJwKBSV2AGdO8julP634p 8vnslgrPTnG7jQeQ93/FOfCOjcu+reHUwukDjy0Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 97A74F803DE; Fri, 3 Jan 2020 09:19:00 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id A6C36F80362; Fri, 3 Jan 2020 09:18:15 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 00C73F8028E for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 00C73F8028E 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 68352B264 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:33 +0100 Message-Id: <20200103081714.9560-18-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 17/58] ALSA: sh: 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/sh/sh_dac_audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/sh/sh_dac_audio.c b/sound/sh/sh_dac_audio.c index b1e171dfe361..4affdc128119 100644 --- a/sound/sh/sh_dac_audio.c +++ b/sound/sh/sh_dac_audio.c @@ -325,7 +325,7 @@ static int snd_sh_dac_create(struct snd_card *card, struct snd_sh_dac *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_sh_dac_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: 11316609 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C79AF930 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 547032253D 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 547032253D 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 9CCA8174D; Fri, 3 Jan 2020 09:36:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9CCA8174D 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6619AF80351; Fri, 3 Jan 2020 09:18:14 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316591 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 385FB930 for ; Fri, 3 Jan 2020 08:31:16 +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 B8D9522314 for ; Fri, 3 Jan 2020 08:31:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="UbgDSwkF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8D9522314 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 E27731744; Fri, 3 Jan 2020 09:30:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E27731744 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040274; bh=R7zWdSVqvbuHmvMdC6nrfs+GOvn1zecZFa58RFvstyg=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=UbgDSwkF28LEVbN3aNJsERbfNtSnJtwz4voa+ZFWwNIR3s+sHsjUA9e95i5TifAQc azGlzBaeENhcQUTym0QFGvflWGHnTFA2HUVmzrSRH/I87p4+4jxnzmkVdEhjSRBHL8 odxsFrbpEmmmv1TaQvq+CC029dg2Pb1f1gSmNn0M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id ABAF6F8037D; Fri, 3 Jan 2020 09:18:30 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 566B5F8027D; Fri, 3 Jan 2020 09:17:55 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 7FB9EF8027B for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7FB9EF8027B 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 77077B268 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:35 +0100 Message-Id: <20200103081714.9560-20-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 19/58] ALSA: docs: 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" Update the documentation for adding the const prefix to snd_device_ops definitions as well. Signed-off-by: Takashi Iwai --- Documentation/sound/kernel-api/writing-an-alsa-driver.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/sound/kernel-api/writing-an-alsa-driver.rst b/Documentation/sound/kernel-api/writing-an-alsa-driver.rst index f169d58ca019..7b1ba1e447b9 100644 --- a/Documentation/sound/kernel-api/writing-an-alsa-driver.rst +++ b/Documentation/sound/kernel-api/writing-an-alsa-driver.rst @@ -259,7 +259,7 @@ to details explained in the following section. { struct mychip *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_mychip_dev_free, }; @@ -675,7 +675,7 @@ low-level device with a specified ``ops``, :: - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_mychip_dev_free, }; .... @@ -761,7 +761,7 @@ destructor and PCI entries. Example code is shown first, below. { struct mychip *chip; int err; - static struct snd_device_ops ops = { + static const struct snd_device_ops ops = { .dev_free = snd_mychip_dev_free, }; 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: 11316585 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A0BE9930 for ; Fri, 3 Jan 2020 08:29: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 3740B20848 for ; Fri, 3 Jan 2020 08:29:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="fVEqC6lM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3740B20848 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 6AD0E1714; Fri, 3 Jan 2020 09:28:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6AD0E1714 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040163; 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=fVEqC6lMbx33M9tlI3QLGrqIfe4YRYag8jWdrucKbXfeien8xihDyOd1w0op78bbc M+oL3bYc4Tdu3tmDfbF6GWO6Q4GnWe0j6PWiuw9TDoGhOPvx1eLuOPSbuHTPajEQTl XAFH8IMxSUcQAelQTL2fP1dNsJTog8xeKSm6LFc8= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id C01F8F80331; Fri, 3 Jan 2020 09:17:52 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316595 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 27F96109A for ; Fri, 3 Jan 2020 08:32:37 +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 B3F0822314 for ; Fri, 3 Jan 2020 08:32:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="NOy5T88g" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3F0822314 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 07DC91735; Fri, 3 Jan 2020 09:31:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 07DC91735 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040355; bh=8rhis4c+JZfUHt05q5FUw1A5r+5uYcOcNV01q3XqUZU=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=NOy5T88goUjQBWvWTTYsbiCL8JFCslHgncrXJ4WLbY5sNdPfM8HnoT84ecBfEY8oj QjlSdY1MOOdO9aNL+b8kem7pyvU7l60o4ODZIEoB3TJxoIxc5v4ffOrfdLXmRqrV1s BPt0Z3kgIZ65dc6/gDQbolWF+jQRMmd1Jq+U51i4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D3448F8038C; Fri, 3 Jan 2020 09:18:37 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 17BE8F80345; Fri, 3 Jan 2020 09:18:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 D8CC6F8028C for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D8CC6F8028C 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 94A2DB26A 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:37 +0100 Message-Id: <20200103081714.9560-22-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 21/58] ALSA: 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/drivers/opl3/opl3_lib.c | 4 ++-- sound/isa/gus/gus_timer.c | 4 ++-- sound/isa/wss/wss_lib.c | 2 +- sound/pci/emu10k1/timer.c | 2 +- sound/pci/ymfpci/ymfpci_main.c | 2 +- sound/sparc/cs4231.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c index 6134e5ffea0b..9259522483c8 100644 --- a/sound/drivers/opl3/opl3_lib.c +++ b/sound/drivers/opl3/opl3_lib.c @@ -214,7 +214,7 @@ static int snd_opl3_timer2_stop(struct snd_timer * timer) */ -static struct snd_timer_hardware snd_opl3_timer1 = +static const struct snd_timer_hardware snd_opl3_timer1 = { .flags = SNDRV_TIMER_HW_STOP, .resolution = 80000, @@ -223,7 +223,7 @@ static struct snd_timer_hardware snd_opl3_timer1 = .stop = snd_opl3_timer1_stop, }; -static struct snd_timer_hardware snd_opl3_timer2 = +static const struct snd_timer_hardware snd_opl3_timer2 = { .flags = SNDRV_TIMER_HW_STOP, .resolution = 320000, diff --git a/sound/isa/gus/gus_timer.c b/sound/isa/gus/gus_timer.c index 4e9664e434fe..047ddbc6192f 100644 --- a/sound/isa/gus/gus_timer.c +++ b/sound/isa/gus/gus_timer.c @@ -108,7 +108,7 @@ static void snd_gf1_interrupt_timer2(struct snd_gus_card * gus) */ -static struct snd_timer_hardware snd_gf1_timer1 = +static const struct snd_timer_hardware snd_gf1_timer1 = { .flags = SNDRV_TIMER_HW_STOP, .resolution = 80000, @@ -117,7 +117,7 @@ static struct snd_timer_hardware snd_gf1_timer1 = .stop = snd_gf1_timer1_stop, }; -static struct snd_timer_hardware snd_gf1_timer2 = +static const struct snd_timer_hardware snd_gf1_timer2 = { .flags = SNDRV_TIMER_HW_STOP, .resolution = 320000, diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c index b51b50154e8a..0d019b238399 100644 --- a/sound/isa/wss/wss_lib.c +++ b/sound/isa/wss/wss_lib.c @@ -961,7 +961,7 @@ static int snd_wss_timer_close(struct snd_timer *timer) return 0; } -static struct snd_timer_hardware snd_wss_timer_table = +static const struct snd_timer_hardware snd_wss_timer_table = { .flags = SNDRV_TIMER_HW_AUTO, .resolution = 9945, diff --git a/sound/pci/emu10k1/timer.c b/sound/pci/emu10k1/timer.c index 9ef3b999dcd6..c2803000aace 100644 --- a/sound/pci/emu10k1/timer.c +++ b/sound/pci/emu10k1/timer.c @@ -52,7 +52,7 @@ static int snd_emu10k1_timer_precise_resolution(struct snd_timer *timer, return 0; } -static struct snd_timer_hardware snd_emu10k1_timer_hw = { +static const struct snd_timer_hardware snd_emu10k1_timer_hw = { .flags = SNDRV_TIMER_HW_AUTO, .resolution = 20833, /* 1 sample @ 48KHZ = 20.833...us */ .ticks = 1024, diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index 2e20cd9d8cfc..1d9295bb00a9 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c @@ -1908,7 +1908,7 @@ static int snd_ymfpci_timer_precise_resolution(struct snd_timer *timer, return 0; } -static struct snd_timer_hardware snd_ymfpci_timer_hw = { +static const struct snd_timer_hardware snd_ymfpci_timer_hw = { .flags = SNDRV_TIMER_HW_AUTO, .resolution = 10417, /* 1 / 96 kHz = 10.41666...us */ .ticks = 0x10000, diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index 476ffaa413d9..b0e5b4a83a26 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c @@ -869,7 +869,7 @@ static int snd_cs4231_timer_close(struct snd_timer *timer) return 0; } -static struct snd_timer_hardware snd_cs4231_timer_table = { +static const struct snd_timer_hardware snd_cs4231_timer_table = { .flags = SNDRV_TIMER_HW_AUTO, .resolution = 9945, .ticks = 65535, From patchwork Fri Jan 3 08:16:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316615 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 26EBA930 for ; Fri, 3 Jan 2020 08:39:10 +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 B21CE22314 for ; Fri, 3 Jan 2020 08:39:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Vmb5usJN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B21CE22314 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 E51A01773; Fri, 3 Jan 2020 09:38:17 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E51A01773 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040748; bh=lkWV30KdVMn+iHmBYNSbK80OkGXq5HnzEG2Y7GE3iXw=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Vmb5usJNbFaM7wPrBM1gZhKcGPDxqQD6yK3VUdZvjB3XbvMyIFPnmDNgtQ0lC84gI 2fz73E98zdVS8kE243tqHGloalmJdjej4Uj+OZZlgCRSMzNiuJYiGOIVKAXQ9XCXsN q2JQS9r8mZ0mgniG64R09LXRhglC4WGlNG8XKavg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2D24BF803EA; Fri, 3 Jan 2020 09:19:04 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id B5121F80368; Fri, 3 Jan 2020 09:18:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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 37835F8028F for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 37835F8028F 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 A1813B261 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:38 +0100 Message-Id: <20200103081714.9560-23-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 22/58] ALSA: ac97: Treat snd_ac97_bus_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_ac97_bus_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/ac97_codec.h | 5 +++-- sound/ac97_bus.c | 2 +- sound/pci/ac97/ac97_codec.c | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index cc383991c0fe..49200ec26dc4 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h @@ -197,7 +197,7 @@ struct snd_ac97_bus_ops { struct snd_ac97_bus { /* -- lowlevel (hardware) driver specific -- */ - struct snd_ac97_bus_ops *ops; + const struct snd_ac97_bus_ops *ops; void *private_data; void (*private_free) (struct snd_ac97_bus *bus); /* --- */ @@ -310,7 +310,8 @@ static inline int ac97_can_spdif(struct snd_ac97 * ac97) /* functions */ /* create new AC97 bus */ -int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops, +int snd_ac97_bus(struct snd_card *card, int num, + const struct snd_ac97_bus_ops *ops, void *private_data, struct snd_ac97_bus **rbus); /* create mixer controls */ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template, diff --git a/sound/ac97_bus.c b/sound/ac97_bus.c index 3732a63a2a81..b4685c53ff11 100644 --- a/sound/ac97_bus.c +++ b/sound/ac97_bus.c @@ -55,7 +55,7 @@ static bool snd_ac97_check_id(struct snd_ac97 *ac97, unsigned int id, int snd_ac97_reset(struct snd_ac97 *ac97, bool try_warm, unsigned int id, unsigned int id_mask) { - struct snd_ac97_bus_ops *ops = ac97->bus->ops; + const struct snd_ac97_bus_ops *ops = ac97->bus->ops; if (try_warm && ops->warm_reset) { ops->warm_reset(ac97); diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 41bdec4249e1..fcfa8499e453 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c @@ -1894,7 +1894,8 @@ static int ac97_reset_wait(struct snd_ac97 *ac97, int timeout, int with_modem) * * Return: Zero if successful, or a negative error code on failure. */ -int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops, +int snd_ac97_bus(struct snd_card *card, int num, + const struct snd_ac97_bus_ops *ops, void *private_data, struct snd_ac97_bus **rbus) { int err; From patchwork Fri Jan 3 08:16:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316587 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 76AFC930 for ; Fri, 3 Jan 2020 08:29: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 032E321734 for ; Fri, 3 Jan 2020 08:29: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="vXy57W5r" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 032E321734 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 4A9B81737; Fri, 3 Jan 2020 09:29:06 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4A9B81737 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040196; bh=LRQhTw2aLFv6/NnWD91ARW5YZTThRZr/bV0vf4M8dcE=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vXy57W5rYrUnz7J+TvIrUuBAnaIzJWfazdDIeZlbgbnCmkPtgTV3uHVZNN6uO9ZF0 u2i7a8/lLBPDzYpkBbOlHRshbjO7okd+GR3au1C29s9oqWkUB2js8MUDzLDK5f2LkT WhhoK889f9vNY1ZKAhoF/qojt71hLWOIFf06VS1Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A2283F8036C; Fri, 3 Jan 2020 09:18:25 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id A59ADF80336; Fri, 3 Jan 2020 09:17:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 B9A88F8027D for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B9A88F8027D 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 AFDAAB26B 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:39 +0100 Message-Id: <20200103081714.9560-24-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 23/58] ALSA: ac97: 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/ac97/snd_ac97_compat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/ac97/snd_ac97_compat.c b/sound/ac97/snd_ac97_compat.c index 715daf141713..d2479bba75bf 100644 --- a/sound/ac97/snd_ac97_compat.c +++ b/sound/ac97/snd_ac97_compat.c @@ -53,7 +53,7 @@ static unsigned short compat_ac97_read(struct snd_ac97 *ac97, return actrl->ops->read(actrl, ac97->num, reg); } -static struct snd_ac97_bus_ops compat_snd_ac97_bus_ops = { +static const struct snd_ac97_bus_ops compat_snd_ac97_bus_ops = { .reset = compat_ac97_reset, .warm_reset = compat_ac97_warm_reset, .write = compat_ac97_write, 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: 11316593 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E38EF109A for ; Fri, 3 Jan 2020 08:31:59 +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 718C921734 for ; Fri, 3 Jan 2020 08:31: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="EFOOjcDb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 718C921734 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 BBBCE174F; Fri, 3 Jan 2020 09:31:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BBBCE174F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040317; 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=EFOOjcDbyZr+XLgEbSToYkdeJoN+50eZZxNSRc/WWgM8DXxOH2mTnUt8H2PSwZ8Qk XYg/SvcK6umpWpwAsznUoonsm0c4BTexuba9Ufy336h1UHjVu6JkI3ITyUoLVglEq7 kz8P0oI+RFIJqwEsRolKMBUNsp7oH7rwFB5TIOB8= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id B707BF80340; Fri, 3 Jan 2020 09:17:58 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316621 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77EF0930 for ; Fri, 3 Jan 2020 08:40:28 +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 0ED6F2464B for ; Fri, 3 Jan 2020 08:40:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="KxLFkit/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0ED6F2464B 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 477B81777; Fri, 3 Jan 2020 09:39:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 477B81777 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040826; bh=32raJPkSGOosZM7FePeIW7ngQL1Zlg5tYgEEczGtdsA=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=KxLFkit/iR/jNv+5liCjO86HUfGIMOFCn8vEWFR9lGa4dCTQeyL14waUfnJtEB7pr tM3JW1X0w4fk53PKwr5gHLqNumRwlcCng69WYv4rLEFeoDOBqPCohSr8Kmo8lbeEkJ utl0bctmiNiFjFxeuWH0C8ECi4hEecv829Lyc7+I= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 53E74F80406; Fri, 3 Jan 2020 09:19:06 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0DEF9F8036D; Fri, 3 Jan 2020 09:18:22 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 A7B23F8029B for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A7B23F8029B 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 C939AB26D 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:41 +0100 Message-Id: <20200103081714.9560-26-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 25/58] ALSA: atmel: 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/atmel/ac97c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c index 658b4d385249..a1dce9725b98 100644 --- a/sound/atmel/ac97c.c +++ b/sound/atmel/ac97c.c @@ -702,7 +702,7 @@ static int atmel_ac97c_probe(struct platform_device *pdev) struct atmel_ac97c *chip; struct resource *regs; struct clk *pclk; - static struct snd_ac97_bus_ops ops = { + static const struct snd_ac97_bus_ops ops = { .write = atmel_ac97c_write, .read = atmel_ac97c_read, }; From patchwork Fri Jan 3 08:16:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316599 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49BEE930 for ; Fri, 3 Jan 2020 08:34: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 C99F221734 for ; Fri, 3 Jan 2020 08:34:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="S0sTL0dB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C99F221734 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 2093A1751; Fri, 3 Jan 2020 09:33:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2093A1751 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040442; bh=tadyAfWgZ3/5ZnX0STwxUNo//TS72/COzmyxInOSb5s=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=S0sTL0dBHF/DeRRaxMMlIuoUOlM8+w3z2mxURcCZXpq+mt67Hd+1n4Ldg1xVsWsxj b6AOvdplp9b7LyPgroh5PHSCRwX2OErcYuDVA/B/lUyn1Q2whrHtrkAKYdeKt4Snul UGt2T5cwb60kMMJQaU7FU+KUqjYCIhNZOanfOrjs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3887AF803A6; Fri, 3 Jan 2020 09:18:45 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 269F5F80349; Fri, 3 Jan 2020 09:18:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 50AE7F80291 for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 50AE7F80291 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 D6CC7B26E 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:42 +0100 Message-Id: <20200103081714.9560-27-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 26/58] ALSA: drivers: 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/drivers/ml403-ac97cr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/drivers/ml403-ac97cr.c b/sound/drivers/ml403-ac97cr.c index 2cec7c5bf8fd..0a039bf4650f 100644 --- a/sound/drivers/ml403-ac97cr.c +++ b/sound/drivers/ml403-ac97cr.c @@ -1172,7 +1172,7 @@ snd_ml403_ac97cr_mixer(struct snd_ml403_ac97cr *ml403_ac97cr) 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_ml403_ac97cr_codec_write, .read = snd_ml403_ac97cr_codec_read, }; 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: 11316601 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E43D930 for ; Fri, 3 Jan 2020 08:34:46 +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 E842A21734 for ; Fri, 3 Jan 2020 08:34:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="o6xK68Qs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E842A21734 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 304661754; Fri, 3 Jan 2020 09:33:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 304661754 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040484; 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=o6xK68Qsp1RXc3EsrFYWg24VknQPreXkx7LemlqN8SSVSGpYtIhDylQDYvUb5alMi yrXuPgLxzCA5kMvPEPKKiTqYrhKzyfrmSf3B/dwcJb2QnDAz04/T9ImLSWngS6Lf9i d9ET+DH8m05Rf06OF2nj73fVKsBeqVP/JRAE6uoE= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id B925DF8034A; Fri, 3 Jan 2020 09:18:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316603 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AE106930 for ; Fri, 3 Jan 2020 08:35: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 4427821734 for ; Fri, 3 Jan 2020 08:35:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="VJQDtftJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4427821734 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 7DF4C1743; Fri, 3 Jan 2020 09:34:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7DF4C1743 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040517; bh=7qDUJqWUGIh/L5ANwDEvjKBrnGLWNONlD+9DDIEi8cs=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VJQDtftJRjNp8+r1whR555/bm+Qhv9GJUWZehgMdphBDYvWgHUSfGx4fLe1zq0oI2 bPiiFuGpBzaE3ZtuZLbdfrzkycTLdxLrAIqAlYhIRssOoxCBrlbkAgVcGA8IbcO+bi alzLTsRa6FXujgqywHLxJuzpFtgUZ6NbZRkF7nZg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 259E1F803CA; Fri, 3 Jan 2020 09:18:50 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E69C0F8034F; Fri, 3 Jan 2020 09:18:10 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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 7922DF80292 for ; Fri, 3 Jan 2020 09:17:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7922DF80292 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 F397CB270 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:44 +0100 Message-Id: <20200103081714.9560-29-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 28/58] ALSA: info: Make snd_info_entry_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" The reference to snd_info_entry_ops is rather read-only, so declare it as a const pointer. This allows a bit more optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- Documentation/sound/kernel-api/writing-an-alsa-driver.rst | 2 +- include/sound/info.h | 2 +- sound/drivers/opl4/opl4_proc.c | 2 +- sound/isa/gus/gus_mem_proc.c | 2 +- sound/pci/cs4281.c | 4 ++-- sound/pci/cs46xx/cs46xx_lib.c | 2 +- sound/pci/emu10k1/emuproc.c | 2 +- sound/pci/mixart/mixart.c | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Documentation/sound/kernel-api/writing-an-alsa-driver.rst b/Documentation/sound/kernel-api/writing-an-alsa-driver.rst index 7b1ba1e447b9..8204e3b6fea6 100644 --- a/Documentation/sound/kernel-api/writing-an-alsa-driver.rst +++ b/Documentation/sound/kernel-api/writing-an-alsa-driver.rst @@ -3912,7 +3912,7 @@ For a raw-data proc-file, set the attributes as follows: :: - static struct snd_info_entry_ops my_file_io_ops = { + static const struct snd_info_entry_ops my_file_io_ops = { .read = my_file_io_read, }; diff --git a/include/sound/info.h b/include/sound/info.h index b01a22913400..7c13bf52cc81 100644 --- a/include/sound/info.h +++ b/include/sound/info.h @@ -64,7 +64,7 @@ struct snd_info_entry { unsigned short content; union { struct snd_info_entry_text text; - struct snd_info_entry_ops *ops; + const struct snd_info_entry_ops *ops; } c; struct snd_info_entry *parent; struct module *module; diff --git a/sound/drivers/opl4/opl4_proc.c b/sound/drivers/opl4/opl4_proc.c index e0516e532969..f2149091e10a 100644 --- a/sound/drivers/opl4/opl4_proc.c +++ b/sound/drivers/opl4/opl4_proc.c @@ -76,7 +76,7 @@ static ssize_t snd_opl4_mem_proc_write(struct snd_info_entry *entry, return count; } -static struct snd_info_entry_ops snd_opl4_mem_proc_ops = { +static const struct snd_info_entry_ops snd_opl4_mem_proc_ops = { .open = snd_opl4_mem_proc_open, .release = snd_opl4_mem_proc_release, .read = snd_opl4_mem_proc_read, diff --git a/sound/isa/gus/gus_mem_proc.c b/sound/isa/gus/gus_mem_proc.c index 54510e2d78c2..b5e1d1649500 100644 --- a/sound/isa/gus/gus_mem_proc.c +++ b/sound/isa/gus/gus_mem_proc.c @@ -37,7 +37,7 @@ static void snd_gf1_mem_proc_free(struct snd_info_entry *entry) kfree(priv); } -static struct snd_info_entry_ops snd_gf1_mem_proc_ops = { +static const struct snd_info_entry_ops snd_gf1_mem_proc_ops = { .read = snd_gf1_mem_proc_dump, }; diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index 8fd64dab372d..dc89ef906c9b 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c @@ -1129,11 +1129,11 @@ static ssize_t snd_cs4281_BA1_read(struct snd_info_entry *entry, return count; } -static struct snd_info_entry_ops snd_cs4281_proc_ops_BA0 = { +static const struct snd_info_entry_ops snd_cs4281_proc_ops_BA0 = { .read = snd_cs4281_BA0_read, }; -static struct snd_info_entry_ops snd_cs4281_proc_ops_BA1 = { +static const struct snd_info_entry_ops snd_cs4281_proc_ops_BA1 = { .read = snd_cs4281_BA1_read, }; diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 3f2fe26efee3..5bb84303f577 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -2815,7 +2815,7 @@ static ssize_t snd_cs46xx_io_read(struct snd_info_entry *entry, return count; } -static struct snd_info_entry_ops snd_cs46xx_proc_io_ops = { +static const struct snd_info_entry_ops snd_cs46xx_proc_io_ops = { .read = snd_cs46xx_io_read, }; diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c index d32f256af809..637446f19598 100644 --- a/sound/pci/emu10k1/emuproc.c +++ b/sound/pci/emu10k1/emuproc.c @@ -545,7 +545,7 @@ static void snd_emu_proc_ptr_reg_read20c(struct snd_info_entry *entry, } #endif -static struct snd_info_entry_ops snd_emu10k1_proc_ops_fx8010 = { +static const struct snd_info_entry_ops snd_emu10k1_proc_ops_fx8010 = { .read = snd_emu10k1_fx8010_read, }; diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index 44009c555322..7ba487443c7f 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c @@ -1153,11 +1153,11 @@ static ssize_t snd_mixart_BA1_read(struct snd_info_entry *entry, return count; } -static struct snd_info_entry_ops snd_mixart_proc_ops_BA0 = { +static const struct snd_info_entry_ops snd_mixart_proc_ops_BA0 = { .read = snd_mixart_BA0_read, }; -static struct snd_info_entry_ops snd_mixart_proc_ops_BA1 = { +static const struct snd_info_entry_ops snd_mixart_proc_ops_BA1 = { .read = snd_mixart_BA1_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: 11316617 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 84CCF930 for ; Fri, 3 Jan 2020 08:39: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 1C5B722314 for ; Fri, 3 Jan 2020 08:39: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="sWHj9FW5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1C5B722314 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 5026B1770; Fri, 3 Jan 2020 09:39:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5026B1770 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040790; 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=sWHj9FW5Fvb/yfLWMj5YgPpqRYGJ1Gm5/pIk0Mp/D3SsrL2CZKxKcYy5QqmhMCNzy xMua7PnwxTcU56z4M5adiIeuAJO652odRaDVRj8HWlQdX7XFssqg2uonWc37AM2Bsb MtDmgV49tAzEJwwkCc1QmWLraror1ZWPdeq74uPE= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 59CE0F8028F; Fri, 3 Jan 2020 09:18:21 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316597 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B9580930 for ; Fri, 3 Jan 2020 08:33:13 +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 5084D22314 for ; Fri, 3 Jan 2020 08:33:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="KHCsDHru" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5084D22314 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 9C3FD173F; Fri, 3 Jan 2020 09:32:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9C3FD173F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040391; 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=KHCsDHrupveEb5zaanHU+kpH8vqk1nLgQs6wLSGM3dNcU6kC7qz5RnCZPRGQsRGj0 Apz8KyNpYuPl9WPaX5r3ZC4tdFskzutGZcfT11R/+GtYNv6Jwlhzv+iQaJKoqTrw2S zAkkv5v82p8rvG7hId1xqU1xsVzkth/jmEiSjpvk= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 515EDF80349; Fri, 3 Jan 2020 09:18:05 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316613 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DBD6C930 for ; Fri, 3 Jan 2020 08:38:33 +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 71F042253D for ; Fri, 3 Jan 2020 08:38:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="b5mDXep1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 71F042253D 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 A1109171F; Fri, 3 Jan 2020 09:37:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A1109171F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040711; 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=b5mDXep1AxPIUiuJ+CfKfNjIEv1uumj5e23ods9CFC2RPX3Dlv7T+ho1wa4hqtY15 +g7hrYJW8F8xesk9G1K4TntI2CIT09AwAZ0Enye11A+kpNcKr92RDJG28BNS/27tgR D6iInsI9ptN2+zqPNOFBOl0knxilhIZt9/XmGgUM= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5316CF802C2; Fri, 3 Jan 2020 09:18:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316605 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 210D4109A 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 ABAA122314 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 ABAA122314 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 E078F1761; Fri, 3 Jan 2020 09:35:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E078F1761 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id EF1E3F8034E; Fri, 3 Jan 2020 09:18:11 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316607 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B72A930 for ; Fri, 3 Jan 2020 08:36:35 +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 D4F6F22314 for ; Fri, 3 Jan 2020 08:36:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="kGQeMdMo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D4F6F22314 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 0DB0C175F; Fri, 3 Jan 2020 09:35:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0DB0C175F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040593; bh=+4hXUvbf4KwAsvRAV3+IVkHtB7VsNBAyv/k/UoXp3vk=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kGQeMdMoEk/KGb0G2wjHvitN+acjh+r8yuMui/N5di2HyFOWNBAZgpO2doNYn1Wav Pe5fDvAo8lfcF31pHeS/IBgHRKf+OcPSUTRbOK1uegM9d23xnIplNwBAvLoFmQIyzH w7Vtli5i5tMiH1MuSkEfDbZp1J5n4SchODtr1nhg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 697EBF803CF; Fri, 3 Jan 2020 09:18:54 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id C7E70F8035E; Fri, 3 Jan 2020 09:18:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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 99EE8F8029A for ; Fri, 3 Jan 2020 09:17:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 99EE8F8029A 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 3939BB275 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:49 +0100 Message-Id: <20200103081714.9560-34-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 33/58] ALSA: drivers: 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. Constify snd_kcontrol_new items There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/drivers/aloop.c | 2 +- sound/drivers/dummy.c | 2 +- sound/drivers/mts64.c | 14 +++++++------- sound/drivers/opl4/opl4_mixer.c | 2 +- sound/drivers/pcsp/pcsp_mixer.c | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index 13abb3d0893f..d78a27271d6d 100644 --- a/sound/drivers/aloop.c +++ b/sound/drivers/aloop.c @@ -1496,7 +1496,7 @@ static int loopback_channels_get(struct snd_kcontrol *kcontrol, return 0; } -static struct snd_kcontrol_new loopback_controls[] = { +static const struct snd_kcontrol_new loopback_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = "PCM Rate Shift 100000", diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index cef5b391cc44..cec682a7b88d 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -849,7 +849,7 @@ static int snd_dummy_iobox_put(struct snd_kcontrol *kcontrol, return changed; } -static struct snd_kcontrol_new snd_dummy_controls[] = { +static const struct snd_kcontrol_new snd_dummy_controls[] = { DUMMY_VOLUME("Master Volume", 0, MIXER_ADDR_MASTER), DUMMY_CAPSRC("Master Capture Switch", 0, MIXER_ADDR_MASTER), DUMMY_VOLUME("Synth Volume", 0, MIXER_ADDR_SYNTH), diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index 44776e1463cb..eeef3c0215e4 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c @@ -467,7 +467,7 @@ static int snd_mts64_ctl_smpte_switch_put(struct snd_kcontrol* kctl, return changed; } -static struct snd_kcontrol_new mts64_ctl_smpte_switch = { +static const struct snd_kcontrol_new mts64_ctl_smpte_switch = { .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI, .name = "SMPTE Playback Switch", .index = 0, @@ -540,7 +540,7 @@ static int snd_mts64_ctl_smpte_time_put(struct snd_kcontrol *kctl, return changed; } -static struct snd_kcontrol_new mts64_ctl_smpte_time_hours = { +static const struct snd_kcontrol_new mts64_ctl_smpte_time_hours = { .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI, .name = "SMPTE Time Hours", .index = 0, @@ -551,7 +551,7 @@ static struct snd_kcontrol_new mts64_ctl_smpte_time_hours = { .put = snd_mts64_ctl_smpte_time_put }; -static struct snd_kcontrol_new mts64_ctl_smpte_time_minutes = { +static const struct snd_kcontrol_new mts64_ctl_smpte_time_minutes = { .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI, .name = "SMPTE Time Minutes", .index = 0, @@ -562,7 +562,7 @@ static struct snd_kcontrol_new mts64_ctl_smpte_time_minutes = { .put = snd_mts64_ctl_smpte_time_put }; -static struct snd_kcontrol_new mts64_ctl_smpte_time_seconds = { +static const struct snd_kcontrol_new mts64_ctl_smpte_time_seconds = { .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI, .name = "SMPTE Time Seconds", .index = 0, @@ -573,7 +573,7 @@ static struct snd_kcontrol_new mts64_ctl_smpte_time_seconds = { .put = snd_mts64_ctl_smpte_time_put }; -static struct snd_kcontrol_new mts64_ctl_smpte_time_frames = { +static const struct snd_kcontrol_new mts64_ctl_smpte_time_frames = { .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI, .name = "SMPTE Time Frames", .index = 0, @@ -625,7 +625,7 @@ static int snd_mts64_ctl_smpte_fps_put(struct snd_kcontrol *kctl, return changed; } -static struct snd_kcontrol_new mts64_ctl_smpte_fps = { +static const struct snd_kcontrol_new mts64_ctl_smpte_fps = { .iface = SNDRV_CTL_ELEM_IFACE_RAWMIDI, .name = "SMPTE Fps", .index = 0, @@ -641,7 +641,7 @@ static int snd_mts64_ctl_create(struct snd_card *card, struct mts64 *mts) { int err, i; - static struct snd_kcontrol_new *control[] = { + static const struct snd_kcontrol_new *control[] = { &mts64_ctl_smpte_switch, &mts64_ctl_smpte_time_hours, &mts64_ctl_smpte_time_minutes, diff --git a/sound/drivers/opl4/opl4_mixer.c b/sound/drivers/opl4/opl4_mixer.c index 7d4b3cc0fb6c..fa1e6eff43ab 100644 --- a/sound/drivers/opl4/opl4_mixer.c +++ b/sound/drivers/opl4/opl4_mixer.c @@ -47,7 +47,7 @@ static int snd_opl4_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v return value != old_value; } -static struct snd_kcontrol_new snd_opl4_controls[] = { +static const struct snd_kcontrol_new snd_opl4_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "FM Playback Volume", diff --git a/sound/drivers/pcsp/pcsp_mixer.c b/sound/drivers/pcsp/pcsp_mixer.c index be2990451bcd..da33e5b620a7 100644 --- a/sound/drivers/pcsp/pcsp_mixer.c +++ b/sound/drivers/pcsp/pcsp_mixer.c @@ -120,17 +120,17 @@ static int pcsp_pcspkr_put(struct snd_kcontrol *kcontrol, .put = pcsp_##ctl_type##_put, \ } -static struct snd_kcontrol_new snd_pcsp_controls_pcm[] = { +static const struct snd_kcontrol_new snd_pcsp_controls_pcm[] = { PCSP_MIXER_CONTROL(enable, "Master Playback Switch"), PCSP_MIXER_CONTROL(treble, "BaseFRQ Playback Volume"), }; -static struct snd_kcontrol_new snd_pcsp_controls_spkr[] = { +static const struct snd_kcontrol_new snd_pcsp_controls_spkr[] = { PCSP_MIXER_CONTROL(pcspkr, "Beep Playback Switch"), }; static int snd_pcsp_ctls_add(struct snd_pcsp *chip, - struct snd_kcontrol_new *ctls, int num) + const struct snd_kcontrol_new *ctls, int num) { int i, err; struct snd_card *card = chip->card; 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: 11316629 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 101F6139A for ; Fri, 3 Jan 2020 08:41: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 9ABC422314 for ; Fri, 3 Jan 2020 08:41: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="aOPCPoxr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9ABC422314 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 E8517177A; Fri, 3 Jan 2020 09:40:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E8517177A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040865; 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=aOPCPoxrVTn8IyfiVA7ZWwyp73mmudjq2gsD3ET4o9FkmaphEVIQNNXhgZyelEOGY he9vVjBM/4TBouAovcGrG8F8ch6khOFK9R5WFg+BeO8yxWwplqZ9Pe4Nywx8ZBBVSq rfdVEHVpF9wzqWr+ZSTCP8TBM3D6qUn+ufrwvRhM= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E4DA4F8036D; Fri, 3 Jan 2020 09:18:22 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316637 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A7EF66C1 for ; Fri, 3 Jan 2020 08:44:01 +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 3F7DC227BF for ; Fri, 3 Jan 2020 08:44: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="W5YVtXQk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F7DC227BF 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 33C39176D; Fri, 3 Jan 2020 09:43:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 33C39176D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041039; 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=W5YVtXQksawH02OApa7bprdTvA/nXny0Gqtc3OyhI6M55QUnWpBHbH6E1+8wJeBdq xe1Qz344zwHKGtt37OYrLibhmEF1NbHI0LzZzSF2qXyGJOPOwoMM2q4dvFVZeYoQhz pGlRi7qcqt676jGCMW9ceOdW3k3dlnWH12MkWnh4= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7593AF80384; Fri, 3 Jan 2020 09:18:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=PRX_BODY_13, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316631 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF000139A for ; Fri, 3 Jan 2020 08:41:44 +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 8693321D7D for ; Fri, 3 Jan 2020 08:41:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="etpcm7UT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8693321D7D 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 CEF62177C; Fri, 3 Jan 2020 09:40:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CEF62177C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040902; bh=HO/fSfEpwNtbPPHIZvSHQDEF2+WHJ/YHx0ACxkz5N3A=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=etpcm7UTi/cvZId8h39Gu/9eRQc2xFFCFG1h0lms/n1Z/2k1C/aBcu+9vsajsrvvZ 3l5UKjrHY+Eur8qOkbIk4ZQ3EqeH7Js3v0kRll/QvzaDzwcQs88x7zfM5Lk5ckBfX5 xHaYca2G5bvyGKkYUDs/O9XPuHTj/wflO8RW73L8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0E1F9F80436; Fri, 3 Jan 2020 09:19:08 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0272DF8036F; Fri, 3 Jan 2020 09:18:25 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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 275BCF8028B for ; Fri, 3 Jan 2020 09:17:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 275BCF8028B 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 65BFEB278 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:52 +0100 Message-Id: <20200103081714.9560-37-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 36/58] ALSA: hda: 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/pci/hda/hda_codec.c | 8 ++++---- sound/pci/hda/patch_sigmatel.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 8f166bbc438b..d039eeec080f 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -2387,7 +2387,7 @@ static int snd_hda_spdif_out_switch_put(struct snd_kcontrol *kcontrol, return change; } -static struct snd_kcontrol_new dig_mixes[] = { +static const struct snd_kcontrol_new dig_mixes[] = { { .access = SNDRV_CTL_ELEM_ACCESS_READ, .iface = SNDRV_CTL_ELEM_IFACE_MIXER, @@ -2437,7 +2437,7 @@ int snd_hda_create_dig_out_ctls(struct hda_codec *codec, { int err; struct snd_kcontrol *kctl; - struct snd_kcontrol_new *dig_mix; + const struct snd_kcontrol_new *dig_mix; int idx = 0; int val = 0; const int spdif_index = 16; @@ -2655,7 +2655,7 @@ static int snd_hda_spdif_in_status_get(struct snd_kcontrol *kcontrol, return 0; } -static struct snd_kcontrol_new dig_in_ctls[] = { +static const struct snd_kcontrol_new dig_in_ctls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, SWITCH), @@ -2687,7 +2687,7 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid) { int err; struct snd_kcontrol *kctl; - struct snd_kcontrol_new *dig_mix; + const struct snd_kcontrol_new *dig_mix; int idx; idx = find_empty_mixer_ctl_idx(codec, "IEC958 Capture Switch", 0); diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 8ecb53bce509..9b816b377547 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -825,11 +825,11 @@ static int stac_auto_create_beep_ctls(struct hda_codec *codec, struct sigmatel_spec *spec = codec->spec; u32 caps = query_amp_caps(codec, nid, HDA_OUTPUT); struct snd_kcontrol_new *knew; - static struct snd_kcontrol_new abeep_mute_ctl = + static const struct snd_kcontrol_new abeep_mute_ctl = HDA_CODEC_MUTE(NULL, 0, 0, 0); - static struct snd_kcontrol_new dbeep_mute_ctl = + static const struct snd_kcontrol_new dbeep_mute_ctl = HDA_CODEC_MUTE_BEEP(NULL, 0, 0, 0); - static struct snd_kcontrol_new beep_vol_ctl = + static const struct snd_kcontrol_new beep_vol_ctl = HDA_CODEC_VOLUME(NULL, 0, 0, 0); /* check for mute support for the the amp */ From patchwork Fri Jan 3 08:16:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316643 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 763B36C1 for ; Fri, 3 Jan 2020 08:45:56 +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 0D03B21D7D for ; Fri, 3 Jan 2020 08:45:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="LJj9YazA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D03B21D7D 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 54D1A1788; Fri, 3 Jan 2020 09:45:04 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 54D1A1788 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041154; bh=S7kcLoJ8aTilTnjBZ34zYeoLTApWUKzAPh/WnQiLias=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LJj9YazAyZ6bpUdtJNPO+eRlgk2JvGNrMh3uPSJ7NjpgZ6BwIoqug0S84FYkRatIj +S5RfKlMYmPGAuPJ/bmyNiaXwRRdHpBaoHi2y7Y9F7C5bsd0oao71buFJjaj2dr4Pu rVdduWJYYy0HthzjIxI9p0wSSGPovP++zYtHpFTY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C0B46F80490; Fri, 3 Jan 2020 09:19:15 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 52F7EF80390; Fri, 3 Jan 2020 09:18:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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 1CEAFF802A2 for ; Fri, 3 Jan 2020 09:17:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1CEAFF802A2 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 77920B279 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:53 +0100 Message-Id: <20200103081714.9560-38-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 37/58] ALSA: pci: 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/pci/ak4531_codec.c | 2 +- sound/pci/ali5451/ali5451.c | 2 +- sound/pci/au88x0/au88x0_pcm.c | 2 +- sound/pci/azt3328.c | 2 +- sound/pci/ca0106/ca0106_mixer.c | 4 ++-- sound/pci/cmipci.c | 16 ++++++++-------- sound/pci/cs46xx/cs46xx_lib.c | 4 ++-- sound/pci/cs5535audio/cs5535audio_olpc.c | 2 +- sound/pci/emu10k1/emumixer.c | 14 +++++++------- sound/pci/emu10k1/p16v.c | 2 +- sound/pci/ens1370.c | 4 ++-- sound/pci/es1938.c | 2 +- sound/pci/fm801.c | 4 ++-- sound/pci/ice1712/aureon.c | 10 +++++----- sound/pci/ice1712/delta.c | 10 +++++----- sound/pci/ice1712/ews.c | 6 +++--- sound/pci/ice1712/ice1712.c | 2 +- sound/pci/ice1712/juli.c | 2 +- sound/pci/ice1712/maya44.c | 2 +- sound/pci/ice1712/phase.c | 4 ++-- sound/pci/ice1712/pontis.c | 2 +- sound/pci/ice1712/prodigy192.c | 4 ++-- sound/pci/ice1712/prodigy_hifi.c | 4 ++-- sound/pci/ice1712/quartet.c | 2 +- sound/pci/ice1712/wtm.c | 2 +- sound/pci/korg1212/korg1212.c | 2 +- sound/pci/rme32.c | 2 +- sound/pci/rme96.c | 2 +- sound/pci/rme9652/hdsp.c | 8 ++++---- sound/pci/rme9652/hdspm.c | 14 +++++++------- sound/pci/rme9652/rme9652.c | 6 +++--- sound/pci/sonicvibes.c | 6 +++--- sound/pci/ymfpci/ymfpci_main.c | 2 +- 33 files changed, 76 insertions(+), 76 deletions(-) diff --git a/sound/pci/ak4531_codec.c b/sound/pci/ak4531_codec.c index fbf9a93a8053..c00c65726a34 100644 --- a/sound/pci/ak4531_codec.c +++ b/sound/pci/ak4531_codec.c @@ -255,7 +255,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_master, -6200, 200, 0); static const DECLARE_TLV_DB_SCALE(db_scale_mono, -2800, 400, 0); static const DECLARE_TLV_DB_SCALE(db_scale_input, -5000, 200, 0); -static struct snd_kcontrol_new snd_ak4531_controls[] = { +static const struct snd_kcontrol_new snd_ak4531_controls[] = { AK4531_DOUBLE_TLV("Master Playback Switch", 0, AK4531_LMASTER, AK4531_RMASTER, 7, 7, 1, 1, diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index b2374266c52c..4f524a9dbbca 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c @@ -1776,7 +1776,7 @@ static int snd_ali5451_spdif_put(struct snd_kcontrol *kcontrol, return change; } -static struct snd_kcontrol_new snd_ali5451_mixer_spdif[] = { +static const struct snd_kcontrol_new snd_ali5451_mixer_spdif[] = { /* spdif aplayback switch */ /* FIXME: "IEC958 Playback Switch" may conflict with one on ac97_codec */ ALI5451_SPDIF(SNDRV_CTL_NAME_IEC958("Output ",NONE,SWITCH), 0, 0), diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c index 787c79aba441..2cdb7845f651 100644 --- a/sound/pci/au88x0/au88x0_pcm.c +++ b/sound/pci/au88x0/au88x0_pcm.c @@ -497,7 +497,7 @@ static int snd_vortex_spdif_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el } /* spdif controls */ -static struct snd_kcontrol_new snd_vortex_mixer_spdif[] = { +static const struct snd_kcontrol_new snd_vortex_mixer_spdif[] = { { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c index 898ba55fc0dd..73745352c55d 100644 --- a/sound/pci/azt3328.c +++ b/sound/pci/azt3328.c @@ -1094,7 +1094,7 @@ snd_azf3328_put_mixer_enum(struct snd_kcontrol *kcontrol, return (nreg != oreg); } -static struct snd_kcontrol_new snd_azf3328_mixer_controls[] = { +static const struct snd_kcontrol_new snd_azf3328_mixer_controls[] = { AZF3328_MIXER_SWITCH("Master Playback Switch", IDX_MIXER_PLAY_MASTER, 15, 1), AZF3328_MIXER_VOL_STEREO("Master Playback Volume", IDX_MIXER_PLAY_MASTER, 0x1f, 1), AZF3328_MIXER_SWITCH("PCM Playback Switch", IDX_MIXER_WAVEOUT, 15, 1), diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c index 38f7f0a8c810..729d757c900a 100644 --- a/sound/pci/ca0106/ca0106_mixer.c +++ b/sound/pci/ca0106/ca0106_mixer.c @@ -550,7 +550,7 @@ static int spi_mute_put(struct snd_kcontrol *kcontrol, .private_value = ((chid) << 8) | (reg) \ } -static struct snd_kcontrol_new snd_ca0106_volume_ctls[] = { +static const struct snd_kcontrol_new snd_ca0106_volume_ctls[] = { CA_VOLUME("Analog Front Playback Volume", CONTROL_FRONT_CHANNEL, PLAYBACK_VOLUME2), CA_VOLUME("Analog Rear Playback Volume", @@ -631,7 +631,7 @@ static struct snd_kcontrol_new snd_ca0106_volume_ctls[] = { .private_value = chid \ } -static struct snd_kcontrol_new snd_ca0106_volume_i2c_adc_ctls[] = { +static const struct snd_kcontrol_new snd_ca0106_volume_i2c_adc_ctls[] = { I2C_VOLUME("Phone Capture Volume", 0), I2C_VOLUME("Mic Capture Volume", 1), I2C_VOLUME("Line in Capture Volume", 2), diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index ff5525722d58..7f91742ed6f0 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c @@ -2256,7 +2256,7 @@ static int snd_cmipci_put_native_mixer_sensitive(struct snd_kcontrol *kcontrol, } -static struct snd_kcontrol_new snd_cmipci_mixers[] = { +static const struct snd_kcontrol_new snd_cmipci_mixers[] = { CMIPCI_SB_VOL_STEREO("Master Playback Volume", SB_DSP4_MASTER_DEV, 3, 31), CMIPCI_MIXER_SW_MONO("3D Control - Switch", CM_REG_MIXER1, CM_X3DEN_SHIFT, 0), CMIPCI_SB_VOL_STEREO("PCM Playback Volume", SB_DSP4_PCM_DEV, 3, 31), @@ -2567,7 +2567,7 @@ static int snd_cmipci_mic_in_mode_put(struct snd_kcontrol *kcontrol, } /* both for CM8338/8738 */ -static struct snd_kcontrol_new snd_cmipci_mixer_switches[] = { +static const struct snd_kcontrol_new snd_cmipci_mixer_switches[] = { DEFINE_MIXER_SWITCH("Four Channel Mode", fourch), { .name = "Line-In Mode", @@ -2579,11 +2579,11 @@ static struct snd_kcontrol_new snd_cmipci_mixer_switches[] = { }; /* for non-multichannel chips */ -static struct snd_kcontrol_new snd_cmipci_nomulti_switch = +static const struct snd_kcontrol_new snd_cmipci_nomulti_switch = DEFINE_MIXER_SWITCH("Exchange DAC", exchange_dac); /* only for CM8738 */ -static struct snd_kcontrol_new snd_cmipci_8738_mixer_switches[] = { +static const struct snd_kcontrol_new snd_cmipci_8738_mixer_switches[] = { #if 0 /* controlled in pcm device */ DEFINE_MIXER_SWITCH("IEC958 In Record", spdif_in), DEFINE_MIXER_SWITCH("IEC958 Out", spdif_out), @@ -2605,14 +2605,14 @@ static struct snd_kcontrol_new snd_cmipci_8738_mixer_switches[] = { }; /* only for model 033/037 */ -static struct snd_kcontrol_new snd_cmipci_old_mixer_switches[] = { +static const struct snd_kcontrol_new snd_cmipci_old_mixer_switches[] = { DEFINE_MIXER_SWITCH("IEC958 Mix Analog", spdif_dac_out), DEFINE_MIXER_SWITCH("IEC958 In Phase Inverse", spdi_phase), DEFINE_MIXER_SWITCH("IEC958 In Select", spdif_in_sel1), }; /* only for model 039 or later */ -static struct snd_kcontrol_new snd_cmipci_extra_mixer_switches[] = { +static const struct snd_kcontrol_new snd_cmipci_extra_mixer_switches[] = { DEFINE_MIXER_SWITCH("IEC958 In Select", spdif_in_sel2), DEFINE_MIXER_SWITCH("IEC958 In Phase Inverse", spdi_phase2), { @@ -2625,14 +2625,14 @@ static struct snd_kcontrol_new snd_cmipci_extra_mixer_switches[] = { }; /* card control switches */ -static struct snd_kcontrol_new snd_cmipci_modem_switch = +static const struct snd_kcontrol_new snd_cmipci_modem_switch = DEFINE_CARD_SWITCH("Modem", modem); static int snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_device) { struct snd_card *card; - struct snd_kcontrol_new *sw; + const struct snd_kcontrol_new *sw; struct snd_kcontrol *kctl; unsigned int idx; int err; diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 5bb84303f577..cbac9f1edc51 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -2238,7 +2238,7 @@ static int snd_cs46xx_spdif_stream_put(struct snd_kcontrol *kcontrol, #endif /* CONFIG_SND_CS46XX_NEW_DSP */ -static struct snd_kcontrol_new snd_cs46xx_controls[] = { +static const struct snd_kcontrol_new snd_cs46xx_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "DAC Volume", @@ -2364,7 +2364,7 @@ static const struct snd_kcontrol_new snd_cs46xx_front_dup_ctl = { #ifdef CONFIG_SND_CS46XX_NEW_DSP /* Only available on the Hercules Game Theater XP soundcard */ -static struct snd_kcontrol_new snd_hercules_controls[] = { +static const struct snd_kcontrol_new snd_hercules_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Optical/Coaxial SPDIF Input Switch", diff --git a/sound/pci/cs5535audio/cs5535audio_olpc.c b/sound/pci/cs5535audio/cs5535audio_olpc.c index bd246b10636e..4e295303b041 100644 --- a/sound/pci/cs5535audio/cs5535audio_olpc.c +++ b/sound/pci/cs5535audio/cs5535audio_olpc.c @@ -111,7 +111,7 @@ static int olpc_mic_put(struct snd_kcontrol *kctl, struct snd_ctl_elem_value *v) return 1; } -static struct snd_kcontrol_new olpc_cs5535audio_ctls[] = { +static const struct snd_kcontrol_new olpc_cs5535audio_ctls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "DC Mode Enable", diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c index 0b3dfc71fa69..46c79dfe9844 100644 --- a/sound/pci/emu10k1/emumixer.c +++ b/sound/pci/emu10k1/emumixer.c @@ -484,7 +484,7 @@ static int snd_emu1010_input_source_put(struct snd_kcontrol *kcontrol, .private_value = chid \ } -static struct snd_kcontrol_new snd_emu1010_output_enum_ctls[] = { +static const struct snd_kcontrol_new snd_emu1010_output_enum_ctls[] = { EMU1010_SOURCE_OUTPUT("Dock DAC1 Left Playback Enum", 0), EMU1010_SOURCE_OUTPUT("Dock DAC1 Right Playback Enum", 1), EMU1010_SOURCE_OUTPUT("Dock DAC2 Left Playback Enum", 2), @@ -513,7 +513,7 @@ static struct snd_kcontrol_new snd_emu1010_output_enum_ctls[] = { /* 1616(m) cardbus */ -static struct snd_kcontrol_new snd_emu1616_output_enum_ctls[] = { +static const struct snd_kcontrol_new snd_emu1616_output_enum_ctls[] = { EMU1010_SOURCE_OUTPUT("Dock DAC1 Left Playback Enum", 0), EMU1010_SOURCE_OUTPUT("Dock DAC1 Right Playback Enum", 1), EMU1010_SOURCE_OUTPUT("Dock DAC2 Left Playback Enum", 2), @@ -545,7 +545,7 @@ static struct snd_kcontrol_new snd_emu1616_output_enum_ctls[] = { .private_value = chid \ } -static struct snd_kcontrol_new snd_emu1010_input_enum_ctls[] = { +static const struct snd_kcontrol_new snd_emu1010_input_enum_ctls[] = { EMU1010_SOURCE_INPUT("DSP 0 Capture Enum", 0), EMU1010_SOURCE_INPUT("DSP 1 Capture Enum", 1), EMU1010_SOURCE_INPUT("DSP 2 Capture Enum", 2), @@ -613,7 +613,7 @@ static int snd_emu1010_adc_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct .private_value = chid \ } -static struct snd_kcontrol_new snd_emu1010_adc_pads[] = { +static const struct snd_kcontrol_new snd_emu1010_adc_pads[] = { EMU1010_ADC_PADS("ADC1 14dB PAD Audio Dock Capture Switch", EMU_HANA_DOCK_ADC_PAD1), EMU1010_ADC_PADS("ADC2 14dB PAD Audio Dock Capture Switch", EMU_HANA_DOCK_ADC_PAD2), EMU1010_ADC_PADS("ADC3 14dB PAD Audio Dock Capture Switch", EMU_HANA_DOCK_ADC_PAD3), @@ -661,7 +661,7 @@ static int snd_emu1010_dac_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct .private_value = chid \ } -static struct snd_kcontrol_new snd_emu1010_dac_pads[] = { +static const struct snd_kcontrol_new snd_emu1010_dac_pads[] = { EMU1010_DAC_PADS("DAC1 Audio Dock 14dB PAD Playback Switch", EMU_HANA_DOCK_DAC_PAD1), EMU1010_DAC_PADS("DAC2 Audio Dock 14dB PAD Playback Switch", EMU_HANA_DOCK_DAC_PAD2), EMU1010_DAC_PADS("DAC3 Audio Dock 14dB PAD Playback Switch", EMU_HANA_DOCK_DAC_PAD3), @@ -1051,7 +1051,7 @@ static int snd_audigy_i2c_volume_put(struct snd_kcontrol *kcontrol, } -static struct snd_kcontrol_new snd_audigy_i2c_volume_ctls[] = { +static const struct snd_kcontrol_new snd_audigy_i2c_volume_ctls[] = { I2C_VOLUME("Mic Capture Volume", 0), I2C_VOLUME("Line Capture Volume", 0) }; @@ -1125,7 +1125,7 @@ static int snd_audigy_spdif_output_rate_put(struct snd_kcontrol *kcontrol, return change; } -static struct snd_kcontrol_new snd_audigy_spdif_output_rate = +static const struct snd_kcontrol_new snd_audigy_spdif_output_rate = { .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .iface = SNDRV_CTL_ELEM_IFACE_MIXER, diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c index 1cdbad494e13..1099f102b365 100644 --- a/sound/pci/emu10k1/p16v.c +++ b/sound/pci/emu10k1/p16v.c @@ -776,7 +776,7 @@ static const DECLARE_TLV_DB_SCALE(snd_p16v_db_scale1, -5175, 25, 1); .private_value = ((xreg) | ((xhl) << 8)) \ } -static struct snd_kcontrol_new p16v_mixer_controls[] = { +static const struct snd_kcontrol_new p16v_mixer_controls[] = { P16V_VOL("HD Analog Front Playback Volume", PLAYBACK_VOLUME_MIXER9, 0), P16V_VOL("HD Analog Rear Playback Volume", PLAYBACK_VOLUME_MIXER10, 1), P16V_VOL("HD Analog Center/LFE Playback Volume", PLAYBACK_VOLUME_MIXER9, 1), diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 15e6d2377ecf..4f8202980b61 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c @@ -1433,7 +1433,7 @@ static int snd_es1371_spdif_put(struct snd_kcontrol *kcontrol, /* spdif controls */ -static struct snd_kcontrol_new snd_es1371_mixer_spdif[] = { +static const struct snd_kcontrol_new snd_es1371_mixer_spdif[] = { ES1371_SPDIF(SNDRV_CTL_NAME_IEC958("",PLAYBACK,SWITCH)), { .iface = SNDRV_CTL_ELEM_IFACE_PCM, @@ -1698,7 +1698,7 @@ static int snd_ensoniq_control_put(struct snd_kcontrol *kcontrol, * ENS1370 mixer */ -static struct snd_kcontrol_new snd_es1370_controls[2] = { +static const struct snd_kcontrol_new snd_es1370_controls[2] = { ENSONIQ_CONTROL("PCM 0 Output also on Line-In Jack", ES_1370_XCTL0), ENSONIQ_CONTROL("Mic +5V bias", ES_1370_XCTL1) }; diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c index 9d5568509387..8336b20fbafc 100644 --- a/sound/pci/es1938.c +++ b/sound/pci/es1938.c @@ -1307,7 +1307,7 @@ static const DECLARE_TLV_DB_RANGE(db_scale_line, static const DECLARE_TLV_DB_SCALE(db_scale_capture, 0, 150, 0); -static struct snd_kcontrol_new snd_es1938_controls[] = { +static const struct snd_kcontrol_new snd_es1938_controls[] = { ES1938_DOUBLE_TLV("Master Playback Volume", 0, 0x60, 0x62, 0, 0, 63, 0, db_scale_master), ES1938_DOUBLE("Master Playback Switch", 0, 0x60, 0x62, 6, 6, 1, 1), diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index ae2b413ff489..4117a053eb18 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c @@ -969,7 +969,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_dsp, -3450, 150, 0); #define FM801_CONTROLS ARRAY_SIZE(snd_fm801_controls) -static struct snd_kcontrol_new snd_fm801_controls[] = { +static const struct snd_kcontrol_new snd_fm801_controls[] = { FM801_DOUBLE_TLV("Wave Playback Volume", FM801_PCM_VOL, 0, 8, 31, 1, db_scale_dsp), FM801_SINGLE("Wave Playback Switch", FM801_PCM_VOL, 15, 1, 1), @@ -990,7 +990,7 @@ FM801_SINGLE("FM Playback Switch", FM801_FM_VOL, 15, 1, 1), #define FM801_CONTROLS_MULTI ARRAY_SIZE(snd_fm801_controls_multi) -static struct snd_kcontrol_new snd_fm801_controls_multi[] = { +static const struct snd_kcontrol_new snd_fm801_controls_multi[] = { FM801_SINGLE("AC97 2ch->4ch Copy Switch", FM801_CODEC_CTRL, 7, 1, 0), FM801_SINGLE("AC97 18-bit Switch", FM801_CODEC_CTRL, 10, 1, 0), FM801_SINGLE(SNDRV_CTL_NAME_IEC958("",CAPTURE,SWITCH), FM801_I2S_MODE, 8, 1, 0), diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c index 4556ba76b791..025fe7820620 100644 --- a/sound/pci/ice1712/aureon.c +++ b/sound/pci/ice1712/aureon.c @@ -1389,7 +1389,7 @@ static int aureon_oversampling_put(struct snd_kcontrol *kcontrol, struct snd_ctl * mixers */ -static struct snd_kcontrol_new aureon_dac_controls[] = { +static const struct snd_kcontrol_new aureon_dac_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Master Playback Switch", @@ -1504,7 +1504,7 @@ static struct snd_kcontrol_new aureon_dac_controls[] = { } }; -static struct snd_kcontrol_new wm_controls[] = { +static const struct snd_kcontrol_new wm_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "PCM Playback Switch", @@ -1570,7 +1570,7 @@ static struct snd_kcontrol_new wm_controls[] = { } }; -static struct snd_kcontrol_new ac97_controls[] = { +static const struct snd_kcontrol_new ac97_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "AC97 Playback Switch", @@ -1675,7 +1675,7 @@ static struct snd_kcontrol_new ac97_controls[] = { } }; -static struct snd_kcontrol_new universe_ac97_controls[] = { +static const struct snd_kcontrol_new universe_ac97_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "AC97 Playback Switch", @@ -1807,7 +1807,7 @@ static struct snd_kcontrol_new universe_ac97_controls[] = { }; -static struct snd_kcontrol_new cs8415_controls[] = { +static const struct snd_kcontrol_new cs8415_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = SNDRV_CTL_NAME_IEC958("", CAPTURE, SWITCH), diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c index 519c9fbcff1e..81929063b2fa 100644 --- a/sound/pci/ice1712/delta.c +++ b/sound/pci/ice1712/delta.c @@ -753,15 +753,15 @@ static int snd_ice1712_delta_init(struct snd_ice1712 *ice) * additional controls for M-Audio cards */ -static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_select = +static const struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_select = ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_WORD_CLOCK_SELECT, 1, 0); -static struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_select = +static const struct snd_kcontrol_new snd_ice1712_delta1010lt_wordclock_select = ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Sync", 0, ICE1712_DELTA_1010LT_WORDCLOCK, 0, 0); -static struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_status = +static const struct snd_kcontrol_new snd_ice1712_delta1010_wordclock_status = ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Word Clock Status", 0, ICE1712_DELTA_WORD_CLOCK_STATUS, 1, SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE); -static struct snd_kcontrol_new snd_ice1712_deltadio2496_spdif_in_select = +static const struct snd_kcontrol_new snd_ice1712_deltadio2496_spdif_in_select = ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, ICE1712_DELTA_SPDIF_INPUT_SELECT, 0, 0); -static struct snd_kcontrol_new snd_ice1712_delta_spdif_in_status = +static const struct snd_kcontrol_new snd_ice1712_delta_spdif_in_status = ICE1712_GPIO(SNDRV_CTL_ELEM_IFACE_MIXER, "Delta IEC958 Input Status", 0, ICE1712_DELTA_SPDIF_IN_STAT, 1, SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE); diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c index fe08dd9f1564..3794308313bf 100644 --- a/sound/pci/ice1712/ews.c +++ b/sound/pci/ice1712/ews.c @@ -597,7 +597,7 @@ static int snd_ice1712_ewx_io_sense_put(struct snd_kcontrol *kcontrol, struct sn return val != nval; } -static struct snd_kcontrol_new snd_ice1712_ewx2496_controls[] = { +static const struct snd_kcontrol_new snd_ice1712_ewx2496_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Input Sensitivity Switch", @@ -792,7 +792,7 @@ static int snd_ice1712_ews88d_control_put(struct snd_kcontrol *kcontrol, struct .private_value = xshift | (xinvert << 8),\ } -static struct snd_kcontrol_new snd_ice1712_ews88d_controls[] = { +static const struct snd_kcontrol_new snd_ice1712_ews88d_controls[] = { EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "IEC958 Input Optical", 0, 1, 0), /* inverted */ EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT Output Optical", 1, 0, 0), EWS88D_CONTROL(SNDRV_CTL_ELEM_IFACE_MIXER, "ADAT External Master Clock", 2, 0, 0), @@ -928,7 +928,7 @@ static int snd_ice1712_6fire_select_input_put(struct snd_kcontrol *kcontrol, str .private_value = xshift | (xinvert << 8),\ } -static struct snd_kcontrol_new snd_ice1712_6fire_controls[] = { +static const struct snd_kcontrol_new snd_ice1712_6fire_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Analog Input Select", diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 9794bbedffc3..5202e4c06fc4 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c @@ -1335,7 +1335,7 @@ static int snd_ice1712_pro_mixer_volume_put(struct snd_kcontrol *kcontrol, struc static const DECLARE_TLV_DB_SCALE(db_scale_playback, -14400, 150, 0); -static struct snd_kcontrol_new snd_ice1712_multi_playback_ctrls[] = { +static const struct snd_kcontrol_new snd_ice1712_multi_playback_ctrls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Multi Playback Switch", diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c index 0da7e940f264..079e58ec8b09 100644 --- a/sound/pci/ice1712/juli.c +++ b/sound/pci/ice1712/juli.c @@ -343,7 +343,7 @@ static int juli_mute_put(struct snd_kcontrol *kcontrol, return 0; } -static struct snd_kcontrol_new juli_mute_controls[] = { +static const struct snd_kcontrol_new juli_mute_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Master Playback Switch", diff --git a/sound/pci/ice1712/maya44.c b/sound/pci/ice1712/maya44.c index 3af5abed1e3c..c2761e009c67 100644 --- a/sound/pci/ice1712/maya44.c +++ b/sound/pci/ice1712/maya44.c @@ -424,7 +424,7 @@ static int maya_pb_route_put(struct snd_kcontrol *kcontrol, * controls to be added */ -static struct snd_kcontrol_new maya_controls[] = { +static const struct snd_kcontrol_new maya_controls[] = { { .name = "Crossmix Playback Volume", .iface = SNDRV_CTL_ELEM_IFACE_MIXER, diff --git a/sound/pci/ice1712/phase.c b/sound/pci/ice1712/phase.c index 699051154bf9..ced4a2bfd08e 100644 --- a/sound/pci/ice1712/phase.c +++ b/sound/pci/ice1712/phase.c @@ -745,7 +745,7 @@ static int phase28_oversampling_put(struct snd_kcontrol *kcontrol, static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); static const DECLARE_TLV_DB_SCALE(db_scale_wm_pcm, -6400, 50, 1); -static struct snd_kcontrol_new phase28_dac_controls[] = { +static const struct snd_kcontrol_new phase28_dac_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Master Playback Switch", @@ -860,7 +860,7 @@ static struct snd_kcontrol_new phase28_dac_controls[] = { } }; -static struct snd_kcontrol_new wm_controls[] = { +static const struct snd_kcontrol_new wm_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "PCM Playback Switch", diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c index 56cbc966d7a9..8ddb6c35a5e6 100644 --- a/sound/pci/ice1712/pontis.c +++ b/sound/pci/ice1712/pontis.c @@ -529,7 +529,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_volume, -6400, 50, 1); * mixers */ -static struct snd_kcontrol_new pontis_controls[] = { +static const struct snd_kcontrol_new pontis_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | diff --git a/sound/pci/ice1712/prodigy192.c b/sound/pci/ice1712/prodigy192.c index 98f8ac658796..105716961e39 100644 --- a/sound/pci/ice1712/prodigy192.c +++ b/sound/pci/ice1712/prodigy192.c @@ -346,7 +346,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_adc, 0, 150, 0); * mixers */ -static struct snd_kcontrol_new stac_controls[] = { +static const struct snd_kcontrol_new stac_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Master Playback Switch", @@ -578,7 +578,7 @@ static int ak4114_input_sw_put(struct snd_kcontrol *kcontrol, } -static struct snd_kcontrol_new ak4114_controls[] = { +static const struct snd_kcontrol_new ak4114_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "MIODIO IEC958 Capture Input", diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c index 9d71e9d5c9a0..ba37f7eab166 100644 --- a/sound/pci/ice1712/prodigy_hifi.c +++ b/sound/pci/ice1712/prodigy_hifi.c @@ -284,7 +284,7 @@ static int ak4396_dac_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem static const DECLARE_TLV_DB_SCALE(db_scale_wm_dac, -12700, 100, 1); static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); -static struct snd_kcontrol_new prodigy_hd2_controls[] = { +static const struct snd_kcontrol_new prodigy_hd2_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | @@ -741,7 +741,7 @@ static int wm_chswap_put(struct snd_kcontrol *kcontrol, * mixers */ -static struct snd_kcontrol_new prodigy_hifi_controls[] = { +static const struct snd_kcontrol_new prodigy_hifi_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | diff --git a/sound/pci/ice1712/quartet.c b/sound/pci/ice1712/quartet.c index 9e2149fd42f8..bfd811a08d90 100644 --- a/sound/pci/ice1712/quartet.c +++ b/sound/pci/ice1712/quartet.c @@ -720,7 +720,7 @@ static int qtet_sw_put(struct snd_kcontrol *kcontrol, .put = qtet_sw_put,\ .private_value = xpriv } -static struct snd_kcontrol_new qtet_controls[] = { +static const struct snd_kcontrol_new qtet_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Master Playback Switch", diff --git a/sound/pci/ice1712/wtm.c b/sound/pci/ice1712/wtm.c index 4ca96ec6d687..4a7315ad51e8 100644 --- a/sound/pci/ice1712/wtm.c +++ b/sound/pci/ice1712/wtm.c @@ -477,7 +477,7 @@ static const DECLARE_TLV_DB_SCALE(db_scale_adc, 0, 150, 0); /* * Control tabs */ -static struct snd_kcontrol_new stac9640_controls[] = { +static const struct snd_kcontrol_new stac9640_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE | diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index f605926a0709..685a60551c71 100644 --- a/sound/pci/korg1212/korg1212.c +++ b/sound/pci/korg1212/korg1212.c @@ -2019,7 +2019,7 @@ static int snd_korg1212_control_sync_put(struct snd_kcontrol *kcontrol, .private_value = ord, \ } -static struct snd_kcontrol_new snd_korg1212_controls[] = { +static const struct snd_kcontrol_new snd_korg1212_controls[] = { MON_MIXER(8, "Analog"), MON_MIXER(10, "SPDIF"), MON_MIXER(0, "ADAT-1"), MON_MIXER(1, "ADAT-2"), MON_MIXER(2, "ADAT-3"), MON_MIXER(3, "ADAT-4"), diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c index 15029b2be233..16d726da74bf 100644 --- a/sound/pci/rme32.c +++ b/sound/pci/rme32.c @@ -1796,7 +1796,7 @@ static int snd_rme32_control_spdif_mask_get(struct snd_kcontrol *kcontrol, return 0; } -static struct snd_kcontrol_new snd_rme32_controls[] = { +static const struct snd_kcontrol_new snd_rme32_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, DEFAULT), diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c index 537381632be7..db576b7e5d5b 100644 --- a/sound/pci/rme96.c +++ b/sound/pci/rme96.c @@ -2253,7 +2253,7 @@ snd_rme96_dac_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu return change; } -static struct snd_kcontrol_new snd_rme96_controls[] = { +static const struct snd_kcontrol_new snd_rme96_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index b4c42c4fa201..632f7878ff3e 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c @@ -2879,7 +2879,7 @@ static int snd_hdsp_put_dds_offset(struct snd_kcontrol *kcontrol, struct snd_ctl return change; } -static struct snd_kcontrol_new snd_hdsp_9632_controls[] = { +static const struct snd_kcontrol_new snd_hdsp_9632_controls[] = { HDSP_DA_GAIN("DA Gain", 0), HDSP_AD_GAIN("AD Gain", 0), HDSP_PHONE_GAIN("Phones Gain", 0), @@ -2887,7 +2887,7 @@ HDSP_TOGGLE_SETTING("XLR Breakout Cable", HDSP_XLRBreakoutCable), HDSP_DDS_OFFSET("DDS Sample Rate Offset", 0) }; -static struct snd_kcontrol_new snd_hdsp_controls[] = { +static const struct snd_kcontrol_new snd_hdsp_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), @@ -3216,7 +3216,7 @@ static int snd_hdsp_info_rpm_disconnect(struct snd_kcontrol *kcontrol, struct sn return snd_ctl_enum_info(uinfo, 1, 2, texts); } -static struct snd_kcontrol_new snd_hdsp_rpm_controls[] = { +static const struct snd_kcontrol_new snd_hdsp_rpm_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "RPM Bypass", @@ -3249,7 +3249,7 @@ static struct snd_kcontrol_new snd_hdsp_rpm_controls[] = { HDSP_MIXER("Mixer", 0) }; -static struct snd_kcontrol_new snd_hdsp_96xx_aeb = +static const struct snd_kcontrol_new snd_hdsp_96xx_aeb = HDSP_TOGGLE_SETTING("Analog Extension Board", HDSP_AnalogExtensionBoard); static struct snd_kcontrol_new snd_hdsp_adat_sync_check = HDSP_ADAT_SYNC_CHECK; diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 9e3263395f98..f926899e4755 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -4478,7 +4478,7 @@ static int snd_hdspm_put_tco_word_term(struct snd_kcontrol *kcontrol, -static struct snd_kcontrol_new snd_hdspm_controls_madi[] = { +static const struct snd_kcontrol_new snd_hdspm_controls_madi[] = { HDSPM_MIXER("Mixer", 0), HDSPM_INTERNAL_CLOCK("Internal Clock", 0), HDSPM_SYSTEM_CLOCK_MODE("System Clock Mode", 0), @@ -4500,7 +4500,7 @@ static struct snd_kcontrol_new snd_hdspm_controls_madi[] = { }; -static struct snd_kcontrol_new snd_hdspm_controls_madiface[] = { +static const struct snd_kcontrol_new snd_hdspm_controls_madiface[] = { HDSPM_MIXER("Mixer", 0), HDSPM_INTERNAL_CLOCK("Internal Clock", 0), HDSPM_SYSTEM_CLOCK_MODE("System Clock Mode", 0), @@ -4513,7 +4513,7 @@ static struct snd_kcontrol_new snd_hdspm_controls_madiface[] = { HDSPM_MADI_SPEEDMODE("MADI Speed Mode", 0) }; -static struct snd_kcontrol_new snd_hdspm_controls_aio[] = { +static const struct snd_kcontrol_new snd_hdspm_controls_aio[] = { HDSPM_MIXER("Mixer", 0), HDSPM_INTERNAL_CLOCK("Internal Clock", 0), HDSPM_SYSTEM_CLOCK_MODE("System Clock Mode", 0), @@ -4554,7 +4554,7 @@ static struct snd_kcontrol_new snd_hdspm_controls_aio[] = { */ }; -static struct snd_kcontrol_new snd_hdspm_controls_raydat[] = { +static const struct snd_kcontrol_new snd_hdspm_controls_raydat[] = { HDSPM_MIXER("Mixer", 0), HDSPM_INTERNAL_CLOCK("Internal Clock", 0), HDSPM_SYSTEM_CLOCK_MODE("Clock Mode", 0), @@ -4582,7 +4582,7 @@ static struct snd_kcontrol_new snd_hdspm_controls_raydat[] = { HDSPM_TOGGLE_SETTING("Single Speed WordClock Out", HDSPM_c0_Wck48) }; -static struct snd_kcontrol_new snd_hdspm_controls_aes32[] = { +static const struct snd_kcontrol_new snd_hdspm_controls_aes32[] = { HDSPM_MIXER("Mixer", 0), HDSPM_INTERNAL_CLOCK("Internal Clock", 0), HDSPM_SYSTEM_CLOCK_MODE("System Clock Mode", 0), @@ -4624,7 +4624,7 @@ static struct snd_kcontrol_new snd_hdspm_controls_aes32[] = { /* Control elements for the optional TCO module */ -static struct snd_kcontrol_new snd_hdspm_controls_tco[] = { +static const struct snd_kcontrol_new snd_hdspm_controls_tco[] = { HDSPM_TCO_SAMPLE_RATE("TCO Sample Rate", 0), HDSPM_TCO_PULL("TCO Pull", 0), HDSPM_TCO_WCK_CONVERSION("TCO WCK Conversion", 0), @@ -4671,7 +4671,7 @@ static int snd_hdspm_create_controls(struct snd_card *card, unsigned int idx, limit; int err; struct snd_kcontrol *kctl; - struct snd_kcontrol_new *list = NULL; + const struct snd_kcontrol_new *list = NULL; switch (hdspm->io_type) { case MADI: diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c index 6fda027d28a4..2cb5b03f84d3 100644 --- a/sound/pci/rme9652/rme9652.c +++ b/sound/pci/rme9652/rme9652.c @@ -1454,7 +1454,7 @@ static int snd_rme9652_get_tc_value(void *private_data, #endif /* ALSA_HAS_STANDARD_WAY_OF_RETURNING_TIMECODE */ -static struct snd_kcontrol_new snd_rme9652_controls[] = { +static const struct snd_kcontrol_new snd_rme9652_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), @@ -1509,10 +1509,10 @@ RME9652_TC_VALID("Timecode Valid", 0), RME9652_PASSTHRU("Passthru", 0) }; -static struct snd_kcontrol_new snd_rme9652_adat3_check = +static const struct snd_kcontrol_new snd_rme9652_adat3_check = RME9652_ADAT_SYNC("ADAT3 Sync Check", 0, 2); -static struct snd_kcontrol_new snd_rme9652_adat1_input = +static const struct snd_kcontrol_new snd_rme9652_adat1_input = RME9652_ADAT1_IN("ADAT1 Input Source", 0); static int snd_rme9652_create_controls(struct snd_card *card, struct snd_rme9652 *rme9652) diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c index dcdf5a534c4e..ecdd54d7a4e1 100644 --- a/sound/pci/sonicvibes.c +++ b/sound/pci/sonicvibes.c @@ -1050,7 +1050,7 @@ static int snd_sonicvibes_put_double(struct snd_kcontrol *kcontrol, struct snd_c return change; } -static struct snd_kcontrol_new snd_sonicvibes_controls[] = { +static const struct snd_kcontrol_new snd_sonicvibes_controls[] = { SONICVIBES_DOUBLE("Capture Volume", 0, SV_IREG_LEFT_ADC, SV_IREG_RIGHT_ADC, 0, 0, 15, 0), SONICVIBES_DOUBLE("Aux Playback Switch", 0, SV_IREG_LEFT_AUX1, SV_IREG_RIGHT_AUX1, 7, 7, 1, 1), SONICVIBES_DOUBLE("Aux Playback Volume", 0, SV_IREG_LEFT_AUX1, SV_IREG_RIGHT_AUX1, 0, 0, 31, 1), @@ -1149,7 +1149,7 @@ static void snd_sonicvibes_proc_init(struct sonicvibes *sonic) */ #ifdef SUPPORT_JOYSTICK -static struct snd_kcontrol_new snd_sonicvibes_game_control = +static const struct snd_kcontrol_new snd_sonicvibes_game_control = SONICVIBES_SINGLE("Joystick Speed", 0, SV_IREG_GAME_PORT, 1, 15, 0); static int snd_sonicvibes_create_gameport(struct sonicvibes *sonic) @@ -1375,7 +1375,7 @@ static int snd_sonicvibes_create(struct snd_card *card, * MIDI section */ -static struct snd_kcontrol_new snd_sonicvibes_midi_controls[] = { +static const struct snd_kcontrol_new snd_sonicvibes_midi_controls[] = { SONICVIBES_SINGLE("SonicVibes Wave Source RAM", 0, SV_IREG_WAVE_SOURCE, 0, 1, 0), SONICVIBES_SINGLE("SonicVibes Wave Source RAM+ROM", 0, SV_IREG_WAVE_SOURCE, 1, 1, 0), SONICVIBES_SINGLE("SonicVibes Onboard Synth", 0, SV_IREG_MPU401, 0, 1, 0), diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index a531f4d2605d..1cffd988b616 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c @@ -1588,7 +1588,7 @@ static const struct snd_kcontrol_new snd_ymfpci_dup4ch = { .put = snd_ymfpci_put_dup4ch, }; -static struct snd_kcontrol_new snd_ymfpci_controls[] = { +static const struct snd_kcontrol_new snd_ymfpci_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Wave Playback Volume", From patchwork Fri Jan 3 08:16:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316639 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8833A6C1 for ; Fri, 3 Jan 2020 08:44:32 +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 1EE342464B for ; Fri, 3 Jan 2020 08:44:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="OW7WZoAL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1EE342464B 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 613881760; Fri, 3 Jan 2020 09:43:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 613881760 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041070; bh=0lOXqSEWKoJBl6MH/opTbRCVSml21dovETLgrqZ0Smk=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OW7WZoALm/2Z9l9P+2W6rp8n1Z+mdiDrfEh4w4uMtBZPLq6PfyWi3xhDiy20T8zau BM6Dqq5qfymMCrn0bkmlVr7zV6zwm1993obgVxxZxVPnWU/mOoOJ9aZafBCOrieeFm 8yFrOkTwuXU5HDJWRxf26S9DmhrIer/sMDOKlv2g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 85065F80476; Fri, 3 Jan 2020 09:19:13 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D9D4AF80383; Fri, 3 Jan 2020 09:18:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 D6314F802A9 for ; Fri, 3 Jan 2020 09:17:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D6314F802A9 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 89BE4B27B 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:54 +0100 Message-Id: <20200103081714.9560-39-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 38/58] ALSA: ppc: 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/ppc/awacs.c | 50 +++++++++++++++++++++++++------------------------- sound/ppc/burgundy.c | 20 ++++++++++---------- sound/ppc/daca.c | 2 +- sound/ppc/pmac.c | 2 +- sound/ppc/snd_ps3.c | 2 +- sound/ppc/tumbler.c | 4 ++-- 6 files changed, 40 insertions(+), 40 deletions(-) diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c index 359d22a81ae3..73c0fd7277e6 100644 --- a/sound/ppc/awacs.c +++ b/sound/ppc/awacs.c @@ -464,7 +464,7 @@ static int snd_pmac_awacs_put_master_amp(struct snd_kcontrol *kcontrol, #define AMP_CH_SPK 0 #define AMP_CH_HD 1 -static struct snd_kcontrol_new snd_pmac_awacs_amp_vol[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_amp_vol[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Speaker Playback Volume", .info = snd_pmac_awacs_info_volume_amp, @@ -582,46 +582,46 @@ static int snd_pmac_screamer_mic_boost_put(struct snd_kcontrol *kcontrol, /* * lists of mixer elements */ -static struct snd_kcontrol_new snd_pmac_awacs_mixers[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mixers[] = { AWACS_SWITCH("Master Capture Switch", 1, SHIFT_LOOPTHRU, 0), AWACS_VOLUME("Master Capture Volume", 0, 4, 0), /* AWACS_SWITCH("Unknown Playback Switch", 6, SHIFT_PAROUT0, 0), */ }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers_beige[] = { +static const struct snd_kcontrol_new snd_pmac_screamer_mixers_beige[] = { AWACS_VOLUME("Master Playback Volume", 2, 6, 1), AWACS_VOLUME("Play-through Playback Volume", 5, 6, 1), AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0), AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_LINE, 0), }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers_lo[] = { +static const struct snd_kcontrol_new snd_pmac_screamer_mixers_lo[] = { AWACS_VOLUME("Line out Playback Volume", 2, 6, 1), }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers_imac[] = { +static const struct snd_kcontrol_new snd_pmac_screamer_mixers_imac[] = { AWACS_VOLUME("Play-through Playback Volume", 5, 6, 1), AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers_g4agp[] = { +static const struct snd_kcontrol_new snd_pmac_screamer_mixers_g4agp[] = { AWACS_VOLUME("Line out Playback Volume", 2, 6, 1), AWACS_VOLUME("Master Playback Volume", 5, 6, 1), AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0), }; -static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac7500[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac7500[] = { AWACS_VOLUME("Line out Playback Volume", 2, 6, 1), AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0), }; -static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac5500[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac5500[] = { AWACS_VOLUME("Headphone Playback Volume", 2, 6, 1), }; -static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac[] = { AWACS_VOLUME("Master Playback Volume", 2, 6, 1), AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), }; @@ -629,34 +629,34 @@ static struct snd_kcontrol_new snd_pmac_awacs_mixers_pmac[] = { /* FIXME: is this correct order? * screamer (powerbook G3 pismo) seems to have different bits... */ -static struct snd_kcontrol_new snd_pmac_awacs_mixers2[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mixers2[] = { AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_LINE, 0), AWACS_SWITCH("Mic Capture Switch", 0, SHIFT_MUX_MIC, 0), }; -static struct snd_kcontrol_new snd_pmac_screamer_mixers2[] = { +static const struct snd_kcontrol_new snd_pmac_screamer_mixers2[] = { AWACS_SWITCH("Line Capture Switch", 0, SHIFT_MUX_MIC, 0), AWACS_SWITCH("Mic Capture Switch", 0, SHIFT_MUX_LINE, 0), }; -static struct snd_kcontrol_new snd_pmac_awacs_mixers2_pmac5500[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mixers2_pmac5500[] = { AWACS_SWITCH("CD Capture Switch", 0, SHIFT_MUX_CD, 0), }; -static struct snd_kcontrol_new snd_pmac_awacs_master_sw = +static const struct snd_kcontrol_new snd_pmac_awacs_master_sw = AWACS_SWITCH("Master Playback Switch", 1, SHIFT_HDMUTE, 1); -static struct snd_kcontrol_new snd_pmac_awacs_master_sw_imac = +static const struct snd_kcontrol_new snd_pmac_awacs_master_sw_imac = AWACS_SWITCH("Line out Playback Switch", 1, SHIFT_HDMUTE, 1); -static struct snd_kcontrol_new snd_pmac_awacs_master_sw_pmac5500 = +static const struct snd_kcontrol_new snd_pmac_awacs_master_sw_pmac5500 = AWACS_SWITCH("Headphone Playback Switch", 1, SHIFT_HDMUTE, 1); -static struct snd_kcontrol_new snd_pmac_awacs_mic_boost[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_mic_boost[] = { AWACS_SWITCH("Mic Boost Capture Switch", 0, SHIFT_GAINLINE, 0), }; -static struct snd_kcontrol_new snd_pmac_screamer_mic_boost[] = { +static const struct snd_kcontrol_new snd_pmac_screamer_mic_boost[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Mic Boost Capture Volume", .info = snd_pmac_screamer_mic_boost_info, @@ -665,34 +665,34 @@ static struct snd_kcontrol_new snd_pmac_screamer_mic_boost[] = { }, }; -static struct snd_kcontrol_new snd_pmac_awacs_mic_boost_pmac7500[] = +static const struct snd_kcontrol_new snd_pmac_awacs_mic_boost_pmac7500[] = { AWACS_SWITCH("Line Boost Capture Switch", 0, SHIFT_GAINLINE, 0), }; -static struct snd_kcontrol_new snd_pmac_screamer_mic_boost_beige[] = +static const struct snd_kcontrol_new snd_pmac_screamer_mic_boost_beige[] = { AWACS_SWITCH("Line Boost Capture Switch", 0, SHIFT_GAINLINE, 0), AWACS_SWITCH("CD Boost Capture Switch", 6, SHIFT_MIC_BOOST, 0), }; -static struct snd_kcontrol_new snd_pmac_screamer_mic_boost_imac[] = +static const struct snd_kcontrol_new snd_pmac_screamer_mic_boost_imac[] = { AWACS_SWITCH("Line Boost Capture Switch", 0, SHIFT_GAINLINE, 0), AWACS_SWITCH("Mic Boost Capture Switch", 6, SHIFT_MIC_BOOST, 0), }; -static struct snd_kcontrol_new snd_pmac_awacs_speaker_vol[] = { +static const struct snd_kcontrol_new snd_pmac_awacs_speaker_vol[] = { AWACS_VOLUME("Speaker Playback Volume", 4, 6, 1), }; -static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw = +static const struct snd_kcontrol_new snd_pmac_awacs_speaker_sw = AWACS_SWITCH("Speaker Playback Switch", 1, SHIFT_SPKMUTE, 1); -static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac1 = +static const struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac1 = AWACS_SWITCH("Speaker Playback Switch", 1, SHIFT_PAROUT1, 1); -static struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac2 = +static const struct snd_kcontrol_new snd_pmac_awacs_speaker_sw_imac2 = AWACS_SWITCH("Speaker Playback Switch", 1, SHIFT_PAROUT1, 0); @@ -700,7 +700,7 @@ AWACS_SWITCH("Speaker Playback Switch", 1, SHIFT_PAROUT1, 0); * add new mixer elements to the card */ static int build_mixers(struct snd_pmac *chip, int nums, - struct snd_kcontrol_new *mixers) + const struct snd_kcontrol_new *mixers) { int i, err; diff --git a/sound/ppc/burgundy.c b/sound/ppc/burgundy.c index a2a41e5245ef..4fb990ab2ceb 100644 --- a/sound/ppc/burgundy.c +++ b/sound/ppc/burgundy.c @@ -454,7 +454,7 @@ static int snd_pmac_burgundy_put_switch_b(struct snd_kcontrol *kcontrol, /* * Burgundy mixers */ -static struct snd_kcontrol_new snd_pmac_burgundy_mixers[] = { +static const struct snd_kcontrol_new snd_pmac_burgundy_mixers[] = { BURGUNDY_VOLUME_W("Master Playback Volume", 0, MASK_ADDR_BURGUNDY_MASTER_VOLUME, 8), BURGUNDY_VOLUME_W("CD Capture Volume", 0, @@ -482,7 +482,7 @@ static struct snd_kcontrol_new snd_pmac_burgundy_mixers[] = { */ BURGUNDY_SWITCH_B("PCM Capture Switch", 0, MASK_ADDR_BURGUNDY_HOSTIFEH, 0x01, 0, 0) }; -static struct snd_kcontrol_new snd_pmac_burgundy_mixers_imac[] = { +static const struct snd_kcontrol_new snd_pmac_burgundy_mixers_imac[] = { BURGUNDY_VOLUME_W("Line in Capture Volume", 0, MASK_ADDR_BURGUNDY_VOLLINE, 16), BURGUNDY_VOLUME_W("Mic Capture Volume", 0, @@ -508,7 +508,7 @@ static struct snd_kcontrol_new snd_pmac_burgundy_mixers_imac[] = { BURGUNDY_SWITCH_B("Mic Boost Capture Switch", 0, MASK_ADDR_BURGUNDY_INPBOOST, 0x40, 0x80, 1) }; -static struct snd_kcontrol_new snd_pmac_burgundy_mixers_pmac[] = { +static const struct snd_kcontrol_new snd_pmac_burgundy_mixers_pmac[] = { BURGUNDY_VOLUME_W("Line in Capture Volume", 0, MASK_ADDR_BURGUNDY_VOLMIC, 16), BURGUNDY_VOLUME_B("Line in Gain Capture Volume", 0, @@ -524,33 +524,33 @@ static struct snd_kcontrol_new snd_pmac_burgundy_mixers_pmac[] = { /* BURGUNDY_SWITCH_B("Line in Boost Capture Switch", 0, * MASK_ADDR_BURGUNDY_INPBOOST, 0x40, 0x80, 1) */ }; -static struct snd_kcontrol_new snd_pmac_burgundy_master_sw_imac = +static const struct snd_kcontrol_new snd_pmac_burgundy_master_sw_imac = BURGUNDY_SWITCH_B("Master Playback Switch", 0, MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES, BURGUNDY_OUTPUT_LEFT | BURGUNDY_LINEOUT_LEFT | BURGUNDY_HP_LEFT, BURGUNDY_OUTPUT_RIGHT | BURGUNDY_LINEOUT_RIGHT | BURGUNDY_HP_RIGHT, 1); -static struct snd_kcontrol_new snd_pmac_burgundy_master_sw_pmac = +static const struct snd_kcontrol_new snd_pmac_burgundy_master_sw_pmac = BURGUNDY_SWITCH_B("Master Playback Switch", 0, MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES, BURGUNDY_OUTPUT_INTERN | BURGUNDY_OUTPUT_LEFT, BURGUNDY_OUTPUT_RIGHT, 1); -static struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw_imac = +static const struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw_imac = BURGUNDY_SWITCH_B("Speaker Playback Switch", 0, MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES, BURGUNDY_OUTPUT_LEFT, BURGUNDY_OUTPUT_RIGHT, 1); -static struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw_pmac = +static const struct snd_kcontrol_new snd_pmac_burgundy_speaker_sw_pmac = BURGUNDY_SWITCH_B("Speaker Playback Switch", 0, MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES, BURGUNDY_OUTPUT_INTERN, 0, 0); -static struct snd_kcontrol_new snd_pmac_burgundy_line_sw_imac = +static const struct snd_kcontrol_new snd_pmac_burgundy_line_sw_imac = BURGUNDY_SWITCH_B("Line out Playback Switch", 0, MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES, BURGUNDY_LINEOUT_LEFT, BURGUNDY_LINEOUT_RIGHT, 1); -static struct snd_kcontrol_new snd_pmac_burgundy_line_sw_pmac = +static const struct snd_kcontrol_new snd_pmac_burgundy_line_sw_pmac = BURGUNDY_SWITCH_B("Line out Playback Switch", 0, MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES, BURGUNDY_OUTPUT_LEFT, BURGUNDY_OUTPUT_RIGHT, 1); -static struct snd_kcontrol_new snd_pmac_burgundy_hp_sw_imac = +static const struct snd_kcontrol_new snd_pmac_burgundy_hp_sw_imac = BURGUNDY_SWITCH_B("Headphone Playback Switch", 0, MASK_ADDR_BURGUNDY_MORE_OUTPUTENABLES, BURGUNDY_HP_LEFT, BURGUNDY_HP_RIGHT, 1); diff --git a/sound/ppc/daca.c b/sound/ppc/daca.c index f2b4478139a4..1eb698dafd93 100644 --- a/sound/ppc/daca.c +++ b/sound/ppc/daca.c @@ -186,7 +186,7 @@ static int daca_put_amp(struct snd_kcontrol *kcontrol, return change; } -static struct snd_kcontrol_new daca_mixers[] = { +static const struct snd_kcontrol_new daca_mixers[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Deemphasis Switch", .info = daca_info_deemphasis, diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 6ee97008c8f0..87738ddc8bfd 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -1104,7 +1104,7 @@ static int pmac_hp_detect_get(struct snd_kcontrol *kcontrol, return 0; } -static struct snd_kcontrol_new auto_mute_controls[] = { +static const struct snd_kcontrol_new auto_mute_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Auto Mute Switch", .info = snd_pmac_boolean_mono_info, diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c index 2b4c0268a86b..6d2a33b8faa0 100644 --- a/sound/ppc/snd_ps3.c +++ b/sound/ppc/snd_ps3.c @@ -715,7 +715,7 @@ static int snd_ps3_spdif_default_put(struct snd_kcontrol *kcontrol, return 0; } -static struct snd_kcontrol_new spdif_ctls[] = { +static const struct snd_kcontrol_new spdif_ctls[] = { { .access = SNDRV_CTL_ELEM_ACCESS_READ, .iface = SNDRV_CTL_ELEM_IFACE_PCM, diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index 31bab6af645f..a5843035d718 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c @@ -826,7 +826,7 @@ static int snapper_put_capture_source(struct snd_kcontrol *kcontrol, /* */ -static struct snd_kcontrol_new tumbler_mixers[] = { +static const struct snd_kcontrol_new tumbler_mixers[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Master Playback Volume", .info = tumbler_info_master_volume, @@ -850,7 +850,7 @@ static struct snd_kcontrol_new tumbler_mixers[] = { }, }; -static struct snd_kcontrol_new snapper_mixers[] = { +static const struct snd_kcontrol_new snapper_mixers[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Master Playback Volume", .info = tumbler_info_master_volume, 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: 11316633 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E404C6C1 for ; Fri, 3 Jan 2020 08:42: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 7B00322314 for ; Fri, 3 Jan 2020 08:42:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="VZmCtLtn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B00322314 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 AF8F91775; Fri, 3 Jan 2020 09:41:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AF8F91775 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578040943; 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=VZmCtLtntOIwOrYLEKj0DvuviJukufKlFXDG2u95HTCLqNbseneMmJ06nhmM0K+eR JQVpW5C1IcBl682LXYOt36qqCEe5ejUQiTtjkWE7z4WRAHqmFWkjTWboFfEEb8SQUX zS+yaBaMnT3cP57m1G2KPM5+YAmmOlPMpgAD+F9g= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 879B4F80377; Fri, 3 Jan 2020 09:18:28 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316635 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C93F06C1 for ; Fri, 3 Jan 2020 08:43: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 6167422314 for ; Fri, 3 Jan 2020 08:43:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="RReeUF2h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6167422314 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 A2FBE175D; Fri, 3 Jan 2020 09:42:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A2FBE175D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041000; bh=3pnA/l1Y7hfP34bpC8z9mXcxot5m7vxoPOIYcmjwIRg=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=RReeUF2hlfvZUnlDQI109zGLil27sOOl1cPh51yrI3qg4pOBxcWHoi3VPVaYNYRLp sqvCU/24luGWs/nMw8OT6/JFw2rCuKYq3u8N+UzC8fq5mbcBrOSs6/mTVnDGkhAI1O uqRwxp9AdaOWExx8VweI6iLB5IahZA30V47LJXrU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3FFECF8046E; Fri, 3 Jan 2020 09:19:11 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 680FDF80383; Fri, 3 Jan 2020 09:18:31 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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 07473F802A8 for ; Fri, 3 Jan 2020 09:17:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 07473F802A8 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 9B0C6B200 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:56 +0100 Message-Id: <20200103081714.9560-41-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 40/58] ALSA: spi: 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/spi/at73c213.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/spi/at73c213.c b/sound/spi/at73c213.c index d6f2b19cfa39..e51bbf7836a2 100644 --- a/sound/spi/at73c213.c +++ b/sound/spi/at73c213.c @@ -657,7 +657,7 @@ static int snd_at73c213_aux_capture_volume_info( | (mask << 24) | (invert << 22)) \ } -static struct snd_kcontrol_new snd_at73c213_controls[] = { +static const struct snd_kcontrol_new snd_at73c213_controls[] = { AT73C213_STEREO("Master Playback Volume", 0, DAC_LMPG, DAC_RMPG, 0, 0, 0x1f, 1), AT73C213_STEREO("Master Playback Switch", 0, DAC_LMPG, DAC_RMPG, 5, 5, 1, 1), AT73C213_STEREO("PCM Playback Volume", 0, DAC_LLOG, DAC_RLOG, 0, 0, 0x1f, 1), From patchwork Fri Jan 3 08:16:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316651 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B628D6C1 for ; Fri, 3 Jan 2020 08:48:41 +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 4D44221734 for ; Fri, 3 Jan 2020 08:48:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="NzoEnPNo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D44221734 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 A3AF317A8; Fri, 3 Jan 2020 09:47:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A3AF317A8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041319; bh=BL4IdvwWZl5/fdb6fSp/kShT3Xb/RsZPKUV3DJ4Fom8=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=NzoEnPNoY/+sWy1yDLqt0cyUuglIgfPIPcX+DRaNgehPKsgJ49XDBlgBMZ4uZmvGm IAQM5X50hbH8Ugg/fjdjfsbGWEPLhYdh+gOCMaUI4wMq2UPd9yH41vble3Q3Btsisc ke3X4Oe0ZHKUh1c4tikNvzHdc+PpTYE/ih3btTWg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 97881F804D8; Fri, 3 Jan 2020 09:19:21 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5AF4BF803CB; Fri, 3 Jan 2020 09:18:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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 2EE9AF802C3 for ; Fri, 3 Jan 2020 09:17:25 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2EE9AF802C3 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 AB561ACB8 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:57 +0100 Message-Id: <20200103081714.9560-42-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 41/58] ALSA: usb: 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/usb/6fire/control.c | 8 ++++---- sound/usb/mixer.c | 6 +++--- sound/usb/mixer.h | 2 +- sound/usb/mixer_quirks.c | 16 ++++++++-------- sound/usb/mixer_us16x08.c | 38 +++++++++++++++++++------------------- sound/usb/mixer_us16x08.h | 2 +- 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/sound/usb/6fire/control.c b/sound/usb/6fire/control.c index de1f030eaf72..20f34d2ace5f 100644 --- a/sound/usb/6fire/control.c +++ b/sound/usb/6fire/control.c @@ -397,7 +397,7 @@ static int usb6fire_control_digital_thru_get(struct snd_kcontrol *kcontrol, return 0; } -static struct snd_kcontrol_new vol_elements[] = { +static const struct snd_kcontrol_new vol_elements[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Analog Playback Volume", @@ -437,7 +437,7 @@ static struct snd_kcontrol_new vol_elements[] = { {} }; -static struct snd_kcontrol_new mute_elements[] = { +static const struct snd_kcontrol_new mute_elements[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Analog Playback Switch", @@ -471,7 +471,7 @@ static struct snd_kcontrol_new mute_elements[] = { {} }; -static struct snd_kcontrol_new elements[] = { +static const struct snd_kcontrol_new elements[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Line/Phono Capture Route", @@ -517,7 +517,7 @@ static int usb6fire_control_add_virtual( struct control_runtime *rt, struct snd_card *card, char *name, - struct snd_kcontrol_new *elems) + const struct snd_kcontrol_new *elems) { int ret; int i; diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index f60e0869c096..6d9080b47d0f 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c @@ -1445,7 +1445,7 @@ static int mixer_ctl_connector_get(struct snd_kcontrol *kcontrol, return 0; } -static struct snd_kcontrol_new usb_feature_unit_ctl = { +static const struct snd_kcontrol_new usb_feature_unit_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "", /* will be filled later manually */ .info = mixer_ctl_feature_info, @@ -1466,7 +1466,7 @@ static const struct snd_kcontrol_new usb_feature_unit_ctl_ro = { * A control which shows the boolean value from reading a UAC control on * the master channel. */ -static struct snd_kcontrol_new usb_bool_master_control_ctl_ro = { +static const struct snd_kcontrol_new usb_bool_master_control_ctl_ro = { .iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = "", /* will be filled later manually */ .access = SNDRV_CTL_ELEM_ACCESS_READ, @@ -1488,7 +1488,7 @@ static const struct snd_kcontrol_new usb_connector_ctl_ro = { * This symbol is exported in order to allow the mixer quirks to * hook up to the standard feature unit control mechanism */ -struct snd_kcontrol_new *snd_usb_feature_unit_ctl = &usb_feature_unit_ctl; +const struct snd_kcontrol_new *snd_usb_feature_unit_ctl = &usb_feature_unit_ctl; /* * build a feature control diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h index 37e1b234c802..65d6d08c96f5 100644 --- a/sound/usb/mixer.h +++ b/sound/usb/mixer.h @@ -116,6 +116,6 @@ int snd_usb_get_cur_mix_value(struct usb_mixer_elem_info *cval, extern void snd_usb_mixer_elem_free(struct snd_kcontrol *kctl); -extern struct snd_kcontrol_new *snd_usb_feature_unit_ctl; +extern const struct snd_kcontrol_new *snd_usb_feature_unit_ctl; #endif /* __USBMIXER_H */ diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index 39e27ae6c597..4cb8331d87a4 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -507,7 +507,7 @@ static int snd_emu0204_ch_switch_resume(struct usb_mixer_elem_list *list) list->kctl->private_value); } -static struct snd_kcontrol_new snd_emu0204_control = { +static const struct snd_kcontrol_new snd_emu0204_control = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Front Jack Channels", .info = snd_emu0204_ch_switch_info, @@ -575,7 +575,7 @@ static int snd_xonar_u1_switch_resume(struct usb_mixer_elem_list *list) list->kctl->private_value); } -static struct snd_kcontrol_new snd_xonar_u1_output_switch = { +static const struct snd_kcontrol_new snd_xonar_u1_output_switch = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Digital Playback Switch", .info = snd_ctl_boolean_mono_info, @@ -702,7 +702,7 @@ static int snd_mbox1_switch_resume(struct usb_mixer_elem_list *list) return snd_mbox1_switch_update(list->mixer, list->kctl->private_value); } -static struct snd_kcontrol_new snd_mbox1_switch = { +static const struct snd_kcontrol_new snd_mbox1_switch = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Clock Source", .index = 0, @@ -787,7 +787,7 @@ static int snd_nativeinstruments_control_put(struct snd_kcontrol *kcontrol, return err < 0 ? err : 1; } -static struct snd_kcontrol_new snd_nativeinstruments_ta6_mixers[] = { +static const struct snd_kcontrol_new snd_nativeinstruments_ta6_mixers[] = { { .name = "Direct Thru Channel A", .private_value = _MAKE_NI_CONTROL(0x01, 0x03), @@ -806,7 +806,7 @@ static struct snd_kcontrol_new snd_nativeinstruments_ta6_mixers[] = { }, }; -static struct snd_kcontrol_new snd_nativeinstruments_ta10_mixers[] = { +static const struct snd_kcontrol_new snd_nativeinstruments_ta10_mixers[] = { { .name = "Direct Thru Channel A", .private_value = _MAKE_NI_CONTROL(0x01, 0x03), @@ -1662,7 +1662,7 @@ static int snd_microii_spdif_switch_put(struct snd_kcontrol *kcontrol, return err < 0 ? err : 1; } -static struct snd_kcontrol_new snd_microii_mixer_spdif[] = { +static const struct snd_kcontrol_new snd_microii_mixer_spdif[] = { { .iface = SNDRV_CTL_ELEM_IFACE_PCM, .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, DEFAULT), @@ -1769,7 +1769,7 @@ static int snd_soundblaster_e1_switch_info(struct snd_kcontrol *kcontrol, return snd_ctl_enum_info(uinfo, 1, ARRAY_SIZE(texts), texts); } -static struct snd_kcontrol_new snd_soundblaster_e1_input_switch = { +static const struct snd_kcontrol_new snd_soundblaster_e1_input_switch = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Input Source", .info = snd_soundblaster_e1_switch_info, @@ -2093,7 +2093,7 @@ static int snd_rme_sync_source_info(struct snd_kcontrol *kcontrol, ARRAY_SIZE(sync_sources), sync_sources); } -static struct snd_kcontrol_new snd_rme_controls[] = { +static const struct snd_kcontrol_new snd_rme_controls[] = { { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "AES Rate", diff --git a/sound/usb/mixer_us16x08.c b/sound/usb/mixer_us16x08.c index f0e8e1539450..986145fd2ce0 100644 --- a/sound/usb/mixer_us16x08.c +++ b/sound/usb/mixer_us16x08.c @@ -760,7 +760,7 @@ static int snd_us16x08_meter_put(struct snd_kcontrol *kcontrol, return 1; } -static struct snd_kcontrol_new snd_us16x08_ch_boolean_ctl = { +static const struct snd_kcontrol_new snd_us16x08_ch_boolean_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -770,7 +770,7 @@ static struct snd_kcontrol_new snd_us16x08_ch_boolean_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1) }; -static struct snd_kcontrol_new snd_us16x08_ch_int_ctl = { +static const struct snd_kcontrol_new snd_us16x08_ch_int_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -780,7 +780,7 @@ static struct snd_kcontrol_new snd_us16x08_ch_int_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_FADER_BIAS, 1, 0, 133) }; -static struct snd_kcontrol_new snd_us16x08_pan_int_ctl = { +static const struct snd_kcontrol_new snd_us16x08_pan_int_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -790,7 +790,7 @@ static struct snd_kcontrol_new snd_us16x08_pan_int_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_FADER_BIAS, 1, 0, 255) }; -static struct snd_kcontrol_new snd_us16x08_master_ctl = { +static const struct snd_kcontrol_new snd_us16x08_master_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 1, @@ -800,7 +800,7 @@ static struct snd_kcontrol_new snd_us16x08_master_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_FADER_BIAS, 1, 0, 133) }; -static struct snd_kcontrol_new snd_us16x08_route_ctl = { +static const struct snd_kcontrol_new snd_us16x08_route_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 8, @@ -810,7 +810,7 @@ static struct snd_kcontrol_new snd_us16x08_route_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 9) }; -static struct snd_kcontrol_new snd_us16x08_bus_ctl = { +static const struct snd_kcontrol_new snd_us16x08_bus_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 1, @@ -820,7 +820,7 @@ static struct snd_kcontrol_new snd_us16x08_bus_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1) }; -static struct snd_kcontrol_new snd_us16x08_compswitch_ctl = { +static const struct snd_kcontrol_new snd_us16x08_compswitch_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -830,7 +830,7 @@ static struct snd_kcontrol_new snd_us16x08_compswitch_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1) }; -static struct snd_kcontrol_new snd_us16x08_comp_threshold_ctl = { +static const struct snd_kcontrol_new snd_us16x08_comp_threshold_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -841,7 +841,7 @@ static struct snd_kcontrol_new snd_us16x08_comp_threshold_ctl = { 0, 0x20) }; -static struct snd_kcontrol_new snd_us16x08_comp_ratio_ctl = { +static const struct snd_kcontrol_new snd_us16x08_comp_ratio_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -852,7 +852,7 @@ static struct snd_kcontrol_new snd_us16x08_comp_ratio_ctl = { sizeof(ratio_map) - 1), /*max*/ }; -static struct snd_kcontrol_new snd_us16x08_comp_gain_ctl = { +static const struct snd_kcontrol_new snd_us16x08_comp_gain_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -862,7 +862,7 @@ static struct snd_kcontrol_new snd_us16x08_comp_gain_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x14) }; -static struct snd_kcontrol_new snd_us16x08_comp_attack_ctl = { +static const struct snd_kcontrol_new snd_us16x08_comp_attack_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -873,7 +873,7 @@ static struct snd_kcontrol_new snd_us16x08_comp_attack_ctl = { SND_US16X08_KCSET(SND_US16X08_COMP_ATTACK_BIAS, 1, 0, 0xc6), }; -static struct snd_kcontrol_new snd_us16x08_comp_release_ctl = { +static const struct snd_kcontrol_new snd_us16x08_comp_release_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -884,7 +884,7 @@ static struct snd_kcontrol_new snd_us16x08_comp_release_ctl = { SND_US16X08_KCSET(SND_US16X08_COMP_RELEASE_BIAS, 1, 0, 0x63), }; -static struct snd_kcontrol_new snd_us16x08_eq_gain_ctl = { +static const struct snd_kcontrol_new snd_us16x08_eq_gain_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -894,7 +894,7 @@ static struct snd_kcontrol_new snd_us16x08_eq_gain_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 24), }; -static struct snd_kcontrol_new snd_us16x08_eq_low_freq_ctl = { +static const struct snd_kcontrol_new snd_us16x08_eq_low_freq_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -904,7 +904,7 @@ static struct snd_kcontrol_new snd_us16x08_eq_low_freq_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x1F), }; -static struct snd_kcontrol_new snd_us16x08_eq_mid_freq_ctl = { +static const struct snd_kcontrol_new snd_us16x08_eq_mid_freq_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -914,7 +914,7 @@ static struct snd_kcontrol_new snd_us16x08_eq_mid_freq_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x3F) }; -static struct snd_kcontrol_new snd_us16x08_eq_mid_width_ctl = { +static const struct snd_kcontrol_new snd_us16x08_eq_mid_width_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -924,7 +924,7 @@ static struct snd_kcontrol_new snd_us16x08_eq_mid_width_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 0x06) }; -static struct snd_kcontrol_new snd_us16x08_eq_high_freq_ctl = { +static const struct snd_kcontrol_new snd_us16x08_eq_high_freq_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -935,7 +935,7 @@ static struct snd_kcontrol_new snd_us16x08_eq_high_freq_ctl = { SND_US16X08_KCSET(SND_US16X08_EQ_HIGHFREQ_BIAS, 1, 0, 0x1F) }; -static struct snd_kcontrol_new snd_us16x08_eq_switch_ctl = { +static const struct snd_kcontrol_new snd_us16x08_eq_switch_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 16, @@ -945,7 +945,7 @@ static struct snd_kcontrol_new snd_us16x08_eq_switch_ctl = { .private_value = SND_US16X08_KCSET(SND_US16X08_NO_BIAS, 1, 0, 1) }; -static struct snd_kcontrol_new snd_us16x08_meter_ctl = { +static const struct snd_kcontrol_new snd_us16x08_meter_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, .count = 1, diff --git a/sound/usb/mixer_us16x08.h b/sound/usb/mixer_us16x08.h index 56ff16c0698f..7b8583dd3b07 100644 --- a/sound/usb/mixer_us16x08.h +++ b/sound/usb/mixer_us16x08.h @@ -108,7 +108,7 @@ struct snd_us16x08_meter_store { }; struct snd_us16x08_control_params { - struct snd_kcontrol_new *kcontrol_new; + const struct snd_kcontrol_new *kcontrol_new; int control_id; int type; int num_channels; 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: 11316641 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 895AB1398 for ; Fri, 3 Jan 2020 08:45:13 +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 20701227BF for ; Fri, 3 Jan 2020 08:45:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="VDl6emEq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20701227BF 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 3DD4B1792; Fri, 3 Jan 2020 09:44:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3DD4B1792 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041111; 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=VDl6emEqAWgB6ET6T+n4r3zdNlrXomgCiYKB6XiScMMr41NNiCatS2lqjrlU3jMYF tyrN1ohxslpR5HfFCLTvguLeIeC2h7AGhHvsFZGkBW0t7rgn5M89/p9/arOX/3zhXA tx4y6fktRcswuk/B9uFl51/DDyUlcCQe4RvAvkTk= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 36346F8038D; Fri, 3 Jan 2020 09:18:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316645 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DB8776C1 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 6956E22B48 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 6956E22B48 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 AD42E1742; Fri, 3 Jan 2020 09:46:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AD42E1742 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 700F1F80393; Fri, 3 Jan 2020 09:18:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316649 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 517F413A4 for ; Fri, 3 Jan 2020 08:48: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 DCC8821D7D for ; Fri, 3 Jan 2020 08:48: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="qGhMkUu9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCC8821D7D 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 385EB179A; Fri, 3 Jan 2020 09:47:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 385EB179A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041285; 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=qGhMkUu9fIgoMWtTI3fqIRt5bGMKkJ9buXP+9K9G5JYf2V7YXKeHku+FdyXMDZc0r 0doXS5LIKj7KCXE4AAANWsgbolLO2JuUUtiLgItAx9OxAXvPR8RoNznW3eIXwUfgZS gO0+ZSwTUgJ98yhU5f89HH3XUdhpeuS2EzTy5nQk= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8C700F803B1; Fri, 3 Jan 2020 09:18:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316647 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 949A41398 for ; Fri, 3 Jan 2020 08:47:32 +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 2AD4121D7D for ; Fri, 3 Jan 2020 08:47:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="U/KBo+Q3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AD4121D7D 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 6AB6B1795; Fri, 3 Jan 2020 09:46:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6AB6B1795 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041250; bh=Zx64XIHrbv/a5BaBAwMo5bRLTOv+1ScAVNR3wzN2iGo=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=U/KBo+Q3/d0KwZoJ5cA9DPO39PNj57vhlw4exbCH0tZ3hRdeb6iv728nMrsLB3QRr PSC576Qv+6+AAImFR9yucCHm0uBDuF/j2N7/bNrQKP5sPrWEiAECVvHVzZVDCMsN/F 0dIXiJWvoed2lUH1hN0/7TzRL5F8FhVWQ/N1wcFQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 81E6BF804BC; Fri, 3 Jan 2020 09:19:19 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9604DF803AF; Fri, 3 Jan 2020 09:18:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 90AC3F802D2 for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 90AC3F802D2 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 D37BFB1FF 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:01 +0100 Message-Id: <20200103081714.9560-46-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 45/58] ALSA: ac97: Constify snd_ac97_res_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" One snd_ac97_res_table definition remains forgotten without const. Let's add it for a bit of optimization. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/pci/ac97/ac97_patch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index 719a1e4956dd..524f9d2dcb3c 100644 --- a/sound/pci/ac97/ac97_patch.c +++ b/sound/pci/ac97/ac97_patch.c @@ -3871,7 +3871,7 @@ static int mpatch_si3036(struct snd_ac97 * ac97) * check_volume_resolution(). */ -static struct snd_ac97_res_table lm4550_restbl[] = { +static const struct snd_ac97_res_table lm4550_restbl[] = { { AC97_MASTER, 0x1f1f }, { AC97_HEADPHONE, 0x1f1f }, { AC97_MASTER_MONO, 0x001f }, From patchwork Fri Jan 3 08:17:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316659 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ABC3F6C1 for ; Fri, 3 Jan 2020 08:51:29 +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 39FAD222C4 for ; Fri, 3 Jan 2020 08:51:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="QGbYf4JZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 39FAD222C4 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 7CE1B1753; Fri, 3 Jan 2020 09:50:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7CE1B1753 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041487; bh=QXdQSG7vwxnGzI0kSQWtOQqGA7titeSf1ro1shwBBFk=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QGbYf4JZ6yPG6mlxA5GdOuBCRbR4d417jS3h0ZlCQZBoZ6+weAxb8EBx9ceou3lWx VzJdaYdpCwX7LtMefQ8ocgnLTItGkKb4JZz120YBLNBzqurOz54dfEndkpYuQDHeKF wHzmIRcEwZV+Mqba6Vg3wPd61qPGWE01ykqyxX0k= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E2865F80508; Fri, 3 Jan 2020 09:19:25 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0E6ABF803CF; Fri, 3 Jan 2020 09:18:52 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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 D4B55F802DF for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D4B55F802DF 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 DF1ACB202 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:02 +0100 Message-Id: <20200103081714.9560-47-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 46/58] ALSA: ca0106: Constify snd_ca0106_category_str 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" snd_ca0106_con_category array is read-only and can be marked as const. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/pci/ca0106/ca0106_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/ca0106/ca0106_proc.c b/sound/pci/ca0106/ca0106_proc.c index 15272c9ca4d5..c99603e137e5 100644 --- a/sound/pci/ca0106/ca0106_proc.c +++ b/sound/pci/ca0106/ca0106_proc.c @@ -66,7 +66,7 @@ struct snd_ca0106_category_str { const char *name; }; -static struct snd_ca0106_category_str snd_ca0106_con_category[] = { +static const struct snd_ca0106_category_str snd_ca0106_con_category[] = { { IEC958_AES1_CON_DAT, "DAT" }, { IEC958_AES1_CON_VCR, "VCR" }, { IEC958_AES1_CON_MICROPHONE, "microphone" }, From patchwork Fri Jan 3 08:17:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316655 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 87F396C1 for ; Fri, 3 Jan 2020 08:50: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 1D94121734 for ; Fri, 3 Jan 2020 08:50: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="QQUl+JJf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D94121734 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 5F181178E; Fri, 3 Jan 2020 09:49:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5F181178E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041404; bh=5qfd2n8neHDbQiEaSydPbEp9BnuSZSyf+9w9hS1GARM=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QQUl+JJfnXCZiV3ulG1410nvQAPi3ep/GWjidrVo9KpSwgC0DhlC0npXcKE1H+Df8 UCAVTwNsokiisEpLr4121qxx6npUjlYmLloRofqqh1/GmkoBvt2qbcnMBkcZaxMniD 4CtfwvPy0uVE/B/2iQUx69VMNZq732ZOVaoPF5bo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 59FDBF804E2; Fri, 3 Jan 2020 09:19:23 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7F1E8F802C3; Fri, 3 Jan 2020 09:18:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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 95361F802DD for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 95361F802DD 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 EC659B283 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:03 +0100 Message-Id: <20200103081714.9560-48-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 47/58] ALSA: ca0106: Constify snd_ca0106_details 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_ca0106_details table entries are referred only as read-only. Let's make them const. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/pci/ca0106/ca0106.h | 2 +- sound/pci/ca0106/ca0106_main.c | 6 +++--- sound/pci/ca0106/ca0106_mixer.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/pci/ca0106/ca0106.h b/sound/pci/ca0106/ca0106.h index 986905cfcc4c..62a22ca3b9de 100644 --- a/sound/pci/ca0106/ca0106.h +++ b/sound/pci/ca0106/ca0106.h @@ -663,7 +663,7 @@ struct snd_ca0106_details { // definition of the chip-specific record struct snd_ca0106 { struct snd_card *card; - struct snd_ca0106_details *details; + const struct snd_ca0106_details *details; struct pci_dev *pci; unsigned long port; diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index d3bd27ddb049..487b1aaafa1e 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -156,7 +156,7 @@ MODULE_PARM_DESC(subsystem, "Force card subsystem model."); #include "ca0106.h" -static struct snd_ca0106_details ca0106_chip_details[] = { +static const struct snd_ca0106_details ca0106_chip_details[] = { /* Sound Blaster X-Fi Extreme Audio. This does not have an AC97. 53SB079000000 */ /* It is really just a normal SB Live 24bit. */ /* Tested: @@ -503,7 +503,7 @@ static void restore_spdif_bits(struct snd_ca0106 *chip, int idx) } static int snd_ca0106_channel_dac(struct snd_ca0106 *chip, - struct snd_ca0106_details *details, + const struct snd_ca0106_details *details, int channel_id) { switch (channel_id) { @@ -1593,7 +1593,7 @@ static int snd_ca0106_create(int dev, struct snd_card *card, struct snd_ca0106 **rchip) { struct snd_ca0106 *chip; - struct snd_ca0106_details *c; + const struct snd_ca0106_details *c; int err; static const struct snd_device_ops ops = { .dev_free = snd_ca0106_dev_free, diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c index 729d757c900a..c771995b12b9 100644 --- a/sound/pci/ca0106/ca0106_mixer.c +++ b/sound/pci/ca0106/ca0106_mixer.c @@ -654,7 +654,7 @@ static const int spi_dmute_bit[] = { }; static struct snd_kcontrol_new -snd_ca0106_volume_spi_dac_ctl(struct snd_ca0106_details *details, +snd_ca0106_volume_spi_dac_ctl(const struct snd_ca0106_details *details, int channel_id) { struct snd_kcontrol_new spi_switch = {0}; 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: 11316669 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E1716C1 for ; Fri, 3 Jan 2020 08:54:41 +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 03CAE21734 for ; Fri, 3 Jan 2020 08:54:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Lj9a9f19" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03CAE21734 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 4AE4817C5; Fri, 3 Jan 2020 09:53:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4AE4817C5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041679; 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=Lj9a9f19FsIBm3uB68BgrURsGA2lm8ceV44SJgn9qzVIbd+FgyVov+nvxY4VvhJqn POaIAeMa39MOVa1xKTjq18wHPU2CnRb8jNiwoDij9Kf6vGBsfZ055z7frWmUy4TKGI msSyx8GAe1EV66j3t/FWsgJwBgSnLm8rvz5C/MYI= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 22BE1F803DE; Fri, 3 Jan 2020 09:18:58 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316661 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F01E6C1 for ; Fri, 3 Jan 2020 08:52: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 23F31222C4 for ; Fri, 3 Jan 2020 08:52: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="QEVkF8Je" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23F31222C4 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 25DE21798; Fri, 3 Jan 2020 09:51:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 25DE21798 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041524; 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=QEVkF8Je2Z6FAOIrXbBK8lIqck2rYINDcx024p1eeWR4j+SigLNbxSJcjYaYGb7wS zsy3fVtzgmk3So0phfjTyJkoWddvfi43kNLKmAHiILWveoStV58CcXlN8NrAfoH/6E AEtvgCA3JTU6uVDXUA5YRo0kvGYn8jPk+2ARQrJQ= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id B2998F803CC; Fri, 3 Jan 2020 09:18:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316653 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6A74A6C1 for ; Fri, 3 Jan 2020 08:49:26 +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 EC2D221734 for ; Fri, 3 Jan 2020 08:49:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Hg52swGy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC2D221734 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 33EAB17AA; Fri, 3 Jan 2020 09:48:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 33EAB17AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041364; 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=Hg52swGyQrCriW2cd6ood/qXFAH3EGQ45Ae6uRk0hvYJcsOT7Jo6bNUKeqnSRbn0a uk/wqjMpkVFMmNJuUDdcMSHh5gpOu7dS9uVWPsw98zvhaXc6v+f9TOOqf0nZ1gtI/L QPVuU4uxPfPrqg8r9RpN0yZy7MWbD+fcXe5okOF8= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6D631F802DC; Fri, 3 Jan 2020 09:18:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316677 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 834B113A4 for ; Fri, 3 Jan 2020 08:56:46 +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 18077222C4 for ; Fri, 3 Jan 2020 08:56:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="qeMmAjUj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18077222C4 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 515151781; Fri, 3 Jan 2020 09:55:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 515151781 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041804; bh=ooAZwD9T+BMxH4xkAI19HfCrkXuKYJyAtporuKYHEwo=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qeMmAjUjU1URze/DTWzyF+bDVoYgdcU81eel/04wf5p5FwCarIGtO9S22E/oGMCAM G9Nd85s4QXS3Al9W6EwiXTBN7d5lyns3+jx6vmShWd6mmBUtjswjqTM+cuCeTKLnhk ZRT2jwivDrUxd68bFWkgN51Qhs0/5jzFeu7ypLuk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 33D94F8057C; Fri, 3 Jan 2020 09:19:36 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4DD36F803DF; Fri, 3 Jan 2020 09:19:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 3CA4EF802EB for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3CA4EF802EB 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 23FE6B286 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:07 +0100 Message-Id: <20200103081714.9560-52-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 51/58] ALSA: usx2y: Constify struct snd_usb_audio_quirk entries 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 quirk entries used in us122l and usx2y drivers can be declared as const as they are read-only. There should be no functional changes by this patch. Signed-off-by: Takashi Iwai --- sound/usb/usx2y/us122l.c | 8 ++++---- sound/usb/usx2y/usX2Yhwdep.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sound/usb/usx2y/us122l.c b/sound/usb/usx2y/us122l.c index e82c5236482d..f86f7a61fb36 100644 --- a/sound/usb/usx2y/us122l.c +++ b/sound/usb/usx2y/us122l.c @@ -40,13 +40,13 @@ static int snd_us122l_card_used[SNDRV_CARDS]; static int us122l_create_usbmidi(struct snd_card *card) { - static struct snd_usb_midi_endpoint_info quirk_data = { + static const struct snd_usb_midi_endpoint_info quirk_data = { .out_ep = 4, .in_ep = 3, .out_cables = 0x001, .in_cables = 0x001 }; - static struct snd_usb_audio_quirk quirk = { + static const struct snd_usb_audio_quirk quirk = { .vendor_name = "US122L", .product_name = NAME_ALLCAPS, .ifnum = 1, @@ -62,13 +62,13 @@ static int us122l_create_usbmidi(struct snd_card *card) static int us144_create_usbmidi(struct snd_card *card) { - static struct snd_usb_midi_endpoint_info quirk_data = { + static const struct snd_usb_midi_endpoint_info quirk_data = { .out_ep = 4, .in_ep = 3, .out_cables = 0x001, .in_cables = 0x001 }; - static struct snd_usb_audio_quirk quirk = { + static const struct snd_usb_audio_quirk quirk = { .vendor_name = "US144", .product_name = NAME_ALLCAPS, .ifnum = 0, diff --git a/sound/usb/usx2y/usX2Yhwdep.c b/sound/usb/usx2y/usX2Yhwdep.c index 9985fc139487..0e6d82b5778e 100644 --- a/sound/usb/usx2y/usX2Yhwdep.c +++ b/sound/usb/usx2y/usX2Yhwdep.c @@ -126,26 +126,26 @@ static int snd_usX2Y_hwdep_dsp_status(struct snd_hwdep *hw, static int usX2Y_create_usbmidi(struct snd_card *card) { - static struct snd_usb_midi_endpoint_info quirk_data_1 = { + static const struct snd_usb_midi_endpoint_info quirk_data_1 = { .out_ep = 0x06, .in_ep = 0x06, .out_cables = 0x001, .in_cables = 0x001 }; - static struct snd_usb_audio_quirk quirk_1 = { + static const struct snd_usb_audio_quirk quirk_1 = { .vendor_name = "TASCAM", .product_name = NAME_ALLCAPS, .ifnum = 0, .type = QUIRK_MIDI_FIXED_ENDPOINT, .data = &quirk_data_1 }; - static struct snd_usb_midi_endpoint_info quirk_data_2 = { + static const struct snd_usb_midi_endpoint_info quirk_data_2 = { .out_ep = 0x06, .in_ep = 0x06, .out_cables = 0x003, .in_cables = 0x003 }; - static struct snd_usb_audio_quirk quirk_2 = { + static const struct snd_usb_audio_quirk quirk_2 = { .vendor_name = "TASCAM", .product_name = "US428", .ifnum = 0, @@ -154,7 +154,7 @@ static int usX2Y_create_usbmidi(struct snd_card *card) }; struct usb_device *dev = usX2Y(card)->dev; struct usb_interface *iface = usb_ifnum_to_if(dev, 0); - struct snd_usb_audio_quirk *quirk = + const struct snd_usb_audio_quirk *quirk = le16_to_cpu(dev->descriptor.idProduct) == USB_ID_US428 ? &quirk_2 : &quirk_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: 11316657 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AFC0F6C1 for ; Fri, 3 Jan 2020 08:50: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 454E421734 for ; Fri, 3 Jan 2020 08:50:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="d3B/I4ms" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 454E421734 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 848E917B4; Fri, 3 Jan 2020 09:49:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 848E917B4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041438; 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=d3B/I4msxBH5pFHo/18VTYkzP5eef8Cafpns/pR5pXcQUieHXamJnLo5/qYnT1a2E 37GIx8LMbMvnPQQjY2esquv2no1qsrvEdJHfJqHwTUtefE117TxGZ08n3jDdRL1+tu GUjc+WcLWBvxZXy8NAPkB5YfC8FuAT+J4ML+8Fo4= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 02C01F803CD; Fri, 3 Jan 2020 09:18:50 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316667 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9D1B41398 for ; Fri, 3 Jan 2020 08:54: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 2BB3A21734 for ; Fri, 3 Jan 2020 08:54: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="B6ERyECY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BB3A21734 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 7AA2D17C3; Fri, 3 Jan 2020 09:53:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7AA2D17C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041642; bh=Zgfdj1NZ5lI2gezN20L6qB0vndwxNgGLJGfIaBSHSr8=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=B6ERyECYkyDgg/z79k5VtasZnldgmdhjUA7EtNy7gjnpmoAO3m7tgWT0XV3K+tqBY ojo0YTIVfqlXLmqSZIEbOJiRnv1uNkWku3mMYVJyp8RFYxVYmB8tYKdlVHqz0mdCED fO+gHzexkHGLi4j4scXmwyyrMIFfJ3gQ1KJ2RJdE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 11650F8053B; Fri, 3 Jan 2020 09:19:30 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 26BD0F803DE; Fri, 3 Jan 2020 09:18:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 2C055F802E8 for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2C055F802E8 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 3F1DBB288 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:09 +0100 Message-Id: <20200103081714.9560-54-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 53/58] ALSA: bt87x: Constify snd_bt87x_boards 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_bt87x_boards array 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/bt87x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c index ece3f8971145..8c48864c844a 100644 --- a/sound/pci/bt87x.c +++ b/sound/pci/bt87x.c @@ -150,7 +150,7 @@ struct snd_bt87x_board { unsigned no_digital:1; /* No digital input */ }; -static struct snd_bt87x_board snd_bt87x_boards[] = { +static const struct snd_bt87x_board snd_bt87x_boards[] = { [SND_BT87X_BOARD_UNKNOWN] = { .dig_rate = 32000, /* just a guess */ }, From patchwork Fri Jan 3 08:17:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316663 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D59311398 for ; Fri, 3 Jan 2020 08:52:46 +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 6CCA12253D for ; Fri, 3 Jan 2020 08:52:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="ojaE0+Vg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CCA12253D 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 B436F17C6; Fri, 3 Jan 2020 09:51:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B436F17C6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041564; bh=VKXoZy+UIZdVRpKXNKdxHPqpv8CQ4G9c0Ymi+yNn08M=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ojaE0+VgPNugLIe+8gu5+dfPom5qNDxrsvncqhtSmufoPqICEgrmrT0c0CL4PGkzv VNLxj/AzSxR7PgRrNcGYYuueqliFY4ckkcJ1YDmuBVIBiA6bOTjckabFO1mFFrsTW/ Tkb6IHh5fgpDXeYwgbsty0zOJHEa7UFxn75+e3Ow= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E66B5F8051E; Fri, 3 Jan 2020 09:19:27 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 137B4F803D5; Fri, 3 Jan 2020 09:18:55 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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 CC924F802E1 for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CC924F802E1 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 4CF5EB289 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:10 +0100 Message-Id: <20200103081714.9560-55-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 54/58] ALSA: emu10k1: Constify snd_emu_chip_details 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_emu_chip_details definitions 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/emu10k1/emu10k1_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index 6a8fce8ac218..51af766f57d2 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c @@ -1283,7 +1283,7 @@ static int snd_emu10k1_dev_free(struct snd_device *device) return snd_emu10k1_free(emu); } -static struct snd_emu_chip_details emu_chip_details[] = { +static const struct snd_emu_chip_details emu_chip_details[] = { /* Audigy 5/Rx SB1550 */ /* Tested by michael@gernoth.net 28 Mar 2015 */ /* DSP: CA10300-IAT LF 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: 11316665 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B03D76C1 for ; Fri, 3 Jan 2020 08:53: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 46069222C4 for ; Fri, 3 Jan 2020 08:53: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="An3qVLo+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 46069222C4 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 7D8DD17CD; Fri, 3 Jan 2020 09:52:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7D8DD17CD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041602; 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=An3qVLo+gR4w3d2pi02y6PHsJohhU1uw1MOXXG07AKnRqQnmhZtr94S0wajqqJAii gFGz8QB+FzyI2nTQ809RapG92vOZaKL0Tp4EqWUBwnNqZXV/394MUydAD+Kc2uNH0d So1e/UlEwIW9Z9iuwEbFL4leVvWgfLEUkMjB2rtk= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4BD0FF803D7; Fri, 3 Jan 2020 09:18:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 11316671 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD09D6C1 for ; Fri, 3 Jan 2020 08:55: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 533F821734 for ; Fri, 3 Jan 2020 08:55: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="BHGrkRNG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 533F821734 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 9DCBE17B0; Fri, 3 Jan 2020 09:54:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9DCBE17B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041719; bh=mfixm7lMuuWkOxxgoPQlfLReAVLU7+YEituh6jv8VDQ=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BHGrkRNGkVEk+8u8Uu5Ma945yQNh5lPgTuf7feG4ODZYWcBqQZD+38Ot9rrtPpIE/ N6E9y2ibo0eBfx9nV77EV0mey1ADsnO3N5irP5WZ1O6JXtZ7rYx27zyeIL1FrHsx6q H72czpqauR83Xe7vfQPD4S1DQduMdmER/BMU+Lo4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8CF3EF80553; Fri, 3 Jan 2020 09:19:32 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D2B94F803DE; Fri, 3 Jan 2020 09:18:58 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 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 52A9DF802EA for ; Fri, 3 Jan 2020 09:17:26 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 52A9DF802EA 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 6C3D2B28C 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:12 +0100 Message-Id: <20200103081714.9560-57-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 56/58] ALSA: fm801: Constify snd_fm801_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_fm801_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/fm801.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index 4117a053eb18..40dfad74f8e1 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c @@ -724,7 +724,7 @@ struct snd_fm801_tea575x_gpio { char *name; }; -static struct snd_fm801_tea575x_gpio snd_fm801_tea575x_gpios[] = { +static const struct snd_fm801_tea575x_gpio snd_fm801_tea575x_gpios[] = { { .data = 1, .clk = 3, .wren = 2, .most = 0, .name = "SF256-PCS" }, { .data = 1, .clk = 0, .wren = 2, .most = 3, .name = "SF256-PCP" }, { .data = 2, .clk = 0, .wren = 1, .most = 3, .name = "SF64-PCR" }, 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: 11316675 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 31D111398 for ; Fri, 3 Jan 2020 08:56: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 BD43721734 for ; Fri, 3 Jan 2020 08:56:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="DXWzRHWS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD43721734 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 105A51660; Fri, 3 Jan 2020 09:55:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 105A51660 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041769; 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=DXWzRHWST7xodmFbshEeZqfvdwRTQ1ny7K50OiYRCPx2pbl128+3CmCkgxoPGMwMO OkVWKzXDQOUa7KoPPML7xG89UdNoPJcVRRUAhjzLsMugTIDghxlMhkxOyYMJZ/iI25 +FROpemVhGyN0VLqlKIuvb7pdMAwlz8uSBkqobps= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id B2B3DF803E0; Fri, 3 Jan 2020 09:19:00 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=disabled version=3.4.0 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: 11316679 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 375AF17F0 for ; Fri, 3 Jan 2020 08:57:23 +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 C0FF021734 for ; Fri, 3 Jan 2020 08:57:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="hOABz0xW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C0FF021734 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 1429317E1; Fri, 3 Jan 2020 09:56:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1429317E1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578041841; 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=hOABz0xW/QMXW51tPRkfr2+KpGpvYRkFg0fcORFh0RpqP6UfexkgH4ql/IK8G4wob ocvBhIISAX0mowxi+vp5BRDmpIliSN6Ap+QRUgaUafx6UJ0lO5UoiVcNhiTfjAYS74 MIeXCygMboxZp62KSdoWAl+3T/P5J9uwhtcuaGuU= 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) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E1447F803E0; Fri, 3 Jan 2020 09:19:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,SURBL_BLOCKED, URIBL_BLOCKED autolearn=disabled version=3.4.0 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),