From patchwork Sun Jan 5 14:47:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193976 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7952CC33C8C for ; Sun, 5 Jan 2020 14:51:14 +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 EF6DB20866 for ; Sun, 5 Jan 2020 14:51: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="fgGgC9D6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF6DB20866 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 27B44178B; Sun, 5 Jan 2020 15:50:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 27B44178B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578235872; bh=NJxRqFbPzOci2bjybZhgAMDpbKqm0voqhD6vAjtmiLo=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=fgGgC9D6pBSjl20BO2ZsK/2DhmO3D0AXSu0nUShthApybpet8ggJS5rH3YLoKqSrO iSCFq/GfDGS6KOvJbqoHxw83g4Hk0owl9V7AdHaS7xnGNYMdFmYZ1N2Kmku0MhHEys 5/+iDLUKyFuGhSJF0zxOuNEaOfLfwdj3W1mA5NJA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 45DC9F80308; Sun, 5 Jan 2020 15:48:45 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A2960F80307; Sun, 5 Jan 2020 15:48:41 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BD3CDF8014A for ; Sun, 5 Jan 2020 15:48:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BD3CDF8014A 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 9AB43AC3C for ; Sun, 5 Jan 2020 14:48:31 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:16 +0100 Message-Id: <20200105144823.29547-2-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 01/68] ALSA: Allow const arrays for legacy resource management helpers 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" Declare the arrays passed to the helper functions for legacy resources (mostly for ISA drivers) as const, so that each caller can make its static data as const for minor optimizations, too. Signed-off-by: Takashi Iwai --- include/sound/initval.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sound/initval.h b/include/sound/initval.h index 3ddae2b4177e..a1ff3b4865b4 100644 --- a/include/sound/initval.h +++ b/include/sound/initval.h @@ -37,7 +37,7 @@ #define SNDRV_DEFAULT_PTR SNDRV_DEFAULT_STR #ifdef SNDRV_LEGACY_FIND_FREE_IOPORT -static long snd_legacy_find_free_ioport(long *port_table, long size) +static long snd_legacy_find_free_ioport(const long *port_table, long size) { while (*port_table != -1) { if (request_region(*port_table, size, "ALSA test")) { @@ -58,7 +58,7 @@ static irqreturn_t snd_legacy_empty_irq_handler(int irq, void *dev_id) return IRQ_HANDLED; } -static int snd_legacy_find_free_irq(int *irq_table) +static int snd_legacy_find_free_irq(const int *irq_table) { while (*irq_table != -1) { if (!request_irq(*irq_table, snd_legacy_empty_irq_handler, @@ -74,7 +74,7 @@ static int snd_legacy_find_free_irq(int *irq_table) #endif #ifdef SNDRV_LEGACY_FIND_FREE_DMA -static int snd_legacy_find_free_dma(int *dma_table) +static int snd_legacy_find_free_dma(const int *dma_table) { while (*dma_table != -1) { if (!request_dma(*dma_table, "ALSA Test DMA")) { From patchwork Sun Jan 5 14:47: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: 193977 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27294C33C8C for ; Sun, 5 Jan 2020 14:49:34 +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 2609C20801 for ; Sun, 5 Jan 2020 14:49: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="qssLLXcm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2609C20801 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 DCB90174B; Sun, 5 Jan 2020 15:48:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DCB90174B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578235771; bh=4Z8+dVOtfKUnUWFyzE3mOW5ypHNHGNUBcH9FwXiXPcU=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qssLLXcmF0usD1oK4TWAosugwtepQc6BQoQHP/E3VWSYYga6gpyPXLJ7o9lsN7PUT OHcvsFusm6FRK7Ozzh+QGSBoxslJeUvI39dL3AcjVEmsMitOTGMfjTDCZY/SIIkhhA 1YlZFsxLVLQC6w2lRF5kbw8oiQljN7D5kFReNTJw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7C99BF802DD; Sun, 5 Jan 2020 15:48:39 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 09CAFF80278; Sun, 5 Jan 2020 15:48:35 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B8379F80116 for ; Sun, 5 Jan 2020 15:48:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B8379F80116 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 A2458ADF0 for ; Sun, 5 Jan 2020 14:48:31 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:17 +0100 Message-Id: <20200105144823.29547-3-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 02/68] ALSA: aoa: More constifications 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" Apply const prefix at every place where appropriate: the static register tables, the volume tables and the callback tables. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/aoa/codecs/onyx.c | 4 ++-- sound/aoa/codecs/tas-basstreble.h | 4 ++-- sound/aoa/codecs/tas-gain-table.h | 2 +- sound/aoa/soundbus/i2sbus/core.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/aoa/codecs/onyx.c b/sound/aoa/codecs/onyx.c index f85bc8a1e2a6..12028b3e2eee 100644 --- a/sound/aoa/codecs/onyx.c +++ b/sound/aoa/codecs/onyx.c @@ -543,7 +543,7 @@ static const struct snd_kcontrol_new onyx_spdif_ctrl = { /* our registers */ -static u8 register_map[] = { +static const u8 register_map[] = { ONYX_REG_DAC_ATTEN_LEFT, ONYX_REG_DAC_ATTEN_RIGHT, ONYX_REG_CONTROL, @@ -559,7 +559,7 @@ static u8 register_map[] = { ONYX_REG_DIG_INFO4 }; -static u8 initial_values[ARRAY_SIZE(register_map)] = { +static const u8 initial_values[ARRAY_SIZE(register_map)] = { 0x80, 0x80, /* muted */ ONYX_MRST | ONYX_SRST, /* but handled specially! */ ONYX_MUTE_LEFT | ONYX_MUTE_RIGHT, diff --git a/sound/aoa/codecs/tas-basstreble.h b/sound/aoa/codecs/tas-basstreble.h index 770935af66af..14dc4e9eea73 100644 --- a/sound/aoa/codecs/tas-basstreble.h +++ b/sound/aoa/codecs/tas-basstreble.h @@ -13,7 +13,7 @@ #define TAS3004_TREBLE_ZERO 36 #define TAS3004_BASS_ZERO 36 -static u8 tas3004_treble_table[] = { +static const u8 tas3004_treble_table[] = { 150, /* -18 dB */ 149, 148, @@ -99,7 +99,7 @@ static inline u8 tas3004_treble(int idx) * I have also ignored completely differences of * +/- 1 */ -static s8 tas3004_bass_diff_to_treble[] = { +static const s8 tas3004_bass_diff_to_treble[] = { 2, /* 7 dB, offset 50 */ 2, 2, diff --git a/sound/aoa/codecs/tas-gain-table.h b/sound/aoa/codecs/tas-gain-table.h index 77b8e7dc55fd..c9ea01488181 100644 --- a/sound/aoa/codecs/tas-gain-table.h +++ b/sound/aoa/codecs/tas-gain-table.h @@ -27,7 +27,7 @@ int main() { * as easy as calculating * hwvalue = 1048576.0*exp(0.057564628*dB*2) * :) */ -static int tas_gaintable[] = { +static const int tas_gaintable[] = { 0x000000, /* -infinity dB */ 0x00014b, /* -70.0 dB */ 0x00015f, /* -69.5 dB */ diff --git a/sound/aoa/soundbus/i2sbus/core.c b/sound/aoa/soundbus/i2sbus/core.c index 17df288fbe98..faf6b03131ee 100644 --- a/sound/aoa/soundbus/i2sbus/core.c +++ b/sound/aoa/soundbus/i2sbus/core.c @@ -160,7 +160,7 @@ static int i2sbus_add_dev(struct macio_dev *macio, static const char *rnames[] = { "i2sbus: %pOFn (control)", "i2sbus: %pOFn (tx)", "i2sbus: %pOFn (rx)" }; - static irq_handler_t ints[] = { + static const irq_handler_t ints[] = { i2sbus_bus_intr, i2sbus_tx_intr, i2sbus_rx_intr From patchwork Sun Jan 5 14:47: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: 193975 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB7E0C33C8C for ; Sun, 5 Jan 2020 14:52: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 75C5D2077B for ; Sun, 5 Jan 2020 14:52: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="MEbG5VmP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75C5D2077B 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 CDF001779; Sun, 5 Jan 2020 15:51:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CDF001779 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578235942; bh=m0yatFXFPhcuzJU4ThPQ7pNynr53ORDZbWue+1W5fCU=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=MEbG5VmPEnYHr6sisWL9KJD2ggnXB+VYjN3MVODR4Nqtame5jsiCLmXC/AMxz9CFn 2z8I3KMxI1sqV7DZeuYGve++53xqPOp53M3wiLLeQn/R1v1AtRKBp1K/EUKBK+gqqs a2tUQ6tB9h4tZg82dF+jYr1qMfsLxjVtqaGRmHyg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 88BFAF801EB; Sun, 5 Jan 2020 15:48:52 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9FD08F80308; Sun, 5 Jan 2020 15:48:42 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 28990F80213 for ; Sun, 5 Jan 2020 15:48:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 28990F80213 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 CE771B174 for ; Sun, 5 Jan 2020 14:48:31 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:20 +0100 Message-Id: <20200105144823.29547-6-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 05/68] ALSA: pcm: More constifications 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" Apply const prefix to more possible places: the string tables for PCM format and co, the table for the PCM type helpers, etc. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/core/pcm.c | 12 ++++++------ sound/core/pcm_lib.c | 2 +- sound/core/pcm_misc.c | 5 +++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sound/core/pcm.c b/sound/core/pcm.c index a0f704b72a78..a141a301369f 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -163,7 +163,7 @@ static int snd_pcm_control_ioctl(struct snd_card *card, #define FORMAT(v) [SNDRV_PCM_FORMAT_##v] = #v -static char *snd_pcm_format_names[] = { +static const char * const snd_pcm_format_names[] = { FORMAT(S8), FORMAT(U8), FORMAT(S16_LE), @@ -237,12 +237,12 @@ EXPORT_SYMBOL_GPL(snd_pcm_format_name); #define START(v) [SNDRV_PCM_START_##v] = #v #define SUBFORMAT(v) [SNDRV_PCM_SUBFORMAT_##v] = #v -static char *snd_pcm_stream_names[] = { +static const char * const snd_pcm_stream_names[] = { STREAM(PLAYBACK), STREAM(CAPTURE), }; -static char *snd_pcm_state_names[] = { +static const char * const snd_pcm_state_names[] = { STATE(OPEN), STATE(SETUP), STATE(PREPARED), @@ -253,7 +253,7 @@ static char *snd_pcm_state_names[] = { STATE(SUSPENDED), }; -static char *snd_pcm_access_names[] = { +static const char * const snd_pcm_access_names[] = { ACCESS(MMAP_INTERLEAVED), ACCESS(MMAP_NONINTERLEAVED), ACCESS(MMAP_COMPLEX), @@ -261,11 +261,11 @@ static char *snd_pcm_access_names[] = { ACCESS(RW_NONINTERLEAVED), }; -static char *snd_pcm_subformat_names[] = { +static const char * const snd_pcm_subformat_names[] = { SUBFORMAT(STD), }; -static char *snd_pcm_tstamp_mode_names[] = { +static const char * const snd_pcm_tstamp_mode_names[] = { TSTAMP(NONE), TSTAMP(ENABLE), }; diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 18f498ab7af1..872a852de75c 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -1452,7 +1452,7 @@ EXPORT_SYMBOL(snd_pcm_hw_constraint_step); static int snd_pcm_hw_rule_pow2(struct snd_pcm_hw_params *params, struct snd_pcm_hw_rule *rule) { - static unsigned int pow2_sizes[] = { + static const unsigned int pow2_sizes[] = { 1<<0, 1<<1, 1<<2, 1<<3, 1<<4, 1<<5, 1<<6, 1<<7, 1<<8, 1<<9, 1<<10, 1<<11, 1<<12, 1<<13, 1<<14, 1<<15, 1<<16, 1<<17, 1<<18, 1<<19, 1<<20, 1<<21, 1<<22, 1<<23, diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c index c4eb561d2008..a6a541511534 100644 --- a/sound/core/pcm_misc.c +++ b/sound/core/pcm_misc.c @@ -42,7 +42,7 @@ struct pcm_format_data { /* we do lots of calculations on snd_pcm_format_t; shut up sparse */ #define INT __force int -static struct pcm_format_data pcm_formats[(INT)SNDRV_PCM_FORMAT_LAST+1] = { +static const struct pcm_format_data pcm_formats[(INT)SNDRV_PCM_FORMAT_LAST+1] = { [SNDRV_PCM_FORMAT_S8] = { .width = 8, .phys = 8, .le = -1, .signd = 1, .silence = {}, @@ -415,7 +415,8 @@ EXPORT_SYMBOL(snd_pcm_format_silence_64); int snd_pcm_format_set_silence(snd_pcm_format_t format, void *data, unsigned int samples) { int width; - unsigned char *dst, *pat; + unsigned char *dst; + const unsigned char *pat; if ((INT)format < 0 || (INT)format > (INT)SNDRV_PCM_FORMAT_LAST) return -EINVAL; From patchwork Sun Jan 5 14:47: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: 193973 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 652D5C33C8C for ; Sun, 5 Jan 2020 14:55: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 E21D12077B for ; Sun, 5 Jan 2020 14:54: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="Kpp5f+9Y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E21D12077B 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 10353178D; Sun, 5 Jan 2020 15:54:08 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 10353178D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578236098; bh=hytQrdjE2fL6AGuarGStzIdayG+RzaCH5L6ll/1kzhM=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Kpp5f+9YIja2bWJaoOiihAJw0EVNRD6bQOvfDCpIL/oq8kuWOrKzBrsqY6AqKi3b3 0/ovhTxBcCqAMKmXS4rdDjgNUox2PuD5aTLNrp3HNFr0EUxjBLw7fU6B6SaO1E1fch y+kPVzA+ZP0Rd7+o/2BbgpLak9NsYSQDaq0RRNxs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 49FA1F8033D; Sun, 5 Jan 2020 15:49:05 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A6522F80329; Sun, 5 Jan 2020 15:48:49 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5AF2EF80214 for ; Sun, 5 Jan 2020 15:48:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5AF2EF80214 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 DBB7FB181 for ; Sun, 5 Jan 2020 14:48:31 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:21 +0100 Message-Id: <20200105144823.29547-7-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 06/68] ALSA: seq: More constifications 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" Apply const prefix to the remaining sequencer code: the static tables for MIDI macros, RPN/NRPN, and some strings. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/core/seq/oss/seq_oss_init.c | 4 ++-- sound/core/seq/seq_midi_emul.c | 6 +++--- sound/core/seq/seq_midi_event.c | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/core/seq/oss/seq_oss_init.c b/sound/core/seq/oss/seq_oss_init.c index 6dc94efc19c9..4534a154b8c8 100644 --- a/sound/core/seq/oss/seq_oss_init.c +++ b/sound/core/seq/oss/seq_oss_init.c @@ -460,10 +460,10 @@ enabled_str(int bool) return bool ? "enabled" : "disabled"; } -static char * +static const char * filemode_str(int val) { - static char *str[] = { + static const char * const str[] = { "none", "read", "write", "read/write", }; return str[val & SNDRV_SEQ_OSS_FILE_ACMODE]; diff --git a/sound/core/seq/seq_midi_emul.c b/sound/core/seq/seq_midi_emul.c index 536ccf48ee72..198f285594e3 100644 --- a/sound/core/seq/seq_midi_emul.c +++ b/sound/core/seq/seq_midi_emul.c @@ -479,11 +479,11 @@ sysex(const struct snd_midi_op *ops, void *private, unsigned char *buf, int len, struct snd_midi_channel_set *chset) { /* GM on */ - static unsigned char gm_on_macro[] = { + static const unsigned char gm_on_macro[] = { 0x7e,0x7f,0x09,0x01, }; /* XG on */ - static unsigned char xg_on_macro[] = { + static const unsigned char xg_on_macro[] = { 0x43,0x10,0x4c,0x00,0x00,0x7e,0x00, }; /* GS prefix @@ -492,7 +492,7 @@ sysex(const struct snd_midi_op *ops, void *private, unsigned char *buf, int len, * chorus mode: XX=0x01, YY=0x38, ZZ=0-7 * master vol: XX=0x00, YY=0x04, ZZ=0-127 */ - static unsigned char gs_pfx_macro[] = { + static const unsigned char gs_pfx_macro[] = { 0x41,0x10,0x42,0x12,0x40,/*XX,YY,ZZ*/ }; diff --git a/sound/core/seq/seq_midi_event.c b/sound/core/seq/seq_midi_event.c index ae0308d4ace3..7511462fe071 100644 --- a/sound/core/seq/seq_midi_event.c +++ b/sound/core/seq/seq_midi_event.c @@ -422,12 +422,12 @@ static int extra_decode_xrpn(struct snd_midi_event *dev, unsigned char *buf, int count, struct snd_seq_event *ev) { unsigned char cmd; - char *cbytes; - static char cbytes_nrpn[4] = { MIDI_CTL_NONREG_PARM_NUM_MSB, + const char *cbytes; + static const char cbytes_nrpn[4] = { MIDI_CTL_NONREG_PARM_NUM_MSB, MIDI_CTL_NONREG_PARM_NUM_LSB, MIDI_CTL_MSB_DATA_ENTRY, MIDI_CTL_LSB_DATA_ENTRY }; - static char cbytes_rpn[4] = { MIDI_CTL_REGIST_PARM_NUM_MSB, + static const char cbytes_rpn[4] = { MIDI_CTL_REGIST_PARM_NUM_MSB, MIDI_CTL_REGIST_PARM_NUM_LSB, MIDI_CTL_MSB_DATA_ENTRY, MIDI_CTL_LSB_DATA_ENTRY }; From patchwork Sun Jan 5 14:47: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: 193971 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32F76C33C8C for ; Sun, 5 Jan 2020 14:57: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 B3A5D2077B for ; Sun, 5 Jan 2020 14:57: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="sLd2zfHO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3A5D2077B 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 F29EE1759; Sun, 5 Jan 2020 15:57:06 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F29EE1759 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578236277; bh=ccccHVtIm56mAsnDrwTQUxmTz8JQa0pDaQPSWeaawUQ=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sLd2zfHORmtoA2MsQNKsdYo3L5cwaUuPyl0LEQsTqqHRKUi64fMaRcaMLUUE/ZU8B hG1gPxHQyfNZVJY8uz65SxwofnqRf81pXdwFtu+EDzE9zBPs2X9Oy6SAJVjm9KZqLd dL88Hk9u3W591fNYGauGBjfXZQBeEfGpTHO1Dbsk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6E231F8035F; Sun, 5 Jan 2020 15:49:16 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2870AF8032A; Sun, 5 Jan 2020 15:48:55 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B9E6FF8026F for ; Sun, 5 Jan 2020 15:48:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B9E6FF8026F 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 0459DB191 for ; Sun, 5 Jan 2020 14:48:32 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:24 +0100 Message-Id: <20200105144823.29547-10-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 09/68] ALSA: hda: More constifications 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" Apply const prefix to the remaining possible places: the string tables, the rate tables, the verb tables, the index tables, etc. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/hda/hdac_device.c | 4 ++-- sound/hda/hdmi_chmap.c | 2 +- sound/hda/intel-nhlt.c | 2 +- sound/pci/hda/hda_codec.c | 6 +++--- sound/pci/hda/hda_eld.c | 6 +++--- sound/pci/hda/hda_intel.c | 8 ++++---- sound/pci/hda/hda_proc.c | 2 +- sound/pci/hda/hda_sysfs.c | 2 +- sound/pci/hda/patch_analog.c | 2 +- sound/pci/hda/patch_ca0132.c | 18 +++++++++--------- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c index 9f3e37511408..b4f8725f5ddf 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c @@ -637,7 +637,7 @@ struct hda_vendor_id { const char *name; }; -static struct hda_vendor_id hda_vendor_ids[] = { +static const struct hda_vendor_id hda_vendor_ids[] = { { 0x1002, "ATI" }, { 0x1013, "Cirrus Logic" }, { 0x1057, "Motorola" }, @@ -692,7 +692,7 @@ struct hda_rate_tbl { (AC_FMT_BASE_##base##K | (((mult) - 1) << AC_FMT_MULT_SHIFT) | \ (((div) - 1) << AC_FMT_DIV_SHIFT)) -static struct hda_rate_tbl rate_bits[] = { +static const struct hda_rate_tbl rate_bits[] = { /* rate in Hz, ALSA rate bitmask, HDA format value */ /* autodetected value used in snd_hda_query_supported_pcm */ diff --git a/sound/hda/hdmi_chmap.c b/sound/hda/hdmi_chmap.c index 886cb7811bd6..5fd6d575e123 100644 --- a/sound/hda/hdmi_chmap.c +++ b/sound/hda/hdmi_chmap.c @@ -59,7 +59,7 @@ static const char * const cea_speaker_allocation_names[] = { /* * ELD SA bits in the CEA Speaker Allocation data block */ -static int eld_speaker_allocation_bits[] = { +static const int eld_speaker_allocation_bits[] = { [0] = FL | FR, [1] = LFE, [2] = FC, diff --git a/sound/hda/intel-nhlt.c b/sound/hda/intel-nhlt.c index 097ff6c10099..99a23fe7fab9 100644 --- a/sound/hda/intel-nhlt.c +++ b/sound/hda/intel-nhlt.c @@ -7,7 +7,7 @@ #define NHLT_ACPI_HEADER_SIG "NHLT" /* Unique identification for getting NHLT blobs */ -static guid_t osc_guid = +static const guid_t osc_guid = GUID_INIT(0xA69F886E, 0x6CEB, 0x4594, 0xA4, 0x1F, 0x7B, 0x5D, 0xCE, 0x24, 0xC5, 0x53); diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index d039eeec080f..4377b2aba835 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -3201,7 +3201,7 @@ static int get_empty_pcm_device(struct hda_bus *bus, unsigned int type) /* assigned to static slots up to dev#10; if more needed, assign * the later slot dynamically (when CONFIG_SND_DYNAMIC_MINORS=y) */ - static int audio_idx[HDA_PCM_NTYPES][5] = { + static const int audio_idx[HDA_PCM_NTYPES][5] = { [HDA_PCM_TYPE_AUDIO] = { 0, 2, 4, 5, -1 }, [HDA_PCM_TYPE_SPDIF] = { 1, -1 }, [HDA_PCM_TYPE_HDMI] = { 3, 7, 8, 9, -1 }, @@ -3869,7 +3869,7 @@ EXPORT_SYMBOL_GPL(snd_hda_get_default_vref); unsigned int snd_hda_correct_pin_ctl(struct hda_codec *codec, hda_nid_t pin, unsigned int val) { - static unsigned int cap_lists[][2] = { + static const unsigned int cap_lists[][2] = { { AC_PINCTL_VREF_100, AC_PINCAP_VREF_100 }, { AC_PINCTL_VREF_80, AC_PINCAP_VREF_80 }, { AC_PINCTL_VREF_50, AC_PINCAP_VREF_50 }, @@ -4014,7 +4014,7 @@ void snd_hda_bus_reset_codecs(struct hda_bus *bus) */ void snd_print_pcm_bits(int pcm, char *buf, int buflen) { - static unsigned int bits[] = { 8, 16, 20, 24, 32 }; + static const unsigned int bits[] = { 8, 16, 20, 24, 32 }; int i, j; for (i = 0, j = 0; i < ARRAY_SIZE(bits); i++) diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c index d081fb2880a0..bb46c89b7f63 100644 --- a/sound/pci/hda/hda_eld.c +++ b/sound/pci/hda/hda_eld.c @@ -98,7 +98,7 @@ static const char * const cea_audio_coding_type_names[] = { /* * SS1:SS0 index => sample size */ -static int cea_sample_sizes[4] = { +static const int cea_sample_sizes[4] = { 0, /* 0: Refer to Stream Header */ AC_SUPPCM_BITS_16, /* 1: 16 bits */ AC_SUPPCM_BITS_20, /* 2: 20 bits */ @@ -108,7 +108,7 @@ static int cea_sample_sizes[4] = { /* * SF2:SF1:SF0 index => sampling frequency */ -static int cea_sampling_frequencies[8] = { +static const int cea_sampling_frequencies[8] = { 0, /* 0: Refer to Stream Header */ SNDRV_PCM_RATE_32000, /* 1: 32000Hz */ SNDRV_PCM_RATE_44100, /* 2: 44100Hz */ @@ -352,7 +352,7 @@ int snd_hdmi_get_eld(struct hda_codec *codec, hda_nid_t nid, */ static void hdmi_print_pcm_rates(int pcm, char *buf, int buflen) { - static unsigned int alsa_rates[] = { + static const unsigned int alsa_rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, 96000, 176400, 192000, 384000 }; diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 49f1638969e3..617143a44a10 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -372,7 +372,7 @@ enum { #define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98) -static char *driver_short_names[] = { +static const char * const driver_short_names[] = { [AZX_DRIVER_ICH] = "HDA Intel", [AZX_DRIVER_PCH] = "HDA Intel PCH", [AZX_DRIVER_SCH] = "HDA Intel MID", @@ -499,7 +499,7 @@ static void bxt_reduce_dma_latency(struct azx *chip) static int intel_get_lctl_scf(struct azx *chip) { struct hdac_bus *bus = azx_bus(chip); - static int preferred_bits[] = { 2, 3, 1, 4, 5 }; + static const int preferred_bits[] = { 2, 3, 1, 4, 5 }; u32 val, t; int i; @@ -1564,7 +1564,7 @@ static int check_position_fix(struct azx *chip, int fix) static void assign_position_fix(struct azx *chip, int fix) { - static azx_get_pos_callback_t callbacks[] = { + static const azx_get_pos_callback_t callbacks[] = { [POS_FIX_AUTO] = NULL, [POS_FIX_LPIB] = azx_get_pos_lpib, [POS_FIX_POSBUF] = azx_get_pos_posbuf, @@ -2231,7 +2231,7 @@ static void set_default_power_save(struct azx *chip) } /* number of codec slots for each chipset: 0 = default slots (i.e. 4) */ -static unsigned int azx_max_codecs[AZX_NUM_DRIVERS] = { +static const unsigned int azx_max_codecs[AZX_NUM_DRIVERS] = { [AZX_DRIVER_NVIDIA] = 8, [AZX_DRIVER_TERA] = 1, }; diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index 468836c65445..0631f31ef87f 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c @@ -160,7 +160,7 @@ static void print_amp_vals(struct snd_info_buffer *buffer, static void print_pcm_rates(struct snd_info_buffer *buffer, unsigned int pcm) { - static unsigned int rates[] = { + static const unsigned int rates[] = { 8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200, 96000, 176400, 192000, 384000 }; diff --git a/sound/pci/hda/hda_sysfs.c b/sound/pci/hda/hda_sysfs.c index fcc34417cbce..0607ed5d1959 100644 --- a/sound/pci/hda/hda_sysfs.c +++ b/sound/pci/hda/hda_sysfs.c @@ -611,7 +611,7 @@ struct hda_patch_item { void (*parser)(char *buf, struct hda_bus *bus, struct hda_codec **retc); }; -static struct hda_patch_item patch_items[NUM_LINE_MODES] = { +static const struct hda_patch_item patch_items[NUM_LINE_MODES] = { [LINE_MODE_CODEC] = { .tag = "[codec]", .parser = parse_codec_mode, diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index c64895f99299..88c46b051d14 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -812,7 +812,7 @@ static int ad1988_add_spdif_mux_ctl(struct hda_codec *codec) /* we create four static faked paths, since AD codecs have odd * widget connections regarding the SPDIF out source */ - static struct nid_path fake_paths[4] = { + static const struct nid_path fake_paths[4] = { { .depth = 3, .path = { 0x02, 0x1d, 0x1b }, diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index 250534f90ce0..46e105244ad3 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c @@ -3768,7 +3768,7 @@ static const unsigned int float_xbass_xover_lookup[] = { /* The following are for tuning of products */ #ifdef ENABLE_TUNING_CONTROLS -static unsigned int voice_focus_vals_lookup[] = { +static const unsigned int voice_focus_vals_lookup[] = { 0x41A00000, 0x41A80000, 0x41B00000, 0x41B80000, 0x41C00000, 0x41C80000, 0x41D00000, 0x41D80000, 0x41E00000, 0x41E80000, 0x41F00000, 0x41F80000, 0x42000000, 0x42040000, 0x42080000, 0x420C0000, 0x42100000, 0x42140000, @@ -3798,7 +3798,7 @@ static unsigned int voice_focus_vals_lookup[] = { 0x43300000, 0x43310000, 0x43320000, 0x43330000, 0x43340000 }; -static unsigned int mic_svm_vals_lookup[] = { +static const unsigned int mic_svm_vals_lookup[] = { 0x00000000, 0x3C23D70A, 0x3CA3D70A, 0x3CF5C28F, 0x3D23D70A, 0x3D4CCCCD, 0x3D75C28F, 0x3D8F5C29, 0x3DA3D70A, 0x3DB851EC, 0x3DCCCCCD, 0x3DE147AE, 0x3DF5C28F, 0x3E051EB8, 0x3E0F5C29, 0x3E19999A, 0x3E23D70A, 0x3E2E147B, @@ -3818,7 +3818,7 @@ static unsigned int mic_svm_vals_lookup[] = { 0x3F75C28F, 0x3F7851EC, 0x3F7AE148, 0x3F7D70A4, 0x3F800000 }; -static unsigned int equalizer_vals_lookup[] = { +static const unsigned int equalizer_vals_lookup[] = { 0xC1C00000, 0xC1B80000, 0xC1B00000, 0xC1A80000, 0xC1A00000, 0xC1980000, 0xC1900000, 0xC1880000, 0xC1800000, 0xC1700000, 0xC1600000, 0xC1500000, 0xC1400000, 0xC1300000, 0xC1200000, 0xC1100000, 0xC1000000, 0xC0E00000, @@ -3831,7 +3831,7 @@ static unsigned int equalizer_vals_lookup[] = { }; static int tuning_ctl_set(struct hda_codec *codec, hda_nid_t nid, - unsigned int *lookup, int idx) + const unsigned int *lookup, int idx) { int i = 0; @@ -7642,14 +7642,14 @@ static void ca0132_init_unsol(struct hda_codec *codec) */ /* Sends before DSP download. */ -static struct hda_verb ca0132_base_init_verbs[] = { +static const struct hda_verb ca0132_base_init_verbs[] = { /*enable ct extension*/ {0x15, VENDOR_CHIPIO_CT_EXTENSIONS_ENABLE, 0x1}, {} }; /* Send at exit. */ -static struct hda_verb ca0132_base_exit_verbs[] = { +static const struct hda_verb ca0132_base_exit_verbs[] = { /*set afg to D3*/ {0x01, AC_VERB_SET_POWER_STATE, 0x03}, /*disable ct extension*/ @@ -7659,7 +7659,7 @@ static struct hda_verb ca0132_base_exit_verbs[] = { /* Other verbs tables. Sends after DSP download. */ -static struct hda_verb ca0132_init_verbs0[] = { +static const struct hda_verb ca0132_init_verbs0[] = { /* chip init verbs */ {0x15, 0x70D, 0xF0}, {0x15, 0x70E, 0xFE}, @@ -7692,7 +7692,7 @@ static struct hda_verb ca0132_init_verbs0[] = { }; /* Extra init verbs for desktop cards. */ -static struct hda_verb ca0132_init_verbs1[] = { +static const struct hda_verb ca0132_init_verbs1[] = { {0x15, 0x70D, 0x20}, {0x15, 0x70E, 0x19}, {0x15, 0x707, 0x00}, @@ -8869,7 +8869,7 @@ static int patch_ca0132(struct hda_codec *codec) /* * patch entries */ -static struct hda_device_id snd_hda_id_ca0132[] = { +static const struct hda_device_id snd_hda_id_ca0132[] = { HDA_CODEC_ENTRY(0x11020011, "CA0132", patch_ca0132), {} /* terminator */ }; From patchwork Sun Jan 5 14:47: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: 193974 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9393C33C8C for ; Sun, 5 Jan 2020 14:53: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 74CBC2077B for ; Sun, 5 Jan 2020 14:53: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="t/qOJ/j2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74CBC2077B 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 C6BFF1779; Sun, 5 Jan 2020 15:52:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C6BFF1779 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578236023; bh=s9LARy9Td1Xx+GTaZGA8YMnUZhKlPpSJiQmMCAJ71B4=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=t/qOJ/j2u64/kJI2Pr3+q2kw9qnaPXHb1+qbeCqdjEytlWzMY/2I8Bi5pFr+vIEho 90OZ95RLe2ocs+lST14OyCIMsiez5K5cqBTb8rxzil5MSa3VxjIDBpHJNqMHvHoAo9 NTsCll6Bqx5dQ0SE7yv45JjMuuqIMFdO+vm6YYJg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8AD4CF80274; Sun, 5 Jan 2020 15:49:00 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 63285F80315; Sun, 5 Jan 2020 15:48:44 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 19E04F801F5 for ; Sun, 5 Jan 2020 15:48:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 19E04F801F5 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 11D24B19A for ; Sun, 5 Jan 2020 14:48:32 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:25 +0100 Message-Id: <20200105144823.29547-11-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 10/68] ALSA: ac97: More constifications 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" Apply const prefix to each possible place: the static tables for registers and bits, the quirk tables, etc. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/ac97/ac97_codec.c | 10 +++++----- sound/pci/ac97/ac97_patch.c | 26 +++++++++++++------------- sound/pci/ac97/ac97_pcm.c | 4 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index fcfa8499e453..6758c072000e 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c @@ -1753,10 +1753,10 @@ static unsigned int snd_ac97_determine_spdif_rates(struct snd_ac97 *ac97) { unsigned int result = 0; int i; - static unsigned short ctl_bits[] = { + static const unsigned short ctl_bits[] = { AC97_SC_SPSR_44K, AC97_SC_SPSR_32K, AC97_SC_SPSR_48K }; - static unsigned int rate_bits[] = { + static const unsigned int rate_bits[] = { SNDRV_PCM_RATE_44100, SNDRV_PCM_RATE_32000, SNDRV_PCM_RATE_48000 }; @@ -2346,7 +2346,7 @@ struct ac97_power_reg { enum { PWIDX_ADC, PWIDX_FRONT, PWIDX_CLFE, PWIDX_SURR, PWIDX_MIC, PWIDX_SIZE }; -static struct ac97_power_reg power_regs[PWIDX_SIZE] = { +static const struct ac97_power_reg power_regs[PWIDX_SIZE] = { [PWIDX_ADC] = { AC97_PCM_LR_ADC_RATE, AC97_POWERDOWN, AC97_PD_PR0}, [PWIDX_FRONT] = { AC97_PCM_FRONT_DAC_RATE, AC97_POWERDOWN, AC97_PD_PR1}, [PWIDX_CLFE] = { AC97_PCM_LFE_DAC_RATE, AC97_EXTENDED_STATUS, @@ -2829,7 +2829,7 @@ struct quirk_table { int (*func)(struct snd_ac97 *); }; -static struct quirk_table applicable_quirks[] = { +static const struct quirk_table applicable_quirks[] = { { "none", NULL }, { "hp_only", tune_hp_only }, { "swap_hp", tune_swap_hp }, @@ -2857,7 +2857,7 @@ static int apply_quirk(struct snd_ac97 *ac97, int type) static int apply_quirk_str(struct snd_ac97 *ac97, const char *typestr) { int i; - struct quirk_table *q; + const struct quirk_table *q; for (i = 0; i < ARRAY_SIZE(applicable_quirks); i++) { q = &applicable_quirks[i]; diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index 524f9d2dcb3c..ebf926728c5f 100644 --- a/sound/pci/ac97/ac97_patch.c +++ b/sound/pci/ac97/ac97_patch.c @@ -1211,25 +1211,25 @@ static const struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = { static int patch_sigmatel_stac9758(struct snd_ac97 * ac97) { - static unsigned short regs[4] = { + static const unsigned short regs[4] = { AC97_SIGMATEL_OUTSEL, AC97_SIGMATEL_IOMISC, AC97_SIGMATEL_INSEL, AC97_SIGMATEL_VARIOUS }; - static unsigned short def_regs[4] = { + static const unsigned short def_regs[4] = { /* OUTSEL */ 0xd794, /* CL:CL, SR:SR, LO:MX, LI:DS, MI:DS */ /* IOMISC */ 0x2001, /* INSEL */ 0x0201, /* LI:LI, MI:M1 */ /* VARIOUS */ 0x0040 }; - static unsigned short m675_regs[4] = { + static const unsigned short m675_regs[4] = { /* OUTSEL */ 0xfc70, /* CL:MX, SR:MX, LO:DS, LI:MX, MI:DS */ /* IOMISC */ 0x2102, /* HP amp on */ /* INSEL */ 0x0203, /* LI:LI, MI:FR */ /* VARIOUS */ 0x0041 /* stereo mic */ }; - unsigned short *pregs = def_regs; + const unsigned short *pregs = def_regs; int i; /* Gateway M675 notebook */ @@ -1361,7 +1361,7 @@ static int patch_cx20551(struct snd_ac97 *ac97) #ifdef CONFIG_PM static void ad18xx_resume(struct snd_ac97 *ac97) { - static unsigned short setup_regs[] = { + static const unsigned short setup_regs[] = { AC97_AD_MISC, AC97_AD_SERIAL_CFG, AC97_AD_JACK_SPDIF, }; int i, codec; @@ -1470,7 +1470,7 @@ static unsigned short patch_ad1881_unchained(struct snd_ac97 * ac97, int idx, un static int patch_ad1881_chained1(struct snd_ac97 * ac97, int idx, unsigned short codec_bits) { - static int cfg_bits[3] = { 1<<12, 1<<14, 1<<13 }; + static const int cfg_bits[3] = { 1<<12, 1<<14, 1<<13 }; unsigned short val; snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 0x7000, cfg_bits[idx]); @@ -1794,7 +1794,7 @@ static const struct snd_kcontrol_new snd_ac97_ad1981x_jack_sense[] = { /* black list to avoid HP/Line jack-sense controls * (SS vendor << 16 | device) */ -static unsigned int ad1981_jacks_blacklist[] = { +static const unsigned int ad1981_jacks_blacklist[] = { 0x10140523, /* Thinkpad R40 */ 0x10140534, /* Thinkpad X31 */ 0x10140537, /* Thinkpad T41p */ @@ -1838,7 +1838,7 @@ static const struct snd_ac97_build_ops patch_ad1981a_build_ops = { /* white list to enable HP jack-sense bits * (SS vendor << 16 | device) */ -static unsigned int ad1981_jacks_whitelist[] = { +static const unsigned int ad1981_jacks_whitelist[] = { 0x0e11005a, /* HP nc4000/4010 */ 0x103c0890, /* HP nc6000 */ 0x103c0938, /* HP nc4220 */ @@ -3116,22 +3116,22 @@ static void cm9761_update_jacks(struct snd_ac97 *ac97) /* FIXME: check the bits for each model * model 83 is confirmed to work */ - static unsigned short surr_on[3][2] = { + static const unsigned short surr_on[3][2] = { { 0x0008, 0x0000 }, /* 9761-78 & 82 */ { 0x0000, 0x0008 }, /* 9761-82 rev.B */ { 0x0000, 0x0008 }, /* 9761-83 */ }; - static unsigned short clfe_on[3][2] = { + static const unsigned short clfe_on[3][2] = { { 0x0000, 0x1000 }, /* 9761-78 & 82 */ { 0x1000, 0x0000 }, /* 9761-82 rev.B */ { 0x0000, 0x1000 }, /* 9761-83 */ }; - static unsigned short surr_shared[3][2] = { + static const unsigned short surr_shared[3][2] = { { 0x0000, 0x0400 }, /* 9761-78 & 82 */ { 0x0000, 0x0400 }, /* 9761-82 rev.B */ { 0x0000, 0x0400 }, /* 9761-83 */ }; - static unsigned short clfe_shared[3][2] = { + static const unsigned short clfe_shared[3][2] = { { 0x2000, 0x0880 }, /* 9761-78 & 82 */ { 0x0000, 0x2880 }, /* 9761-82 rev.B */ { 0x2000, 0x0800 }, /* 9761-83 */ @@ -3635,7 +3635,7 @@ struct vt1618_uaj_item { /* This list reflects the vt1618 docs for Vendor Defined Register 0x60. */ -static struct vt1618_uaj_item vt1618_uaj[3] = { +static const struct vt1618_uaj_item vt1618_uaj[3] = { { /* speaker jack */ .mask = 0x03, diff --git a/sound/pci/ac97/ac97_pcm.c b/sound/pci/ac97/ac97_pcm.c index 1c23a0f90559..491de1a623cb 100644 --- a/sound/pci/ac97/ac97_pcm.c +++ b/sound/pci/ac97/ac97_pcm.c @@ -26,7 +26,7 @@ * PCM support */ -static unsigned char rate_reg_tables[2][4][9] = { +static const unsigned char rate_reg_tables[2][4][9] = { { /* standard rates */ { @@ -129,7 +129,7 @@ static unsigned char rate_reg_tables[2][4][9] = { }}; /* FIXME: more various mappings for ADC? */ -static unsigned char rate_cregs[9] = { +static const unsigned char rate_cregs[9] = { AC97_PCM_LR_ADC_RATE, /* 3 */ AC97_PCM_LR_ADC_RATE, /* 4 */ 0xff, /* 5 */ From patchwork Sun Jan 5 14:47: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: 193972 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01082C33C8C for ; Sun, 5 Jan 2020 14:56: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 7FCAB2077B for ; Sun, 5 Jan 2020 14:56: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="n2Q1FhvF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FCAB2077B 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 CC9C817AC; Sun, 5 Jan 2020 15:55:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CC9C817AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578236178; bh=LHNM6QwOomgNhDkFZJlh/bSPjjSJPAcnA1f6dF8cgFs=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=n2Q1FhvFkm/pCpVV/ImuBpIm3ew4s7yDv3n2cpkHlSU3LJofIcQycqzXxHTuUnlxw HLGBG3hl6huTFVmkCeJ3p1Sjv4PMpY7ZW7zJSIk9hZjCI6HDM5rlQygcopLdzog5v1 jfjX4aQfKgZy1UvE2Kghpv0rY0AZ/A5qwh6am6xc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5FC8DF80344; Sun, 5 Jan 2020 15:49:09 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B7169F80323; Sun, 5 Jan 2020 15:48:50 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5E37BF80271 for ; Sun, 5 Jan 2020 15:48:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5E37BF80271 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 30ED6B1CF for ; Sun, 5 Jan 2020 14:48:32 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:27 +0100 Message-Id: <20200105144823.29547-13-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 12/68] ALSA: caiaq: More constifications 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" Apply const prefix to each possible place: the rate table, the controller tables, and the key tables. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/usb/caiaq/audio.c | 2 +- sound/usb/caiaq/control.c | 20 ++++++++++---------- sound/usb/caiaq/input.c | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index 41993a5c0537..e9243d53a107 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c @@ -179,7 +179,7 @@ static int snd_usb_caiaq_pcm_hw_free(struct snd_pcm_substream *sub) #error "Change this table" #endif -static unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100, +static const unsigned int rates[] = { 5512, 8000, 11025, 16000, 22050, 32000, 44100, 48000, 64000, 88200, 96000, 176400, 192000 }; static int snd_usb_caiaq_pcm_prepare(struct snd_pcm_substream *substream) diff --git a/sound/usb/caiaq/control.c b/sound/usb/caiaq/control.c index 532e354f6124..af459c49baf4 100644 --- a/sound/usb/caiaq/control.c +++ b/sound/usb/caiaq/control.c @@ -163,14 +163,14 @@ struct caiaq_controller { int index; }; -static struct caiaq_controller ak1_controller[] = { +static const struct caiaq_controller ak1_controller[] = { { "LED left", 2 }, { "LED middle", 1 }, { "LED right", 0 }, { "LED ring", 3 } }; -static struct caiaq_controller rk2_controller[] = { +static const struct caiaq_controller rk2_controller[] = { { "LED 1", 5 }, { "LED 2", 4 }, { "LED 3", 3 }, @@ -196,7 +196,7 @@ static struct caiaq_controller rk2_controller[] = { { "LED 7seg_3g", 23 } }; -static struct caiaq_controller rk3_controller[] = { +static const struct caiaq_controller rk3_controller[] = { { "LED 7seg_1a", 0 + 0 }, { "LED 7seg_1b", 0 + 1 }, { "LED 7seg_1c", 0 + 2 }, @@ -244,7 +244,7 @@ static struct caiaq_controller rk3_controller[] = { { "LED pedal", 32 + 8 } }; -static struct caiaq_controller kore_controller[] = { +static const struct caiaq_controller kore_controller[] = { { "LED F1", 8 | CNT_INTVAL }, { "LED F2", 12 | CNT_INTVAL }, { "LED F3", 0 | CNT_INTVAL }, @@ -278,7 +278,7 @@ static struct caiaq_controller kore_controller[] = { { "LED control", 26 | CNT_INTVAL } }; -static struct caiaq_controller a8dj_controller[] = { +static const struct caiaq_controller a8dj_controller[] = { { "Current input mode", 0 | CNT_INTVAL }, { "GND lift for TC Vinyl mode", 24 + 0 }, { "GND lift for TC CD/Line mode", 24 + 1 }, @@ -286,11 +286,11 @@ static struct caiaq_controller a8dj_controller[] = { { "Software lock", 40 } }; -static struct caiaq_controller a4dj_controller[] = { +static const struct caiaq_controller a4dj_controller[] = { { "Current input mode", 0 | CNT_INTVAL } }; -static struct caiaq_controller kontrolx1_controller[] = { +static const struct caiaq_controller kontrolx1_controller[] = { { "LED FX A: ON", 7 | CNT_INTVAL }, { "LED FX A: 1", 6 | CNT_INTVAL }, { "LED FX A: 2", 5 | CNT_INTVAL }, @@ -327,7 +327,7 @@ static struct caiaq_controller kontrolx1_controller[] = { { "LED Deck B: SYNC", 8 | CNT_INTVAL }, }; -static struct caiaq_controller kontrols4_controller[] = { +static const struct caiaq_controller kontrols4_controller[] = { { "LED: Master: Quant", 10 | CNT_INTVAL }, { "LED: Master: Headphone", 11 | CNT_INTVAL }, { "LED: Master: Master", 12 | CNT_INTVAL }, @@ -500,7 +500,7 @@ static struct caiaq_controller kontrols4_controller[] = { { "LED: FX2: Mode", 133 | CNT_INTVAL }, }; -static struct caiaq_controller maschine_controller[] = { +static const struct caiaq_controller maschine_controller[] = { { "LED: Pad 1", 3 | CNT_INTVAL }, { "LED: Pad 2", 2 | CNT_INTVAL }, { "LED: Pad 3", 1 | CNT_INTVAL }, @@ -568,7 +568,7 @@ static struct caiaq_controller maschine_controller[] = { { "Backlight Display", 59 | CNT_INTVAL } }; -static int add_controls(struct caiaq_controller *c, int num, +static int add_controls(const struct caiaq_controller *c, int num, struct snd_usb_caiaqdev *cdev) { int i, ret; diff --git a/sound/usb/caiaq/input.c b/sound/usb/caiaq/input.c index 533eb69fe4e6..1e2cf2f08eec 100644 --- a/sound/usb/caiaq/input.c +++ b/sound/usb/caiaq/input.c @@ -14,13 +14,13 @@ #include "device.h" #include "input.h" -static unsigned short keycode_ak1[] = { KEY_C, KEY_B, KEY_A }; -static unsigned short keycode_rk2[] = { KEY_1, KEY_2, KEY_3, KEY_4, +static const unsigned short keycode_ak1[] = { KEY_C, KEY_B, KEY_A }; +static const unsigned short keycode_rk2[] = { KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7 }; -static unsigned short keycode_rk3[] = { KEY_1, KEY_2, KEY_3, KEY_4, +static const unsigned short keycode_rk3[] = { KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9 }; -static unsigned short keycode_kore[] = { +static const unsigned short keycode_kore[] = { KEY_FN_F1, /* "menu" */ KEY_FN_F7, /* "lcd backlight */ KEY_FN_F2, /* "control" */ @@ -60,7 +60,7 @@ static unsigned short keycode_kore[] = { #define MASCHINE_PADS (16) #define MASCHINE_PAD(X) ((X) + ABS_PRESSURE) -static unsigned short keycode_maschine[] = { +static const unsigned short keycode_maschine[] = { MASCHINE_BUTTON(40), /* mute */ MASCHINE_BUTTON(39), /* solo */ MASCHINE_BUTTON(38), /* select */ From patchwork Sun Jan 5 14:47: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: 193970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3910C33C8C for ; Sun, 5 Jan 2020 14:59: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 507052077B for ; Sun, 5 Jan 2020 14:59:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="TyyJ2puJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 507052077B 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 A2ABC17AD; Sun, 5 Jan 2020 15:58:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A2ABC17AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578236361; bh=nBLsi82AVbsqlMwKxIm5imtc1/4BIvCziHL3HDTNMjY=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TyyJ2puJfjzplwbSiRWnY5SVFAj/QKTPUKV+a8rcv03JmI3+zmX2wy9YX6rUe0+cs nJboVgnETce6wY7XAirS805Y0zuIDD4yM3WryNmhZ3ab7LnwmLTOO8jBhRtRGBbbS3 UxamezUwyT8XuZD416bZedfM96xGF2SdbhGC0090= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9D5F4F802A0; Sun, 5 Jan 2020 15:49:23 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B997FF80333; Sun, 5 Jan 2020 15:48:58 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C9021F80276 for ; Sun, 5 Jan 2020 15:48:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C9021F80276 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 3EC0CB1D1 for ; Sun, 5 Jan 2020 14:48:32 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:28 +0100 Message-Id: <20200105144823.29547-14-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 13/68] ALSA: au88x0: More constifications 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" Apply const prefix to each possible place: the static register tables, the coef tables, the string arrays, etc. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/au88x0/au88x0_core.c | 2 +- sound/pci/au88x0/au88x0_eq.c | 22 +++++++++++----------- sound/pci/au88x0/au88x0_eqdata.c | 18 +++++++++--------- sound/pci/au88x0/au88x0_pcm.c | 4 ++-- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c index ce0564c5392a..f5512b72b3e0 100644 --- a/sound/pci/au88x0/au88x0_core.c +++ b/sound/pci/au88x0/au88x0_core.c @@ -1989,7 +1989,7 @@ vortex_connect_codecrec(vortex_t * vortex, int en, unsigned char mixin0, // Higher level ADB audio path (de)allocator. /* Resource manager */ -static int resnum[VORTEX_RESOURCE_LAST] = +static const int resnum[VORTEX_RESOURCE_LAST] = { NR_ADB, NR_SRC, NR_MIXIN, NR_MIXOUT, NR_A3D }; /* Checkout/Checkin resource of given type. diff --git a/sound/pci/au88x0/au88x0_eq.c b/sound/pci/au88x0/au88x0_eq.c index abaf9f912784..58e92f2a72c0 100644 --- a/sound/pci/au88x0/au88x0_eq.c +++ b/sound/pci/au88x0/au88x0_eq.c @@ -51,7 +51,7 @@ static inline u16 sign_invert(u16 a) return -a; } -static void vortex_EqHw_SetLeftCoefs(vortex_t * vortex, u16 coefs[]) +static void vortex_EqHw_SetLeftCoefs(vortex_t *vortex, const u16 coefs[]) { eqhw_t *eqhw = &(vortex->eq.this04); int i = 0, n /*esp2c */; @@ -73,7 +73,7 @@ static void vortex_EqHw_SetLeftCoefs(vortex_t * vortex, u16 coefs[]) } } -static void vortex_EqHw_SetRightCoefs(vortex_t * vortex, u16 coefs[]) +static void vortex_EqHw_SetRightCoefs(vortex_t *vortex, const u16 coefs[]) { eqhw_t *eqhw = &(vortex->eq.this04); int i = 0, n /*esp2c */; @@ -96,7 +96,7 @@ static void vortex_EqHw_SetRightCoefs(vortex_t * vortex, u16 coefs[]) } -static void vortex_EqHw_SetLeftStates(vortex_t * vortex, u16 a[], u16 b[]) +static void vortex_EqHw_SetLeftStates(vortex_t *vortex, const u16 a[], const u16 b[]) { eqhw_t *eqhw = &(vortex->eq.this04); int i = 0, ebx; @@ -113,7 +113,7 @@ static void vortex_EqHw_SetLeftStates(vortex_t * vortex, u16 a[], u16 b[]) } } -static void vortex_EqHw_SetRightStates(vortex_t * vortex, u16 a[], u16 b[]) +static void vortex_EqHw_SetRightStates(vortex_t *vortex, const u16 a[], const u16 b[]) { eqhw_t *eqhw = &(vortex->eq.this04); int i = 0, ebx; @@ -206,7 +206,7 @@ vortex_EqHw_SetRightGainsSingleTarget(vortex_t * vortex, u16 index, u16 b) hwwrite(vortex->mmio, 0x2b20c + (index * 0x30), b); } -static void vortex_EqHw_SetLeftGainsTarget(vortex_t * vortex, u16 a[]) +static void vortex_EqHw_SetLeftGainsTarget(vortex_t *vortex, const u16 a[]) { eqhw_t *eqhw = &(vortex->eq.this04); int ebx; @@ -216,7 +216,7 @@ static void vortex_EqHw_SetLeftGainsTarget(vortex_t * vortex, u16 a[]) } } -static void vortex_EqHw_SetRightGainsTarget(vortex_t * vortex, u16 a[]) +static void vortex_EqHw_SetRightGainsTarget(vortex_t *vortex, const u16 a[]) { eqhw_t *eqhw = &(vortex->eq.this04); int ebx; @@ -226,7 +226,7 @@ static void vortex_EqHw_SetRightGainsTarget(vortex_t * vortex, u16 a[]) } } -static void vortex_EqHw_SetLeftGainsCurrent(vortex_t * vortex, u16 a[]) +static void vortex_EqHw_SetLeftGainsCurrent(vortex_t *vortex, const u16 a[]) { eqhw_t *eqhw = &(vortex->eq.this04); int ebx; @@ -236,7 +236,7 @@ static void vortex_EqHw_SetLeftGainsCurrent(vortex_t * vortex, u16 a[]) } } -static void vortex_EqHw_SetRightGainsCurrent(vortex_t * vortex, u16 a[]) +static void vortex_EqHw_SetRightGainsCurrent(vortex_t *vortex, const u16 a[]) { eqhw_t *eqhw = &(vortex->eq.this04); int ebx; @@ -309,7 +309,7 @@ static void vortex_EqHw_GetRightGainsCurrent(vortex_t * vortex, u16 a[]) #endif /* EQ band levels settings */ -static void vortex_EqHw_SetLevels(vortex_t * vortex, u16 peaks[]) +static void vortex_EqHw_SetLevels(vortex_t *vortex, const u16 peaks[]) { eqhw_t *eqhw = &(vortex->eq.this04); int i; @@ -574,7 +574,7 @@ static int vortex_Eqlzr_SetAllBandsFromActiveCoeffSet(vortex_t * vortex) } static int -vortex_Eqlzr_SetAllBands(vortex_t * vortex, u16 gains[], s32 count) +vortex_Eqlzr_SetAllBands(vortex_t *vortex, const u16 gains[], s32 count) { eqlzr_t *eq = &(vortex->eq); int i; @@ -852,7 +852,7 @@ static const struct snd_kcontrol_new vortex_levels_kcontrol = { }; /* EQ band gain labels. */ -static char *EqBandLabels[10] = { +static const char * const EqBandLabels[10] = { "EQ0 31Hz\0", "EQ1 63Hz\0", "EQ2 125Hz\0", diff --git a/sound/pci/au88x0/au88x0_eqdata.c b/sound/pci/au88x0/au88x0_eqdata.c index 49a52d298b1a..a74f266f0bd0 100644 --- a/sound/pci/au88x0/au88x0_eqdata.c +++ b/sound/pci/au88x0/au88x0_eqdata.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* Data structs */ -static u16 asEqCoefsZeros[50] = { +static const u16 asEqCoefsZeros[50] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -14,7 +14,7 @@ static u16 asEqCoefsZeros[50] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, }; -static u16 asEqCoefsPipes[64] = { +static const u16 asEqCoefsPipes[64] = { 0x0000, 0x0000, 0x0000, 0x0666, 0x0000, 0x0000, 0x0666, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -33,7 +33,7 @@ static u16 asEqCoefsPipes[64] = { }; /* More coef sets can be found in the win2k "inf" file. */ -static auxxEqCoeffSet_t asEqCoefsNormal = { +static const auxxEqCoeffSet_t asEqCoefsNormal = { .LeftCoefs = { 0x7e60, 0xc19e, 0x0001, 0x0002, 0x0001, 0x7fa0, 0xc05f, 0x004f, 0x0000, 0xffb1, @@ -66,7 +66,7 @@ static auxxEqCoeffSet_t asEqCoefsNormal = { 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96} }; -static u16 eq_gains_normal[20] = { +static const u16 eq_gains_normal[20] = { 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, 0x3e96, @@ -74,22 +74,22 @@ static u16 eq_gains_normal[20] = { }; /* _rodatab60 */ -static u16 eq_gains_zero[10] = { +static const u16 eq_gains_zero[10] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 }; /* _rodatab7c: ProgramPipe */ -static u16 eq_gains_current[12] = { +static const u16 eq_gains_current[12] = { 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff }; /* _rodatab78 */ -static u16 eq_states_zero[2] = { 0x0000, 0x0000 }; +static const u16 eq_states_zero[2] = { 0x0000, 0x0000 }; -static u16 asEqOutStateZeros[48] = { +static const u16 asEqOutStateZeros[48] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -105,7 +105,7 @@ static u16 asEqOutStateZeros[48] = { }; /*_rodataba0:*/ -static u16 eq_levels[64] = { +static const u16 eq_levels[64] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c index 2cdb7845f651..d019aa566de3 100644 --- a/sound/pci/au88x0/au88x0_pcm.c +++ b/sound/pci/au88x0/au88x0_pcm.c @@ -433,14 +433,14 @@ static const struct snd_pcm_ops snd_vortex_playback_ops = { * definitions of capture are omitted here... */ -static char *vortex_pcm_prettyname[VORTEX_PCM_LAST] = { +static const char * const vortex_pcm_prettyname[VORTEX_PCM_LAST] = { CARD_NAME " ADB", CARD_NAME " SPDIF", CARD_NAME " A3D", CARD_NAME " WT", CARD_NAME " I2S", }; -static char *vortex_pcm_name[VORTEX_PCM_LAST] = { +static const char * const vortex_pcm_name[VORTEX_PCM_LAST] = { "adb", "spdif", "a3d", From patchwork Sun Jan 5 14:47: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: 193969 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48245C33C8C for ; Sun, 5 Jan 2020 15:00:48 +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 C71E12077B for ; Sun, 5 Jan 2020 15:00: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="LsXQfvgW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C71E12077B 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 1CB2F17D0; Sun, 5 Jan 2020 15:59:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1CB2F17D0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578236446; bh=YSE7Aja9qWQiGysgwURgJ9OFtPKQZRMHxf88iTt4o18=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LsXQfvgWgP8RHH0/AQLRBpBJQyCZLNt8n9vLbr6xYgXa/ZMMO4hdMtNqirlZxKgoh Q1ZoHBZ0zt+Ks/SmYUgdP6ALUSOLKk10qDjZdaKUynZohQbZU2oT3BZEDYbWN4+PXr ArOU0UuSudJSWkgP7SgO3XRBwr0fyruBYTOwKBo8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B6DEDF80384; Sun, 5 Jan 2020 15:49:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0AB93F8033E; Sun, 5 Jan 2020 15:49:03 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7D24BF80277 for ; Sun, 5 Jan 2020 15:48:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7D24BF80277 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 5BE83B1D6 for ; Sun, 5 Jan 2020 14:48:32 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:30 +0100 Message-Id: <20200105144823.29547-16-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 15/68] ALSA: riptide: More constifications 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" Apply const prefix to each lbus path table definition and its callers. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/riptide/riptide.c | 60 ++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c index 625c85428955..b4f300281822 100644 --- a/sound/pci/riptide/riptide.c +++ b/sound/pci/riptide/riptide.c @@ -361,9 +361,9 @@ enum RT_CHANNEL_IDS { enum { SB_CMD = 0, MODEM_CMD, I2S_CMD0, I2S_CMD1, FM_CMD, MAX_CMD }; struct lbuspath { - unsigned char *noconv; - unsigned char *stereo; - unsigned char *mono; + const unsigned char *noconv; + const unsigned char *stereo; + const unsigned char *mono; }; struct cmdport { @@ -464,7 +464,7 @@ struct sgd { /* scatter gather desriptor */ struct pcmhw { /* pcm descriptor */ struct lbuspath paths; - unsigned char *lbuspath; + const unsigned char *lbuspath; unsigned char source; unsigned char intdec[2]; unsigned char mixer; @@ -517,7 +517,7 @@ MODULE_DEVICE_TABLE(pci, snd_riptide_ids); /* */ -static unsigned char lbusin2out[E2SINK_MAX + 1][2] = { +static const unsigned char lbusin2out[E2SINK_MAX + 1][2] = { {NO_OUT, LS_NONE1}, {NO_OUT, LS_NONE2}, {NO_OUT, LS_NONE1}, {NO_OUT, LS_NONE2}, {NO_OUT, LS_NONE1}, {NO_OUT, LS_NONE2}, {NO_OUT, LS_NONE1}, {NO_OUT, @@ -557,63 +557,63 @@ static unsigned char lbusin2out[E2SINK_MAX + 1][2] = { LS_NONE2}, }; -static unsigned char lbus_play_opl3[] = { +static const unsigned char lbus_play_opl3[] = { DIGITAL_MIXER_IN0 + FM_MIXER, 0xff }; -static unsigned char lbus_play_modem[] = { +static const unsigned char lbus_play_modem[] = { DIGITAL_MIXER_IN0 + MODEM_MIXER, 0xff }; -static unsigned char lbus_play_i2s[] = { +static const unsigned char lbus_play_i2s[] = { INTER0_IN + I2S_INTDEC, DIGITAL_MIXER_IN0 + I2S_MIXER, 0xff }; -static unsigned char lbus_play_out[] = { +static const unsigned char lbus_play_out[] = { PDAC2ACLNK, 0xff }; -static unsigned char lbus_play_outhp[] = { +static const unsigned char lbus_play_outhp[] = { HNDSPK2ACLNK, 0xff }; -static unsigned char lbus_play_noconv1[] = { +static const unsigned char lbus_play_noconv1[] = { DIGITAL_MIXER_IN0, 0xff }; -static unsigned char lbus_play_stereo1[] = { +static const unsigned char lbus_play_stereo1[] = { INTER0_IN, DIGITAL_MIXER_IN0, 0xff }; -static unsigned char lbus_play_mono1[] = { +static const unsigned char lbus_play_mono1[] = { INTERM0_IN, DIGITAL_MIXER_IN0, 0xff }; -static unsigned char lbus_play_noconv2[] = { +static const unsigned char lbus_play_noconv2[] = { DIGITAL_MIXER_IN1, 0xff }; -static unsigned char lbus_play_stereo2[] = { +static const unsigned char lbus_play_stereo2[] = { INTER1_IN, DIGITAL_MIXER_IN1, 0xff }; -static unsigned char lbus_play_mono2[] = { +static const unsigned char lbus_play_mono2[] = { INTERM1_IN, DIGITAL_MIXER_IN1, 0xff }; -static unsigned char lbus_play_noconv3[] = { +static const unsigned char lbus_play_noconv3[] = { DIGITAL_MIXER_IN2, 0xff }; -static unsigned char lbus_play_stereo3[] = { +static const unsigned char lbus_play_stereo3[] = { INTER2_IN, DIGITAL_MIXER_IN2, 0xff }; -static unsigned char lbus_play_mono3[] = { +static const unsigned char lbus_play_mono3[] = { INTERM2_IN, DIGITAL_MIXER_IN2, 0xff }; -static unsigned char lbus_rec_noconv1[] = { +static const unsigned char lbus_rec_noconv1[] = { LBUS2ARM_FIFO5, 0xff }; -static unsigned char lbus_rec_stereo1[] = { +static const unsigned char lbus_rec_stereo1[] = { DECIM0_IN, LBUS2ARM_FIFO5, 0xff }; -static unsigned char lbus_rec_mono1[] = { +static const unsigned char lbus_rec_mono1[] = { DECIMM3_IN, LBUS2ARM_FIFO5, 0xff }; -static unsigned char play_ids[] = { 4, 1, 2, }; -static unsigned char play_sources[] = { +static const unsigned char play_ids[] = { 4, 1, 2, }; +static const unsigned char play_sources[] = { ARM2LBUS_FIFO4, ARM2LBUS_FIFO1, ARM2LBUS_FIFO2, }; -static struct lbuspath lbus_play_paths[] = { +static const struct lbuspath lbus_play_paths[] = { { .noconv = lbus_play_noconv1, .stereo = lbus_play_stereo1, @@ -737,7 +737,7 @@ static int loadfirmware(struct cmdif *cif, const unsigned char *img, static void alloclbuspath(struct cmdif *cif, unsigned char source, - unsigned char *path, unsigned char *mixer, unsigned char *s) + const unsigned char *path, unsigned char *mixer, unsigned char *s) { while (*path != 0xff) { unsigned char sink, type; @@ -765,7 +765,7 @@ alloclbuspath(struct cmdif *cif, unsigned char source, } } if (*path++ & SPLIT_PATH) { - unsigned char *npath = path; + const unsigned char *npath = path; while (*npath != 0xff) npath++; @@ -775,7 +775,7 @@ alloclbuspath(struct cmdif *cif, unsigned char source, } static void -freelbuspath(struct cmdif *cif, unsigned char source, unsigned char *path) +freelbuspath(struct cmdif *cif, unsigned char source, const unsigned char *path) { while (*path != 0xff) { unsigned char sink; @@ -787,7 +787,7 @@ freelbuspath(struct cmdif *cif, unsigned char source, unsigned char *path) source = lbusin2out[sink][0]; } if (*path++ & SPLIT_PATH) { - unsigned char *npath = path; + const unsigned char *npath = path; while (*npath != 0xff) npath++; @@ -1441,7 +1441,7 @@ static int snd_riptide_prepare(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct pcmhw *data = get_pcmhwdev(substream); struct cmdif *cif = chip->cif; - unsigned char *lbuspath = NULL; + const unsigned char *lbuspath = NULL; unsigned int rate, channels; int err = 0; snd_pcm_format_t format; From patchwork Sun Jan 5 14:47: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: 193968 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF493C33C8C for ; Sun, 5 Jan 2020 15:02:03 +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 4B0B12077B for ; Sun, 5 Jan 2020 15:02: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="SzQmxMZ4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B0B12077B 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 9CF7D17AD; Sun, 5 Jan 2020 16:01:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9CF7D17AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578236521; bh=TRHFGaI2T8DwwO2alhzpATOXfGZ7ao9OI6Eib07fLsk=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SzQmxMZ4Zdn1e2bFCTks1qPVP0PI/7MYrc3S82p/3AASz8ok/jb/nEqjH8V57BJHC MPXDh5gW238U9i1hCtLjHHzX9UA4Fx/71zk4hMxuNQnLcgqkLU8typpel/K/AxYwim goNYbtihV/cpGlKxDtCDGU/7NDDY0btl7COodBnY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C2EA8F8038E; Sun, 5 Jan 2020 15:49:35 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 75945F8033F; Sun, 5 Jan 2020 15:49:05 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 74B22F80273 for ; Sun, 5 Jan 2020 15:48:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 74B22F80273 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 6CA0BB1DB for ; Sun, 5 Jan 2020 14:48:32 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:31 +0100 Message-Id: <20200105144823.29547-17-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 16/68] ALSA: ice1712: More constifications 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" Apply const prefix to each possible place: the EEPROM tables, the static string arrays, the init verb tables, etc. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/ice1712/aureon.c | 8 ++++---- sound/pci/ice1712/juli.c | 6 +++--- sound/pci/ice1712/maya44.c | 10 +++++----- sound/pci/ice1712/phase.c | 4 ++-- sound/pci/ice1712/pontis.c | 2 +- sound/pci/ice1712/prodigy192.c | 2 +- sound/pci/ice1712/prodigy_hifi.c | 16 ++++++++-------- sound/pci/ice1712/psc724.c | 2 +- sound/pci/ice1712/quartet.c | 8 ++++---- sound/pci/ice1712/se.c | 8 ++++---- sound/pci/ice1712/vt1720_mobo.c | 4 ++-- sound/pci/ice1712/wtm.c | 6 +++--- 12 files changed, 38 insertions(+), 38 deletions(-) diff --git a/sound/pci/ice1712/aureon.c b/sound/pci/ice1712/aureon.c index 025fe7820620..9a30f6d35d13 100644 --- a/sound/pci/ice1712/aureon.c +++ b/sound/pci/ice1712/aureon.c @@ -2133,7 +2133,7 @@ static int aureon_init(struct snd_ice1712 *ice) * hence the driver needs to sets up it properly. */ -static unsigned char aureon51_eeprom[] = { +static const unsigned char aureon51_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x0a, /* clock 512, spdif-in/ADC, 3DACs */ [ICE_EEP2_ACLINK] = 0x80, /* I2S */ [ICE_EEP2_I2S] = 0xfc, /* vol, 96k, 24bit, 192k */ @@ -2149,7 +2149,7 @@ static unsigned char aureon51_eeprom[] = { [ICE_EEP2_GPIO_STATE2] = 0x00, }; -static unsigned char aureon71_eeprom[] = { +static const unsigned char aureon71_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x0b, /* clock 512, spdif-in/ADC, 4DACs */ [ICE_EEP2_ACLINK] = 0x80, /* I2S */ [ICE_EEP2_I2S] = 0xfc, /* vol, 96k, 24bit, 192k */ @@ -2166,7 +2166,7 @@ static unsigned char aureon71_eeprom[] = { }; #define prodigy71_eeprom aureon71_eeprom -static unsigned char aureon71_universe_eeprom[] = { +static const unsigned char aureon71_universe_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x2b, /* clock 512, mpu401, spdif-in/ADC, * 4DACs */ @@ -2184,7 +2184,7 @@ static unsigned char aureon71_universe_eeprom[] = { [ICE_EEP2_GPIO_STATE2] = 0x00, }; -static unsigned char prodigy71lt_eeprom[] = { +static const unsigned char prodigy71lt_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x4b, /* clock 384, spdif-in/ADC, 4DACs */ [ICE_EEP2_ACLINK] = 0x80, /* I2S */ [ICE_EEP2_I2S] = 0xfc, /* vol, 96k, 24bit, 192k */ diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c index 079e58ec8b09..7be4eb42f05e 100644 --- a/sound/pci/ice1712/juli.c +++ b/sound/pci/ice1712/juli.c @@ -397,7 +397,7 @@ static const struct snd_kcontrol_new juli_mute_controls[] = { }, }; -static char *slave_vols[] = { +static const char * const slave_vols[] = { PCM_VOLUME, MONITOR_AN_IN_VOLUME, MONITOR_DIG_IN_VOLUME, @@ -420,7 +420,7 @@ static struct snd_kcontrol *ctl_find(struct snd_card *card, static void add_slaves(struct snd_card *card, struct snd_kcontrol *master, - char * const *list) + const char * const *list) { for (; *list; list++) { struct snd_kcontrol *slave = ctl_find(card, *list); @@ -651,7 +651,7 @@ static int juli_init(struct snd_ice1712 *ice) * hence the driver needs to sets up it properly. */ -static unsigned char juli_eeprom[] = { +static const unsigned char juli_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x2b, /* clock 512, mpu401, 1xADC, 1xDACs, SPDIF in */ [ICE_EEP2_ACLINK] = 0x80, /* I2S */ diff --git a/sound/pci/ice1712/maya44.c b/sound/pci/ice1712/maya44.c index c2761e009c67..b46df1821251 100644 --- a/sound/pci/ice1712/maya44.c +++ b/sound/pci/ice1712/maya44.c @@ -116,7 +116,7 @@ struct maya_vol_info { unsigned char mux_bits[2]; /* extra bits for ADC mute */ }; -static struct maya_vol_info vol_info[WM_NUM_VOLS] = { +static const struct maya_vol_info vol_info[WM_NUM_VOLS] = { [WM_VOL_HP] = { .maxval = 80, .regs = { WM8776_REG_HEADPHONE_L, WM8776_REG_HEADPHONE_R }, @@ -158,7 +158,7 @@ static int maya_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { unsigned int idx = kcontrol->private_value; - struct maya_vol_info *vol = &vol_info[idx]; + const struct maya_vol_info *vol = &vol_info[idx]; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->count = 2; @@ -189,7 +189,7 @@ static int maya_vol_put(struct snd_kcontrol *kcontrol, struct snd_wm8776 *wm = &chip->wm[snd_ctl_get_ioff(kcontrol, &ucontrol->id)]; unsigned int idx = kcontrol->private_value; - struct maya_vol_info *vol = &vol_info[idx]; + const struct maya_vol_info *vol = &vol_info[idx]; unsigned int val, data; int ch, changed = 0; @@ -662,7 +662,7 @@ static const struct snd_pcm_hw_constraint_list dac_rates = { /* * chip addresses on I2C bus */ -static unsigned char wm8776_addr[2] = { +static const unsigned char wm8776_addr[2] = { 0x34, 0x36, /* codec 0 & 1 */ }; @@ -712,7 +712,7 @@ static int maya44_init(struct snd_ice1712 *ice) * hence the driver needs to sets up it properly. */ -static unsigned char maya44_eeprom[] = { +static const unsigned char maya44_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x45, /* clock xin1=49.152MHz, mpu401, 2 stereo ADCs+DACs */ [ICE_EEP2_ACLINK] = 0x80, diff --git a/sound/pci/ice1712/phase.c b/sound/pci/ice1712/phase.c index ced4a2bfd08e..1e47e46ab8ac 100644 --- a/sound/pci/ice1712/phase.c +++ b/sound/pci/ice1712/phase.c @@ -157,7 +157,7 @@ static int phase22_add_controls(struct snd_ice1712 *ice) return 0; } -static unsigned char phase22_eeprom[] = { +static const unsigned char phase22_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x28, /* clock 512, mpu 401, spdif-in/1xADC, 1xDACs */ [ICE_EEP2_ACLINK] = 0x80, /* I2S */ @@ -174,7 +174,7 @@ static unsigned char phase22_eeprom[] = { [ICE_EEP2_GPIO_STATE2] = 0x00, }; -static unsigned char phase28_eeprom[] = { +static const unsigned char phase28_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x2b, /* clock 512, mpu401, spdif-in/1xADC, 4xDACs */ [ICE_EEP2_ACLINK] = 0x80, /* I2S */ diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c index 8ddb6c35a5e6..683909ca147c 100644 --- a/sound/pci/ice1712/pontis.c +++ b/sound/pci/ice1712/pontis.c @@ -778,7 +778,7 @@ static int pontis_init(struct snd_ice1712 *ice) * hence the driver needs to sets up it properly. */ -static unsigned char pontis_eeprom[] = { +static const unsigned char pontis_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x08, /* clock 256, mpu401, spdif-in/ADC, 1DAC */ [ICE_EEP2_ACLINK] = 0x80, /* I2S */ [ICE_EEP2_I2S] = 0xf8, /* vol, 96k, 24bit, 192k */ diff --git a/sound/pci/ice1712/prodigy192.c b/sound/pci/ice1712/prodigy192.c index 105716961e39..8df14f63b10d 100644 --- a/sound/pci/ice1712/prodigy192.c +++ b/sound/pci/ice1712/prodigy192.c @@ -753,7 +753,7 @@ static int prodigy192_init(struct snd_ice1712 *ice) * hence the driver needs to sets up it properly. */ -static unsigned char prodigy71_eeprom[] = { +static const unsigned char prodigy71_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x6a, /* 49MHz crystal, mpu401, * spdif-in+ 1 stereo ADC, * 3 stereo DACs diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c index ba37f7eab166..91f83cef0e56 100644 --- a/sound/pci/ice1712/prodigy_hifi.c +++ b/sound/pci/ice1712/prodigy_hifi.c @@ -930,7 +930,7 @@ static int prodigy_hd2_add_controls(struct snd_ice1712 *ice) static void wm8766_init(struct snd_ice1712 *ice) { - static unsigned short wm8766_inits[] = { + static const unsigned short wm8766_inits[] = { WM8766_RESET, 0x0000, WM8766_DAC_CTRL, 0x0120, WM8766_INT_CTRL, 0x0022, /* I2S Normal Mode, 24 bit */ @@ -953,7 +953,7 @@ static void wm8766_init(struct snd_ice1712 *ice) static void wm8776_init(struct snd_ice1712 *ice) { - static unsigned short wm8776_inits[] = { + static const unsigned short wm8776_inits[] = { /* These come first to reduce init pop noise */ WM_ADC_MUX, 0x0003, /* ADC mute */ /* 0x00c0 replaced by 0x0003 */ @@ -973,7 +973,7 @@ static void wm8776_init(struct snd_ice1712 *ice) #ifdef CONFIG_PM_SLEEP static int prodigy_hifi_resume(struct snd_ice1712 *ice) { - static unsigned short wm8776_reinit_registers[] = { + static const unsigned short wm8776_reinit_registers[] = { WM_MASTER_CTRL, WM_DAC_INT, WM_ADC_INT, @@ -1033,7 +1033,7 @@ static int prodigy_hifi_resume(struct snd_ice1712 *ice) */ static int prodigy_hifi_init(struct snd_ice1712 *ice) { - static unsigned short wm8776_defaults[] = { + static const unsigned short wm8776_defaults[] = { WM_MASTER_CTRL, 0x0022, /* 256fs, slave mode */ WM_DAC_INT, 0x0022, /* I2S, normal polarity, 24bit */ WM_ADC_INT, 0x0022, /* I2S, normal polarity, 24bit */ @@ -1108,7 +1108,7 @@ static int prodigy_hifi_init(struct snd_ice1712 *ice) */ static void ak4396_init(struct snd_ice1712 *ice) { - static unsigned short ak4396_inits[] = { + static const unsigned short ak4396_inits[] = { AK4396_CTRL1, 0x87, /* I2S Normal Mode, 24 bit */ AK4396_CTRL2, 0x02, AK4396_CTRL3, 0x00, @@ -1180,7 +1180,7 @@ static int prodigy_hd2_init(struct snd_ice1712 *ice) } -static unsigned char prodigy71hifi_eeprom[] = { +static const unsigned char prodigy71hifi_eeprom[] = { 0x4b, /* SYSCONF: clock 512, spdif-in/ADC, 4DACs */ 0x80, /* ACLINK: I2S */ 0xfc, /* I2S: vol, 96k, 24bit, 192k */ @@ -1196,7 +1196,7 @@ static unsigned char prodigy71hifi_eeprom[] = { 0x00, /* GPIO_STATE2 */ }; -static unsigned char prodigyhd2_eeprom[] = { +static const unsigned char prodigyhd2_eeprom[] = { 0x4b, /* SYSCONF: clock 512, spdif-in/ADC, 4DACs */ 0x80, /* ACLINK: I2S */ 0xfc, /* I2S: vol, 96k, 24bit, 192k */ @@ -1212,7 +1212,7 @@ static unsigned char prodigyhd2_eeprom[] = { 0x00, /* GPIO_STATE2 */ }; -static unsigned char fortissimo4_eeprom[] = { +static const unsigned char fortissimo4_eeprom[] = { 0x43, /* SYSCONF: clock 512, ADC, 4DACs */ 0x80, /* ACLINK: I2S */ 0xfc, /* I2S: vol, 96k, 24bit, 192k */ diff --git a/sound/pci/ice1712/psc724.c b/sound/pci/ice1712/psc724.c index 7287ebed2b5a..7aa3f92040d0 100644 --- a/sound/pci/ice1712/psc724.c +++ b/sound/pci/ice1712/psc724.c @@ -420,7 +420,7 @@ static void psc724_exit(struct snd_ice1712 *ice) } /* PSC724 has buggy EEPROM (no 96&192kHz, all FFh GPIOs), so override it here */ -static unsigned char psc724_eeprom[] = { +static const unsigned char psc724_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x42, /* 49.152MHz, 1 ADC, 3 DACs */ [ICE_EEP2_ACLINK] = 0x80, /* I2S */ [ICE_EEP2_I2S] = 0xf0, /* I2S volume, 96kHz, 24bit */ diff --git a/sound/pci/ice1712/quartet.c b/sound/pci/ice1712/quartet.c index bfd811a08d90..866596205710 100644 --- a/sound/pci/ice1712/quartet.c +++ b/sound/pci/ice1712/quartet.c @@ -657,7 +657,7 @@ static int qtet_php_put(struct snd_kcontrol *kcontrol, .get_register = get_##xreg,\ .texts = {xtext1, xtext2} } -static struct qtet_kcontrol_private qtet_privates[] = { +static const struct qtet_kcontrol_private qtet_privates[] = { PRIV_ENUM2(IN12_SEL, CPLD_IN12_SEL, cpld, "An In 1/2", "An In 3/4"), PRIV_ENUM2(IN34_SEL, CPLD_IN34_SEL, cpld, "An In 3/4", "IEC958 In"), PRIV_ENUM2(AIN34_SEL, SCR_AIN34_SEL, scr, "Line In 3/4", "Hi-Z"), @@ -757,7 +757,7 @@ static const struct snd_kcontrol_new qtet_controls[] = { QTET_CONTROL("Output 3/4 to Monitor 1/2", sw, OUT34_MON12), }; -static char *slave_vols[] = { +static const char * const slave_vols[] = { PCM_12_PLAYBACK_VOLUME, PCM_34_PLAYBACK_VOLUME, NULL @@ -777,7 +777,7 @@ static struct snd_kcontrol *ctl_find(struct snd_card *card, } static void add_slaves(struct snd_card *card, - struct snd_kcontrol *master, char * const *list) + struct snd_kcontrol *master, const char * const *list) { for (; *list; list++) { struct snd_kcontrol *slave = ctl_find(card, *list); @@ -1053,7 +1053,7 @@ static int qtet_init(struct snd_ice1712 *ice) return 0; } -static unsigned char qtet_eeprom[] = { +static const unsigned char qtet_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x28, /* clock 256(24MHz), mpu401, 1xADC, 1xDACs, SPDIF in */ [ICE_EEP2_ACLINK] = 0x80, /* I2S */ diff --git a/sound/pci/ice1712/se.c b/sound/pci/ice1712/se.c index fdc502783e07..ffa9d8860a5a 100644 --- a/sound/pci/ice1712/se.c +++ b/sound/pci/ice1712/se.c @@ -245,7 +245,7 @@ static const char * const se200pci_sel[] = { static void se200pci_WM8776_set_input_selector(struct snd_ice1712 *ice, unsigned int sel) { - static unsigned char vals[] = { + static const unsigned char vals[] = { /* LINE, CD, MIC, ALL, GND */ 0x10, 0x04, 0x08, 0x1c, 0x03 }; @@ -288,7 +288,7 @@ static void se200pci_WM8776_set_agc(struct snd_ice1712 *ice, unsigned int agc) static void se200pci_WM8776_init(struct snd_ice1712 *ice) { int i; - static unsigned short default_values[] = { + static const unsigned short default_values[] = { 0x100, 0x100, 0x100, 0x100, 0x100, 0x100, 0x000, 0x090, 0x000, 0x000, @@ -701,7 +701,7 @@ static int se_add_controls(struct snd_ice1712 *ice) /* entry point */ /****************************************************************************/ -static unsigned char se200pci_eeprom[] = { +static const unsigned char se200pci_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x4b, /* 49.152Hz, spdif-in/ADC, 4DACs */ [ICE_EEP2_ACLINK] = 0x80, /* I2S */ [ICE_EEP2_I2S] = 0x78, /* 96k-ok, 24bit, 192k-ok */ @@ -720,7 +720,7 @@ static unsigned char se200pci_eeprom[] = { [ICE_EEP2_GPIO_STATE2] = 0x07, /* WM8766 ML/MC/MD */ }; -static unsigned char se90pci_eeprom[] = { +static const unsigned char se90pci_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x4b, /* 49.152Hz, spdif-in/ADC, 4DACs */ [ICE_EEP2_ACLINK] = 0x80, /* I2S */ [ICE_EEP2_I2S] = 0x78, /* 96k-ok, 24bit, 192k-ok */ diff --git a/sound/pci/ice1712/vt1720_mobo.c b/sound/pci/ice1712/vt1720_mobo.c index 3d240125a644..47470b07197c 100644 --- a/sound/pci/ice1712/vt1720_mobo.c +++ b/sound/pci/ice1712/vt1720_mobo.c @@ -39,7 +39,7 @@ static int k8x800_add_controls(struct snd_ice1712 *ice) /* EEPROM image */ -static unsigned char k8x800_eeprom[] = { +static const unsigned char k8x800_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */ [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */ [ICE_EEP2_I2S] = 0x00, /* - */ @@ -55,7 +55,7 @@ static unsigned char k8x800_eeprom[] = { [ICE_EEP2_GPIO_STATE2] = 0x00, /* - */ }; -static unsigned char sn25p_eeprom[] = { +static const unsigned char sn25p_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x01, /* clock 256, 1ADC, 2DACs */ [ICE_EEP2_ACLINK] = 0x02, /* ACLINK, packed */ [ICE_EEP2_I2S] = 0x00, /* - */ diff --git a/sound/pci/ice1712/wtm.c b/sound/pci/ice1712/wtm.c index 4a7315ad51e8..f613f0067d8c 100644 --- a/sound/pci/ice1712/wtm.c +++ b/sound/pci/ice1712/wtm.c @@ -567,12 +567,12 @@ static int wtm_add_controls(struct snd_ice1712 *ice) static int wtm_init(struct snd_ice1712 *ice) { - static unsigned short stac_inits_wtm[] = { + static const unsigned short stac_inits_wtm[] = { STAC946X_RESET, 0, STAC946X_MASTER_CLOCKING, 0x11, (unsigned short)-1 }; - unsigned short *p; + const unsigned short *p; struct wtm_spec *spec; /*WTM 192M*/ @@ -599,7 +599,7 @@ static int wtm_init(struct snd_ice1712 *ice) } -static unsigned char wtm_eeprom[] = { +static const unsigned char wtm_eeprom[] = { [ICE_EEP2_SYSCONF] = 0x67, /*SYSCONF: clock 192KHz, mpu401, 4ADC, 8DAC */ [ICE_EEP2_ACLINK] = 0x80, /* ACLINK : I2S */ From patchwork Sun Jan 5 14:47: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: 193962 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 719D3C33C8C for ; Sun, 5 Jan 2020 15:10: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 F04F12085B for ; Sun, 5 Jan 2020 15:10:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="XnBE8a3o" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F04F12085B 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 555D117EB; Sun, 5 Jan 2020 16:09:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 555D117EB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237004; bh=rBJk/lVckO1jgGaq487RFVe1jFRQ62hDLm2UbaIaaPU=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XnBE8a3oXwcbDC+LkfC586GjH5qjGkxBX+jDxK+30aamQSuBgmJYYQ2POOxcyF+4T gbjOMRnHZNK7oN504xubfDU0DHPTC1QEF2iF5Y/i2gdGIUAjkj0VOGfl8WkrAjmC4r PTYHXIifS8/22lzwlW36KhekicXYJ+5MlUk+aPpk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 42FB2F803FE; Sun, 5 Jan 2020 15:50:12 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 33172F8028D; Sun, 5 Jan 2020 15:49:19 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3A6F7F8027D for ; Sun, 5 Jan 2020 15:48:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3A6F7F8027D 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 7B3EFB1DC for ; Sun, 5 Jan 2020 14:48:32 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:32 +0100 Message-Id: <20200105144823.29547-18-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 17/68] ALSA: ppc: More constifications 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" Apply const prefix to each possible place: the static tables for rate, volume, etc. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/ppc/beep.c | 2 +- sound/ppc/pmac.c | 8 ++++---- sound/ppc/pmac.h | 2 +- sound/ppc/tumbler.c | 20 ++++++++++---------- sound/ppc/tumbler_volume.h | 12 ++++++------ 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/sound/ppc/beep.c b/sound/ppc/beep.c index e2806b8aee53..6bc586a5db0f 100644 --- a/sound/ppc/beep.c +++ b/sound/ppc/beep.c @@ -44,7 +44,7 @@ void snd_pmac_beep_stop(struct snd_pmac *chip) * so we can multiply by an amplitude in the range 0..100 to get a * signed short value to put in the output buffer. */ -static short beep_wform[256] = { +static const short beep_wform[256] = { 0, 40, 79, 117, 153, 187, 218, 245, 269, 288, 304, 316, 323, 327, 327, 324, 318, 310, 299, 288, 275, 262, 249, 236, diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 87738ddc8bfd..592532c09a82 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -24,11 +24,11 @@ /* fixed frequency table for awacs, screamer, burgundy, DACA (44100 max) */ -static int awacs_freqs[8] = { +static const int awacs_freqs[8] = { 44100, 29400, 22050, 17640, 14700, 11025, 8820, 7350 }; /* fixed frequency table for tumbler */ -static int tumbler_freqs[1] = { +static const int tumbler_freqs[1] = { 44100 }; @@ -1174,7 +1174,7 @@ int snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) np = chip->node; chip->requested = 0; if (chip->is_k2) { - static char *rnames[] = { + static const char * const rnames[] = { "Sound Control", "Sound DMA" }; for (i = 0; i < 2; i ++) { if (of_address_to_resource(np->parent, i, @@ -1199,7 +1199,7 @@ int snd_pmac_new(struct snd_card *card, struct snd_pmac **chip_return) txdma_addr = chip->rsrc[1].start; rxdma_addr = txdma_addr + 0x100; } else { - static char *rnames[] = { + static const char * const rnames[] = { "Sound Control", "Sound Tx DMA", "Sound Rx DMA" }; for (i = 0; i < 3; i ++) { if (of_address_to_resource(np, i, diff --git a/sound/ppc/pmac.h b/sound/ppc/pmac.h index 529f5a9f9039..a758caf689d2 100644 --- a/sound/ppc/pmac.h +++ b/sound/ppc/pmac.h @@ -104,7 +104,7 @@ struct snd_pmac { struct resource rsrc[3]; int num_freqs; - int *freq_table; + const int *freq_table; unsigned int freqs_ok; /* bit flags */ unsigned int formats_ok; /* pcm hwinfo */ int active; diff --git a/sound/ppc/tumbler.c b/sound/ppc/tumbler.c index a5843035d718..6e5bdaa262b0 100644 --- a/sound/ppc/tumbler.c +++ b/sound/ppc/tumbler.c @@ -106,7 +106,7 @@ struct pmac_tumbler { /* */ -static int send_init_client(struct pmac_keywest *i2c, unsigned int *regs) +static int send_init_client(struct pmac_keywest *i2c, const unsigned int *regs) { while (*regs > 0) { int err, count = 10; @@ -128,7 +128,7 @@ static int send_init_client(struct pmac_keywest *i2c, unsigned int *regs) static int tumbler_init_client(struct pmac_keywest *i2c) { - static unsigned int regs[] = { + static const unsigned int regs[] = { /* normal operation, SCLK=64fps, i2s output, i2s input, 16bit width */ TAS_REG_MCS, (1<<6)|(2<<4)|(2<<2)|0, 0, /* terminator */ @@ -139,7 +139,7 @@ static int tumbler_init_client(struct pmac_keywest *i2c) static int snapper_init_client(struct pmac_keywest *i2c) { - static unsigned int regs[] = { + static const unsigned int regs[] = { /* normal operation, SCLK=64fps, i2s output, 16bit width */ TAS_REG_MCS, (1<<6)|(2<<4)|0, /* normal operation, all-pass mode */ @@ -478,11 +478,11 @@ struct tumbler_mono_vol { int reg; int bytes; unsigned int max; - unsigned int *table; + const unsigned int *table; }; static int tumbler_set_mono_volume(struct pmac_tumbler *mix, - struct tumbler_mono_vol *info) + const struct tumbler_mono_vol *info) { unsigned char block[4]; unsigned int vol; @@ -553,7 +553,7 @@ static int tumbler_put_mono(struct snd_kcontrol *kcontrol, } /* TAS3001c mono volumes */ -static struct tumbler_mono_vol tumbler_pcm_vol_info = { +static const struct tumbler_mono_vol tumbler_pcm_vol_info = { .index = VOL_IDX_PCM_MONO, .reg = TAS_REG_PCM, .bytes = 3, @@ -561,7 +561,7 @@ static struct tumbler_mono_vol tumbler_pcm_vol_info = { .table = mixer_volume_table, }; -static struct tumbler_mono_vol tumbler_bass_vol_info = { +static const struct tumbler_mono_vol tumbler_bass_vol_info = { .index = VOL_IDX_BASS, .reg = TAS_REG_BASS, .bytes = 1, @@ -569,7 +569,7 @@ static struct tumbler_mono_vol tumbler_bass_vol_info = { .table = bass_volume_table, }; -static struct tumbler_mono_vol tumbler_treble_vol_info = { +static const struct tumbler_mono_vol tumbler_treble_vol_info = { .index = VOL_IDX_TREBLE, .reg = TAS_REG_TREBLE, .bytes = 1, @@ -578,7 +578,7 @@ static struct tumbler_mono_vol tumbler_treble_vol_info = { }; /* TAS3004 mono volumes */ -static struct tumbler_mono_vol snapper_bass_vol_info = { +static const struct tumbler_mono_vol snapper_bass_vol_info = { .index = VOL_IDX_BASS, .reg = TAS_REG_BASS, .bytes = 1, @@ -586,7 +586,7 @@ static struct tumbler_mono_vol snapper_bass_vol_info = { .table = snapper_bass_volume_table, }; -static struct tumbler_mono_vol snapper_treble_vol_info = { +static const struct tumbler_mono_vol snapper_treble_vol_info = { .index = VOL_IDX_TREBLE, .reg = TAS_REG_TREBLE, .bytes = 1, diff --git a/sound/ppc/tumbler_volume.h b/sound/ppc/tumbler_volume.h index 549ec6a31a98..16d548019ee9 100644 --- a/sound/ppc/tumbler_volume.h +++ b/sound/ppc/tumbler_volume.h @@ -2,7 +2,7 @@ /* volume tables, taken from TAS3001c data manual */ /* volume gain values */ /* 0 = -70 dB, 175 = 18.0 dB in 0.5 dB step */ -static unsigned int master_volume_table[] = { +static const unsigned int master_volume_table[] = { 0x00000015, 0x00000016, 0x00000017, 0x00000019, 0x0000001a, 0x0000001c, 0x0000001d, 0x0000001f, 0x00000021, @@ -66,7 +66,7 @@ static unsigned int master_volume_table[] = { /* treble table for TAS3001c */ /* 0 = -18 dB, 72 = 18 dB in 0.5 dB step */ -static unsigned int treble_volume_table[] = { +static const unsigned int treble_volume_table[] = { 0x96, 0x95, 0x94, 0x93, 0x92, 0x91, 0x90, 0x8f, 0x8e, @@ -96,7 +96,7 @@ static unsigned int treble_volume_table[] = { /* bass table for TAS3001c */ /* 0 = -18 dB, 72 = 18 dB in 0.5 dB step */ -static unsigned int bass_volume_table[] = { +static const unsigned int bass_volume_table[] = { 0x86, 0x82, 0x7f, 0x7d, 0x7a, 0x78, 0x76, 0x74, 0x72, @@ -126,7 +126,7 @@ static unsigned int bass_volume_table[] = { /* mixer (pcm) volume table */ /* 0 = -70 dB, 175 = 18.0 dB in 0.5 dB step */ -static unsigned int mixer_volume_table[] = { +static const unsigned int mixer_volume_table[] = { 0x00014b, 0x00015f, 0x000174, 0x00018a, 0x0001a1, 0x0001ba, 0x0001d4, 0x0001f0, 0x00020d, @@ -191,7 +191,7 @@ static unsigned int mixer_volume_table[] = { /* treble table for TAS3004 */ /* 0 = -18 dB, 72 = 18 dB in 0.5 dB step */ -static unsigned int snapper_treble_volume_table[] = { +static const unsigned int snapper_treble_volume_table[] = { 0x96, 0x95, 0x94, 0x93, 0x92, 0x91, 0x90, 0x8f, 0x8e, @@ -221,7 +221,7 @@ static unsigned int snapper_treble_volume_table[] = { /* bass table for TAS3004 */ /* 0 = -18 dB, 72 = 18 dB in 0.5 dB step */ -static unsigned int snapper_bass_volume_table[] = { +static const unsigned int snapper_bass_volume_table[] = { 0x96, 0x95, 0x94, 0x93, 0x92, 0x91, 0x90, 0x8f, 0x8e, From patchwork Sun Jan 5 14:47: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: 193967 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19725C33C8C for ; Sun, 5 Jan 2020 15:03:20 +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 9AD5D2077B for ; Sun, 5 Jan 2020 15:03: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="kWU6SiB/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9AD5D2077B 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 E46DC17D7; Sun, 5 Jan 2020 16:02:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E46DC17D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578236598; bh=DJXOSjGEBYAuAMSKY5A4+jM2Qypu+tpjKpk5eWoo3pM=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kWU6SiB/c6j3R/zqKN1niz6eMUUWlv07AK/51/BnYPaGu7jKMjamfsIx9InfTL760 FgkK3skCcGaELLQTv3Lxa4tqJVVv8fecmaoMJC70PsWWII6OzJyIsVTH869YjCDtre LjwSLVAcwzX/Qn3sD15g4qSgaY0kawHrPI6w/GgM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id F05CBF802C2; Sun, 5 Jan 2020 15:49:41 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E42ECF8033F; Sun, 5 Jan 2020 15:49:06 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E6D45F80278 for ; Sun, 5 Jan 2020 15:48:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E6D45F80278 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 89024B1DD for ; Sun, 5 Jan 2020 14:48:32 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:33 +0100 Message-Id: <20200105144823.29547-19-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 18/68] ALSA: hdsp: More constifications 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" Apply const prefix to each channel map table and its callers. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/rme9652/hdsp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index 632f7878ff3e..ba2a47dd384c 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c @@ -479,7 +479,7 @@ struct hdsp { pid_t playback_pid; int running; int system_sample_rate; - char *channel_map; + const char *channel_map; int dev; int irq; unsigned long port; @@ -501,12 +501,12 @@ struct hdsp { where the data for that channel can be read/written from/to. */ -static char channel_map_df_ss[HDSP_MAX_CHANNELS] = { +static const char channel_map_df_ss[HDSP_MAX_CHANNELS] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }; -static char channel_map_mf_ss[HDSP_MAX_CHANNELS] = { /* Multiface */ +static const char channel_map_mf_ss[HDSP_MAX_CHANNELS] = { /* Multiface */ /* Analog */ 0, 1, 2, 3, 4, 5, 6, 7, /* ADAT 2 */ @@ -516,7 +516,7 @@ static char channel_map_mf_ss[HDSP_MAX_CHANNELS] = { /* Multiface */ -1, -1, -1, -1, -1, -1, -1, -1 }; -static char channel_map_ds[HDSP_MAX_CHANNELS] = { +static const char channel_map_ds[HDSP_MAX_CHANNELS] = { /* ADAT channels are remapped */ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, /* channels 12 and 13 are S/PDIF */ @@ -525,7 +525,7 @@ static char channel_map_ds[HDSP_MAX_CHANNELS] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; -static char channel_map_H9632_ss[HDSP_MAX_CHANNELS] = { +static const char channel_map_H9632_ss[HDSP_MAX_CHANNELS] = { /* ADAT channels */ 0, 1, 2, 3, 4, 5, 6, 7, /* SPDIF */ @@ -539,7 +539,7 @@ static char channel_map_H9632_ss[HDSP_MAX_CHANNELS] = { -1, -1 }; -static char channel_map_H9632_ds[HDSP_MAX_CHANNELS] = { +static const char channel_map_H9632_ds[HDSP_MAX_CHANNELS] = { /* ADAT */ 1, 3, 5, 7, /* SPDIF */ @@ -553,7 +553,7 @@ static char channel_map_H9632_ds[HDSP_MAX_CHANNELS] = { -1, -1, -1, -1, -1, -1 }; -static char channel_map_H9632_qs[HDSP_MAX_CHANNELS] = { +static const char channel_map_H9632_qs[HDSP_MAX_CHANNELS] = { /* ADAT is disabled in this mode */ /* SPDIF */ 8, 9, From patchwork Sun Jan 5 14:47: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: 193965 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C70C3C33C8C for ; Sun, 5 Jan 2020 15:06:02 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4F6202077B for ; Sun, 5 Jan 2020 15:06:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="kXP9G1Pk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F6202077B 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 9F99317D5; Sun, 5 Jan 2020 16:05:10 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9F99317D5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578236760; bh=Yb3q+vrqYNM4FjHRaRrSCxG+kf9snZMQc0DGw3rRBZI=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kXP9G1PkcRHQC1J3p/NPLd+t6jZRietIDmUSDXPoK5kqt3bg/H5V45AOx30hiEdUe Gep64BBU0f91vY/pwDd+ipF0I3Jl+kc5cabT+NGbG0DojoHLqoel2ZX6bmbk76gylR TnrLzGtFmveH9saksWnUadLHnfXMQPthcWRyJ3ZQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 78F25F802E3; Sun, 5 Jan 2020 15:49:52 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 64A2DF8028A; Sun, 5 Jan 2020 15:49:11 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0E688F8028B for ; Sun, 5 Jan 2020 15:48:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0E688F8028B 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 CE7BCB23D for ; Sun, 5 Jan 2020 14:48:32 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:38 +0100 Message-Id: <20200105144823.29547-24-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 23/68] ALSA: pcxhr: More constifications 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" Apply const prefix to each possible place: the board parameters and DSP command table, and the string arrays. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/pcxhr/pcxhr.c | 2 +- sound/pci/pcxhr/pcxhr_core.c | 6 +++--- sound/pci/pcxhr/pcxhr_hwdep.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index 9e59d591217b..c2e4831c3a13 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -136,7 +136,7 @@ struct board_parameters { short fw_file_set; short firmware_num; }; -static struct board_parameters pcxhr_board_params[] = { +static const struct board_parameters pcxhr_board_params[] = { [PCI_ID_VX882HR] = { "VX882HR", 4, 4, 0, 41 }, [PCI_ID_PCX882HR] = { "PCX882HR", 4, 4, 0, 41 }, [PCI_ID_VX881HR] = { "VX881HR", 4, 4, 0, 41 }, diff --git a/sound/pci/pcxhr/pcxhr_core.c b/sound/pci/pcxhr/pcxhr_core.c index 495be27e3ba2..87d24224c042 100644 --- a/sound/pci/pcxhr/pcxhr_core.c +++ b/sound/pci/pcxhr/pcxhr_core.c @@ -466,7 +466,7 @@ enum { /* * Array of DSP commands */ -static struct pcxhr_cmd_info pcxhr_dsp_cmds[] = { +static const struct pcxhr_cmd_info pcxhr_dsp_cmds[] = { [CMD_VERSION] = { 0x010000, 1, RMH_SSIZE_FIXED }, [CMD_SUPPORTED] = { 0x020000, 4, RMH_SSIZE_FIXED }, [CMD_TEST_IT] = { 0x040000, 1, RMH_SSIZE_FIXED }, @@ -497,7 +497,7 @@ static struct pcxhr_cmd_info pcxhr_dsp_cmds[] = { }; #ifdef CONFIG_SND_DEBUG_VERBOSE -static char* cmd_names[] = { +static const char * const cmd_names[] = { [CMD_VERSION] = "CMD_VERSION", [CMD_SUPPORTED] = "CMD_SUPPORTED", [CMD_TEST_IT] = "CMD_TEST_IT", @@ -1006,7 +1006,7 @@ static int pcxhr_handle_async_err(struct pcxhr_mgr *mgr, u32 err, enum pcxhr_async_err_src err_src, int pipe, int is_capture) { - static char* err_src_name[] = { + static const char * const err_src_name[] = { [PCXHR_ERR_PIPE] = "Pipe", [PCXHR_ERR_STREAM] = "Stream", [PCXHR_ERR_AUDIO] = "Audio" diff --git a/sound/pci/pcxhr/pcxhr_hwdep.c b/sound/pci/pcxhr/pcxhr_hwdep.c index 12a6bdb920b2..2258bd698844 100644 --- a/sound/pci/pcxhr/pcxhr_hwdep.c +++ b/sound/pci/pcxhr/pcxhr_hwdep.c @@ -348,7 +348,7 @@ static int pcxhr_dsp_load(struct pcxhr_mgr *mgr, int index, */ int pcxhr_setup_firmware(struct pcxhr_mgr *mgr) { - static char *fw_files[][5] = { + static const char * const fw_files[][5] = { [0] = { "xlxint.dat", "xlxc882hr.dat", "dspe882.e56", "dspb882hr.b56", "dspd882.d56" }, [1] = { "xlxint.dat", "xlxc882e.dat", From patchwork Sun Jan 5 14:47: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: 193960 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCAB6C33C8C for ; Sun, 5 Jan 2020 15:12:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3CCC92085B for ; Sun, 5 Jan 2020 15:12:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="LswheXxL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3CCC92085B 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 875581791; Sun, 5 Jan 2020 16:11:47 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 875581791 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237157; bh=suRfIxX9pHtq+baQ1XODtzsJm02HljeJjJmNsj0cvIc=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LswheXxL/z9Ln7V3PhFjUICwkoGgxgJElor9iYlz1XoOudwvlitZNxdQWSGpSiJGW dSL2HEjsZlZvd8wSncT9m1F4IjmI4C6+gmazeqxiRsGZPbCGjc8QOm/16OBAFKt9FN FsEX1ZuYZzTNWst2eFw3sif6e7VO4HhtEWUaayWw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 97789F80445; Sun, 5 Jan 2020 15:50:17 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6BAEEF80290; Sun, 5 Jan 2020 15:49:25 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 924EFF80290 for ; Sun, 5 Jan 2020 15:48:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 924EFF80290 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 046DFB249 for ; Sun, 5 Jan 2020 14:48:33 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:42 +0100 Message-Id: <20200105144823.29547-28-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 27/68] ALSA: nm256: More constifications 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" Apply const prefix to the static tables coefs and init registers. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/nm256/nm256.c | 4 ++-- sound/pci/nm256/nm256_coef.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index 25275a98e950..1726f2959ae8 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c @@ -299,7 +299,7 @@ snd_nm256_writel(struct nm256 *chip, int offset, u32 val) } static inline void -snd_nm256_write_buffer(struct nm256 *chip, void *src, int offset, int size) +snd_nm256_write_buffer(struct nm256 *chip, const void *src, int offset, int size) { offset -= chip->buffer_start; #ifdef CONFIG_SND_DEBUG @@ -1179,7 +1179,7 @@ struct initialValues { unsigned short value; }; -static struct initialValues nm256_ac97_init_val[] = +static const struct initialValues nm256_ac97_init_val[] = { { AC97_MASTER, 0x8000 }, { AC97_HEADPHONE, 0x8000 }, diff --git a/sound/pci/nm256/nm256_coef.c b/sound/pci/nm256/nm256_coef.c index c757252119b1..f0599dbe8492 100644 --- a/sound/pci/nm256/nm256_coef.c +++ b/sound/pci/nm256/nm256_coef.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 #define NM_TOTAL_COEFF_COUNT 0x3158 -static char coefficients[NM_TOTAL_COEFF_COUNT * 4] = { +static const char coefficients[NM_TOTAL_COEFF_COUNT * 4] = { 0xFF, 0xFF, 0x2F, 0x00, 0x4B, 0xFF, 0xA5, 0x01, 0xEF, 0xFC, 0x21, 0x05, 0x87, 0xF7, 0x62, 0x11, 0xE9, 0x45, 0x5E, 0xF9, 0xB5, 0x01, 0xDE, 0xFF, 0xA4, 0xFF, 0x60, 0x00, 0xCA, 0xFF, 0x0D, 0x00, 0xFD, @@ -4598,7 +4598,7 @@ static char coefficients[NM_TOTAL_COEFF_COUNT * 4] = { 0x01, 0x8D, 0xFF, 0x0F, 0x00 }; -static u16 +static const u16 coefficient_sizes[8 * 2] = { /* Playback */ 0x00C0, 0x5000, 0x0060, 0x2800, 0x0040, 0x0060, 0x1400, 0x0000, From patchwork Sun Jan 5 14:47: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: 193964 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74260C33C8C for ; Sun, 5 Jan 2020 15:07:34 +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 012CE20866 for ; Sun, 5 Jan 2020 15:07: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="vKDYjEEF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 012CE20866 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 4E8A417E6; Sun, 5 Jan 2020 16:06:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4E8A417E6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578236852; bh=CnRJa1r3hUwFX9elICPonBG+NA2yhCoP0+rYZMMwobw=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vKDYjEEFQTvT0e4D5Zd91YxgHsFySghhcV67LdazR5UfZjTdPYVa9HdqXBTm+KZb/ Fk5l4/sQ0WFrFBAHD6Hxf8SPGw6D26o6ZNatuxU7ycDFwayq8d/mhyyAgPEaL9iA79 3N7v5zJtIgcmWCMTisgMAprAHyOlFZ/iq7Ps6T4k= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 450D5F803E0; Sun, 5 Jan 2020 15:50:00 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 10492F80368; Sun, 5 Jan 2020 15:49:17 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 28365F80140 for ; Sun, 5 Jan 2020 15:48:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 28365F80140 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 14D2DB254 for ; Sun, 5 Jan 2020 14:48:33 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:44 +0100 Message-Id: <20200105144823.29547-30-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 29/68] ALSA: cs46xx: More constifications 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" Apply const prefix to each possible place: the static tables for registers and op codes, etc. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/cs46xx/cs46xx_lib.c | 2 +- sound/pci/cs46xx/dsp_spos.c | 4 ++-- sound/pci/cs46xx/dsp_spos_scb_lib.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index cbac9f1edc51..e46efae1e192 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c @@ -3745,7 +3745,7 @@ static struct cs_card_type cards[] = { * APM support */ #ifdef CONFIG_PM_SLEEP -static unsigned int saved_regs[] = { +static const unsigned int saved_regs[] = { BA0_ACOSV, /*BA0_ASER_FADDR,*/ BA0_ASER_MASTER, diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c index 887790ac33c6..05f3f6dc918d 100644 --- a/sound/pci/cs46xx/dsp_spos.c +++ b/sound/pci/cs46xx/dsp_spos.c @@ -27,7 +27,7 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip, struct dsp_scb_descriptor * fg_entry); -static enum wide_opcode wide_opcodes[] = { +static const enum wide_opcode wide_opcodes[] = { WIDE_FOR_BEGIN_LOOP, WIDE_FOR_BEGIN_LOOP2, WIDE_COND_GOTO_ADDR, @@ -1038,7 +1038,7 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip) int fifo_addr, fifo_span, valid_slots; - static struct dsp_spos_control_block sposcb = { + static const struct dsp_spos_control_block sposcb = { /* 0 */ HFG_TREE_SCB,HFG_STACK, /* 1 */ SPOSCB_ADDR,BG_TREE_SCB_ADDR, /* 2 */ DSP_SPOS_DC,0, diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c index 715ead59613d..2c5c9d4c1d94 100644 --- a/sound/pci/cs46xx/dsp_spos_scb_lib.c +++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c @@ -1145,7 +1145,7 @@ find_next_free_scb (struct snd_cs46xx * chip, struct dsp_scb_descriptor * from) return scb; } -static u32 pcm_reader_buffer_addr[DSP_MAX_PCM_CHANNELS] = { +static const u32 pcm_reader_buffer_addr[DSP_MAX_PCM_CHANNELS] = { 0x0600, /* 1 */ 0x1500, /* 2 */ 0x1580, /* 3 */ @@ -1180,7 +1180,7 @@ static u32 pcm_reader_buffer_addr[DSP_MAX_PCM_CHANNELS] = { 0x2400, /* 32 */ }; -static u32 src_output_buffer_addr[DSP_MAX_SRC_NR] = { +static const u32 src_output_buffer_addr[DSP_MAX_SRC_NR] = { 0x2B80, 0x2BA0, 0x2BC0, @@ -1197,7 +1197,7 @@ static u32 src_output_buffer_addr[DSP_MAX_SRC_NR] = { 0x2E20 }; -static u32 src_delay_buffer_addr[DSP_MAX_SRC_NR] = { +static const u32 src_delay_buffer_addr[DSP_MAX_SRC_NR] = { 0x2480, 0x2500, 0x2580, From patchwork Sun Jan 5 14:47: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: 193966 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22CA6C33C8C for ; Sun, 5 Jan 2020 15:04: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 961EA2077B for ; Sun, 5 Jan 2020 15:04: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="kvmqTkbk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 961EA2077B 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 DFFAD17D1; Sun, 5 Jan 2020 16:03:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DFFAD17D1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578236685; bh=drCvC+ft9dW9ssTQ1L+XVhYrfGgixwegwcKJR1byJCw=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=kvmqTkbkc7PqW6vpeGprYzipYvVrEavfwEGj9gtdHxFORdGtZk4Z6fgwLq2Q22n+s 56GdzXuVNt6wShiwc2c1hqJbsqz5j7ZeI/45agEaB1OQkHxW68M88FiwFcgk4xZ7lV UkM7o9Zbu9T8ECSYOouj/jRc5RfsKU1oQAPfCF8w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7825CF803B2; Sun, 5 Jan 2020 15:49:47 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7F0DDF8028F; Sun, 5 Jan 2020 15:49:10 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 23BF0F8028F for ; Sun, 5 Jan 2020 15:48:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 23BF0F8028F 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 2C725B286 for ; Sun, 5 Jan 2020 14:48:33 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:46 +0100 Message-Id: <20200105144823.29547-32-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 31/68] ALSA: ctxfi: More constifications 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" Apply const prefix to each possible place: the DAIO tables and the register offset table. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/ctxfi/ctdaio.c | 4 ++-- sound/pci/ctxfi/ctresource.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/pci/ctxfi/ctdaio.c b/sound/pci/ctxfi/ctdaio.c index 27441d498968..4cb47b5a792c 100644 --- a/sound/pci/ctxfi/ctdaio.c +++ b/sound/pci/ctxfi/ctdaio.c @@ -29,7 +29,7 @@ struct daio_rsc_idx { unsigned short right; }; -static struct daio_rsc_idx idx_20k1[NUM_DAIOTYP] = { +static const struct daio_rsc_idx idx_20k1[NUM_DAIOTYP] = { [LINEO1] = {.left = 0x00, .right = 0x01}, [LINEO2] = {.left = 0x18, .right = 0x19}, [LINEO3] = {.left = 0x08, .right = 0x09}, @@ -40,7 +40,7 @@ static struct daio_rsc_idx idx_20k1[NUM_DAIOTYP] = { [SPDIFI1] = {.left = 0x95, .right = 0x9d}, }; -static struct daio_rsc_idx idx_20k2[NUM_DAIOTYP] = { +static const struct daio_rsc_idx idx_20k2[NUM_DAIOTYP] = { [LINEO1] = {.left = 0x40, .right = 0x41}, [LINEO2] = {.left = 0x60, .right = 0x61}, [LINEO3] = {.left = 0x50, .right = 0x51}, diff --git a/sound/pci/ctxfi/ctresource.c b/sound/pci/ctxfi/ctresource.c index 0bb5696e44b3..61e51e35ba16 100644 --- a/sound/pci/ctxfi/ctresource.c +++ b/sound/pci/ctxfi/ctresource.c @@ -92,7 +92,7 @@ int mgr_put_resource(struct rsc_mgr *mgr, unsigned int n, unsigned int idx) return 0; } -static unsigned char offset_in_audio_slot_block[NUM_RSCTYP] = { +static const unsigned char offset_in_audio_slot_block[NUM_RSCTYP] = { /* SRC channel is at Audio Ring slot 1 every 16 slots. */ [SRC] = 0x1, [AMIXER] = 0x4, From patchwork Sun Jan 5 14:47: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: 193963 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E0BEC33C8C for ; Sun, 5 Jan 2020 15:08: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 D47712085B for ; Sun, 5 Jan 2020 15:08: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="LdjPmiis" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D47712085B 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 2DB5F17D3; Sun, 5 Jan 2020 16:07:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2DB5F17D3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578236922; bh=JWZ7fbSwux910SmxdY0oywtBDIZmjufBr04yEzsLpzI=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LdjPmiis8lirQoyTbR/c+cCK6NL3IrUNrpphluqOjEnI0Snh1L4jjJ30XsHL/2wEY Qtw2bi4OQnkOa8XKKjUyi4TwMRLzar5xluxT1tDGVY7A6wqTZ9eXfopMYYO49biLtV OTb6zSzRm84v08N60/CGstrTBRwaH++tC133ow/A= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 83FBAF803F5; Sun, 5 Jan 2020 15:50:06 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 78731F8028D; Sun, 5 Jan 2020 15:49:18 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A859CF80292 for ; Sun, 5 Jan 2020 15:48:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A859CF80292 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 39D9CB28C for ; Sun, 5 Jan 2020 14:48:33 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:47 +0100 Message-Id: <20200105144823.29547-33-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 32/68] ALSA: asihpi: More constifications 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" Apply const prefix to each possible place: the static tables for formats, parameters, etc. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/asihpi/asihpi.c | 4 ++-- sound/pci/asihpi/hpimsgx.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index 1fdb9f9f0ae0..a9540c2c4a1a 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c @@ -300,7 +300,7 @@ static void print_hwparams(struct snd_pcm_substream *substream, #define INVALID_FORMAT (__force snd_pcm_format_t)(-1) -static snd_pcm_format_t hpi_to_alsa_formats[] = { +static const snd_pcm_format_t hpi_to_alsa_formats[] = { INVALID_FORMAT, /* INVALID */ SNDRV_PCM_FORMAT_U8, /* HPI_FORMAT_PCM8_UNSIGNED 1 */ SNDRV_PCM_FORMAT_S16, /* HPI_FORMAT_PCM16_SIGNED 2 */ @@ -2073,7 +2073,7 @@ static int snd_asihpi_meter_info(struct snd_kcontrol *kcontrol, } /* linear values for 10dB steps */ -static int log2lin[] = { +static const int log2lin[] = { 0x7FFFFFFF, /* 0dB */ 679093956, 214748365, diff --git a/sound/pci/asihpi/hpimsgx.c b/sound/pci/asihpi/hpimsgx.c index 5fb0b98bec30..f7427f8eb630 100644 --- a/sound/pci/asihpi/hpimsgx.c +++ b/sound/pci/asihpi/hpimsgx.c @@ -17,7 +17,7 @@ Extended Message Function With Response Caching #include "hpimsgx.h" #include "hpidebug.h" -static struct pci_device_id asihpi_pci_tbl[] = { +static const struct pci_device_id asihpi_pci_tbl[] = { #include "hpipcida.h" }; From patchwork Sun Jan 5 14:47: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: 193961 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE266C33C8C for ; Sun, 5 Jan 2020 15:11: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 3744520866 for ; Sun, 5 Jan 2020 15:11:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="IwrWxwEI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3744520866 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 4AB7A17F3; Sun, 5 Jan 2020 16:10:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4AB7A17F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237077; bh=6YU8EZyUKbwOTTiZW0C4PhvW6Y4uj9hpPr/BqEROwGs=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IwrWxwEIBOmW4ohxpltA7vJwbdJRJOUxLzwyfD+eljS/pEL81ueAKy64hj9CEBOlv wreVJUPRegqNyEjZHt/wT2JVJIWoUScRgwwnaV3TdIaoP9hMuQgZJaLMMHzRi5nbhw 37eEzCAUIGeBZZbGYsEOQrK+gOc/KeLGbcXOKAe8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 1BE4EF8042B; Sun, 5 Jan 2020 15:50:15 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C941EF8036F; Sun, 5 Jan 2020 15:49:23 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B7260F8029A for ; Sun, 5 Jan 2020 15:48:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B7260F8029A 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 467F4B29F for ; Sun, 5 Jan 2020 14:48:33 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:48 +0100 Message-Id: <20200105144823.29547-34-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 33/68] ALSA: atiixp: More constifications 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" Apply const prefix to the static register tables. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/atiixp.c | 2 +- sound/pci/atiixp_modem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 4a840734e7a7..85d3b4e95489 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c @@ -1407,7 +1407,7 @@ static int snd_atiixp_mixer_new(struct atiixp *chip, int clock, .write = snd_atiixp_ac97_write, .read = snd_atiixp_ac97_read, }; - static unsigned int codec_skip[NUM_ATI_CODECS] = { + static const unsigned int codec_skip[NUM_ATI_CODECS] = { ATI_REG_ISR_CODEC0_NOT_READY, ATI_REG_ISR_CODEC1_NOT_READY, ATI_REG_ISR_CODEC2_NOT_READY, diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index 3ec34e78ffef..ae88217d685a 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c @@ -1050,7 +1050,7 @@ static int snd_atiixp_mixer_new(struct atiixp_modem *chip, int clock) .write = snd_atiixp_ac97_write, .read = snd_atiixp_ac97_read, }; - static unsigned int codec_skip[NUM_ATI_CODECS] = { + static const unsigned int codec_skip[NUM_ATI_CODECS] = { ATI_REG_ISR_CODEC0_NOT_READY, ATI_REG_ISR_CODEC1_NOT_READY, ATI_REG_ISR_CODEC2_NOT_READY, From patchwork Sun Jan 5 14:47: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: 193944 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23228C3F68F for ; Sun, 5 Jan 2020 16:07: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 93F552465E for ; Sun, 5 Jan 2020 16:07:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="FuZWix3/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93F552465E 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 A20F61823; Sun, 5 Jan 2020 16:28:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A20F61823 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578238153; bh=hR/YQwrUUw7mvgU8jAJvTdTWFwSFq23/QmozWXwGOsY=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FuZWix3/za0Uy0nq9r1VaZNMq9T00bEEa8oMdKCRbVg/T+euZJ/XmY9R0NNiyTF+G GrLjOLNdVSRmTXZOGaLX6zow3wnfwTEup6GfKCGmA7lT8N3k6tx2s8uOgE+Y0esQ6j UUIjD2TxmuCCu9dvJ+eMSaE8g2prRl6OdNo2ixXg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4357BF805C0; Sun, 5 Jan 2020 15:50:46 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 50A95F803D1; Sun, 5 Jan 2020 15:49:58 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 54E59F802EC for ; Sun, 5 Jan 2020 15:48:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 54E59F802EC 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 5594FB2AE for ; Sun, 5 Jan 2020 14:48:33 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:50 +0100 Message-Id: <20200105144823.29547-36-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 35/68] ALSA: es1968: More constifications 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" Apply const prefix to the quirk white/black lists. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/es1968.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c index affd3e8d7a67..d26004b35a81 100644 --- a/sound/pci/es1968.c +++ b/sound/pci/es1968.c @@ -2631,7 +2631,7 @@ struct ess_device_list { unsigned short vendor; /* subsystem vendor id */ }; -static struct ess_device_list pm_whitelist[] = { +static const struct ess_device_list pm_whitelist[] = { { TYPE_MAESTRO2E, 0x0e11 }, /* Compaq Armada */ { TYPE_MAESTRO2E, 0x1028 }, { TYPE_MAESTRO2E, 0x103c }, @@ -2642,7 +2642,7 @@ static struct ess_device_list pm_whitelist[] = { { TYPE_MAESTRO2, 0x125d }, /* a PCI card, e.g. SF64-PCE2 */ }; -static struct ess_device_list mpu_blacklist[] = { +static const struct ess_device_list mpu_blacklist[] = { { TYPE_MAESTRO2, 0x125d }, }; From patchwork Sun Jan 5 14:47: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: 193959 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F928C33C8C for ; Sun, 5 Jan 2020 15:14:05 +0000 (UTC) Received: from alsa0.perex.cz (unknown [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 8CDF52085B for ; Sun, 5 Jan 2020 15:14: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="iiFHN5Rj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8CDF52085B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=tempfail 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 CE52E17F5; Sun, 5 Jan 2020 16:13:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CE52E17F5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237242; bh=u12yHHa/kqfeK7ljGnA7jvrJyCZpUWA0zyqFrZi4MF0=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=iiFHN5RjK3Y/IZhzwPsmeJv3mZ27xluiKTPAY8IaU5UfxuHZEvBV+f75eHt9hcqtf RSVfqSlECDYIaReV0cu/zn790rK57J9Shg7S40f8N6wFdScyIRHZ1AExhxkywIgyax 1I33Dfaztz1l5+aG8qFycxtckj8SxAH2esFstmL4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 57BA8F80471; Sun, 5 Jan 2020 15:50:20 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 38813F8038E; Sun, 5 Jan 2020 15:49:30 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5A6F4F8029B for ; Sun, 5 Jan 2020 15:48:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5A6F4F8029B 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 6567FB2B5 for ; Sun, 5 Jan 2020 14:48:33 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:52 +0100 Message-Id: <20200105144823.29547-38-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 37/68] ALSA: sparc: More constifications 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" Apply const prefix to the static tables for rates, bits and strings. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/sparc/cs4231.c | 4 ++-- sound/sparc/dbri.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index 59f812b5ce59..0eed5f79a2bf 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c @@ -184,7 +184,7 @@ struct snd_cs4231 { * Some variables */ -static unsigned char freq_bits[14] = { +static const unsigned char freq_bits[14] = { /* 5510 */ 0x00 | CS4231_XTAL2, /* 6620 */ 0x0E | CS4231_XTAL2, /* 8000 */ 0x00 | CS4231_XTAL1, @@ -218,7 +218,7 @@ static int snd_cs4231_xrate(struct snd_pcm_runtime *runtime) &hw_constraints_rates); } -static unsigned char snd_cs4231_original_image[32] = +static const unsigned char snd_cs4231_original_image[32] = { 0x00, /* 00/00 - lic */ 0x00, /* 01/01 - ric */ diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index aaa1493b9ef9..cf7049999261 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c @@ -104,7 +104,7 @@ module_param(dbri_debug, int, 0644); MODULE_PARM_DESC(dbri_debug, "Debug value for Sun DBRI soundcard."); #ifdef DBRI_DEBUG -static char *cmds[] = { +static const char * const cmds[] = { "WAIT", "PAUSE", "JUMP", "IIQ", "REX", "SDP", "CDP", "DTS", "SSP", "CHI", "NT", "TE", "CDEC", "TEST", "CDM", "RESRV" }; From patchwork Sun Jan 5 14:47: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: 193958 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E38EC33C8C for ; Sun, 5 Jan 2020 15:15:20 +0000 (UTC) Received: from alsa0.perex.cz (unknown [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 DBEE72085B for ; Sun, 5 Jan 2020 15:15:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBEE72085B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=tempfail 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 3B08917FE; Sun, 5 Jan 2020 16:14:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3B08917FE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237318; bh=gLErL6eVDQVdY4Y/CeDAlwE64q8lWLJiQvvT3eEVVtU=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=nksLklCnFbCgZ44EHvp0av6S/A1wEC3UfTuvNfFsDNHSNk2nc+rVVgSPr6C8F2Qzm q5tpmIlo9zbKNlQohfIfX2ODVXYCrFrKamHsEe0dcRKYJBQ0w94KKiXyOiHOFOOJbT N/DPJz9zW6p6JBkGzim8D54lgT4LWNsqe7j6hvqU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 777EDF8047A; Sun, 5 Jan 2020 15:50:22 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2E499F802DD; Sun, 5 Jan 2020 15:49:31 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3256EF8028C for ; Sun, 5 Jan 2020 15:48:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3256EF8028C 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 71631B2B6 for ; Sun, 5 Jan 2020 14:48:33 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:53 +0100 Message-Id: <20200105144823.29547-39-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 38/68] ALSA: info: More constifications 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" Apply const prefix to the string array and its callers. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/core/info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/core/info.c b/sound/core/info.c index e051a029ccfb..6801d8160866 100644 --- a/sound/core/info.c +++ b/sound/core/info.c @@ -20,7 +20,7 @@ int snd_info_check_reserved_words(const char *str) { - static char *reserved[] = + static const char * const reserved[] = { "version", "meminfo", @@ -35,7 +35,7 @@ int snd_info_check_reserved_words(const char *str) "seq", NULL }; - char **xstr = reserved; + const char * const *xstr = reserved; while (*xstr) { if (!strcmp(*xstr, str)) From patchwork Sun Jan 5 14:47: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: 193954 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7D2DC33C8C for ; Sun, 5 Jan 2020 15:52:44 +0000 (UTC) Received: from alsa0.perex.cz (unknown [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 A57DD215A4 for ; Sun, 5 Jan 2020 15:52: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="l22aAYcj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A57DD215A4 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 38384186D; Sun, 5 Jan 2020 16:33:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 38384186D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578238465; bh=Mjz/1aN8DGA//Z8NkbrO6N+ydH9PHp21cEbuxyUmS24=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=l22aAYcj/G++FOm7Q2yFM/xMvJNpWqF8u5t/iGnk7Zl+R2DkFZNIFQw0uF0Zd25md i72YqpURJs1eSoqYy0bywzMMzF9PWJHY06aYUNaSz/xTwdNlsiR3cng2CjajkFW5hQ pbKEDIIO5YN/d8py8QsmPP1hBwow5ffs1fT5CP9Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C7C7AF805F7; Sun, 5 Jan 2020 15:50:54 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3410EF803FB; Sun, 5 Jan 2020 15:50:09 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8FB40F80307 for ; Sun, 5 Jan 2020 15:48:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8FB40F80307 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 8B0F5B2B8 for ; Sun, 5 Jan 2020 14:48:33 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:55 +0100 Message-Id: <20200105144823.29547-41-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 40/68] ALSA: oss: More constifications 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" Apply const prefix to the static tables for strings and formats. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/core/oss/mixer_oss.c | 2 +- sound/core/oss/pcm_plugin.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index 26502294f7d8..f702c96a7478 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c @@ -1109,7 +1109,7 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, /* */ #define MIXER_VOL(name) [SOUND_MIXER_##name] = #name -static char *oss_mixer_names[SNDRV_OSS_MAX_MIXERS] = { +static const char * const oss_mixer_names[SNDRV_OSS_MAX_MIXERS] = { MIXER_VOL(VOLUME), MIXER_VOL(BASS), MIXER_VOL(TREBLE), diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c index 31cb2acf8afc..240e4702c098 100644 --- a/sound/core/oss/pcm_plugin.c +++ b/sound/core/oss/pcm_plugin.c @@ -288,7 +288,7 @@ static int snd_pcm_plug_formats(const struct snd_mask *mask, return snd_mask_test(&formats, (__force int)format); } -static snd_pcm_format_t preferred_formats[] = { +static const snd_pcm_format_t preferred_formats[] = { SNDRV_PCM_FORMAT_S16_LE, SNDRV_PCM_FORMAT_S16_BE, SNDRV_PCM_FORMAT_U16_LE, From patchwork Sun Jan 5 14:47: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: 193956 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92725C33C8C for ; Sun, 5 Jan 2020 15:18:02 +0000 (UTC) Received: from alsa0.perex.cz (unknown [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 1CCF82085B for ; Sun, 5 Jan 2020 15:18:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1CCF82085B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=tempfail 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 7E7AE1782; Sun, 5 Jan 2020 16:17:10 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7E7AE1782 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237480; bh=UPvCa473rtao3DUOLqnd3rLuGSWX930vEUUfms0sF5k=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lyqkP2DQfdXE9335Eunihwz+NCE4DAWqr5BLrzpnShSzZkiAk9+gg3nQs9LaoPHTM var8YilAj8JORT+tBM0n4tSwf1Gf/2uCc2brivUxShkV71meBjGHqR+zgzospBkGzm ZN8kq5srvP1VTSZV1MsOh6rSILgxwRea1BZI+Gmc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A54FCF804BB; Sun, 5 Jan 2020 15:50:27 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 98259F802A7; Sun, 5 Jan 2020 15:49:37 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EB8C8F802BC for ; Sun, 5 Jan 2020 15:48:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EB8C8F802BC 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 BDFACB2BD for ; Sun, 5 Jan 2020 14:48:33 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:47:59 +0100 Message-Id: <20200105144823.29547-45-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 44/68] ALSA: cs423x: More constification 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" Apply const prefix to the static mapping table. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/isa/cs423x/cs4236_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c index ca6646f9b58d..4a028f42bb74 100644 --- a/sound/isa/cs423x/cs4236_lib.c +++ b/sound/isa/cs423x/cs4236_lib.c @@ -80,7 +80,7 @@ * */ -static unsigned char snd_cs4236_ext_map[18] = { +static const unsigned char snd_cs4236_ext_map[18] = { /* CS4236_LEFT_LINE */ 0xff, /* CS4236_RIGHT_LINE */ 0xff, /* CS4236_LEFT_MIC */ 0xdf, From patchwork Sun Jan 5 14:48: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: 193951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 649EFC3F68F for ; Sun, 5 Jan 2020 15:57: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 D354D217F4 for ; Sun, 5 Jan 2020 15:57:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Q7Og4Qeb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D354D217F4 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 3F78A1815; Sun, 5 Jan 2020 16:19:08 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3F78A1815 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237598; bh=uPx/dtOJbfTKYUhv5/1/7CT6CHpvdCcu7iqQYNBr8sk=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Q7Og4QebnaaHxNyKtrug88X6iEEPvCd6ZoJuHL0FbcrMtEZPniPxrb3H85YREbj3d D7KWbo0hhABkRWPZMMjbcYxj71LYq8JalzduY//Q1kuzJegrKULcsGP4EGIxV43Xar cqWsaBJ5nLcxZzKRVPo9nhvtsq0CRTrSmMCh3v+A= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E004AF804DC; Sun, 5 Jan 2020 15:50:30 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E84D8F80394; Sun, 5 Jan 2020 15:49:41 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1061FF802C2 for ; Sun, 5 Jan 2020 15:48:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1061FF802C2 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 CE126B2BE for ; Sun, 5 Jan 2020 14:48:33 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:48:00 +0100 Message-Id: <20200105144823.29547-46-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 45/68] ALSA: sb: More constifications 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" Apply const prefix to each possible place: the static tables for the resources, controls, registers, values and parameters. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/isa/sb/emu8000.c | 16 ++++++++-------- sound/isa/sb/jazz16.c | 10 +++++----- sound/isa/sb/sb16.c | 8 ++++---- sound/isa/sb/sb8.c | 2 +- sound/isa/sb/sb_mixer.c | 38 +++++++++++++++++++------------------- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/sound/isa/sb/emu8000.c b/sound/isa/sb/emu8000.c index 455dd5fa3ccb..0aa545ac6e60 100644 --- a/sound/isa/sb/emu8000.c +++ b/sound/isa/sb/emu8000.c @@ -222,7 +222,7 @@ init_dma(struct snd_emu8000 *emu) /* * initialization arrays; from ADIP */ -static unsigned short init1[128] = { +static const unsigned short init1[128] = { 0x03ff, 0x0030, 0x07ff, 0x0130, 0x0bff, 0x0230, 0x0fff, 0x0330, 0x13ff, 0x0430, 0x17ff, 0x0530, 0x1bff, 0x0630, 0x1fff, 0x0730, 0x23ff, 0x0830, 0x27ff, 0x0930, 0x2bff, 0x0a30, 0x2fff, 0x0b30, @@ -244,7 +244,7 @@ static unsigned short init1[128] = { 0xf3ff, 0x0c30, 0xf7ff, 0x0d30, 0xfbff, 0x0e30, 0xffff, 0x0f30, }; -static unsigned short init2[128] = { +static const unsigned short init2[128] = { 0x03ff, 0x8030, 0x07ff, 0x8130, 0x0bff, 0x8230, 0x0fff, 0x8330, 0x13ff, 0x8430, 0x17ff, 0x8530, 0x1bff, 0x8630, 0x1fff, 0x8730, 0x23ff, 0x8830, 0x27ff, 0x8930, 0x2bff, 0x8a30, 0x2fff, 0x8b30, @@ -266,7 +266,7 @@ static unsigned short init2[128] = { 0xf3ff, 0x8c30, 0xf7ff, 0x8d30, 0xfbff, 0x8e30, 0xffff, 0x8f30, }; -static unsigned short init3[128] = { +static const unsigned short init3[128] = { 0x0C10, 0x8470, 0x14FE, 0xB488, 0x167F, 0xA470, 0x18E7, 0x84B5, 0x1B6E, 0x842A, 0x1F1D, 0x852A, 0x0DA3, 0x8F7C, 0x167E, 0xF254, 0x0000, 0x842A, 0x0001, 0x852A, 0x18E6, 0x8BAA, 0x1B6D, 0xF234, @@ -288,7 +288,7 @@ static unsigned short init3[128] = { 0x1342, 0xD36E, 0x3EC7, 0xB3FF, 0x0000, 0x8365, 0x1420, 0x9570, }; -static unsigned short init4[128] = { +static const unsigned short init4[128] = { 0x0C10, 0x8470, 0x14FE, 0xB488, 0x167F, 0xA470, 0x18E7, 0x84B5, 0x1B6E, 0x842A, 0x1F1D, 0x852A, 0x0DA3, 0x0F7C, 0x167E, 0x7254, 0x0000, 0x842A, 0x0001, 0x852A, 0x18E6, 0x0BAA, 0x1B6D, 0x7234, @@ -315,10 +315,10 @@ static unsigned short init4[128] = { * is meant to work */ static void -send_array(struct snd_emu8000 *emu, unsigned short *data, int size) +send_array(struct snd_emu8000 *emu, const unsigned short *data, int size) { int i; - unsigned short *p; + const unsigned short *p; p = data; for (i = 0; i < size; i++, p++) @@ -548,7 +548,7 @@ snd_emu8000_init_hw(struct snd_emu8000 *emu) * Bass/Treble Equalizer *----------------------------------------------------------------*/ -static unsigned short bass_parm[12][3] = { +static const unsigned short bass_parm[12][3] = { {0xD26A, 0xD36A, 0x0000}, /* -12 dB */ {0xD25B, 0xD35B, 0x0000}, /* -8 */ {0xD24C, 0xD34C, 0x0000}, /* -6 */ @@ -563,7 +563,7 @@ static unsigned short bass_parm[12][3] = { {0xC26A, 0xC36A, 0x0002}, /* +12 dB */ }; -static unsigned short treble_parm[12][9] = { +static const unsigned short treble_parm[12][9] = { {0x821E, 0xC26A, 0x031E, 0xC36A, 0x021E, 0xD208, 0x831E, 0xD308, 0x0001}, /* -12 dB */ {0x821E, 0xC25B, 0x031E, 0xC35B, 0x021E, 0xD208, 0x831E, 0xD308, 0x0001}, {0x821E, 0xC24C, 0x031E, 0xC34C, 0x021E, 0xD208, 0x831E, 0xD308, 0x0001}, diff --git a/sound/isa/sb/jazz16.c b/sound/isa/sb/jazz16.c index 7a313ff589c7..ee379bbf70a4 100644 --- a/sound/isa/sb/jazz16.c +++ b/sound/isa/sb/jazz16.c @@ -158,9 +158,9 @@ static int jazz16_detect_board(unsigned long port, static int jazz16_configure_board(struct snd_sb *chip, int mpu_irq) { - static unsigned char jazz_irq_bits[] = { 0, 0, 2, 3, 0, 1, 0, 4, + static const unsigned char jazz_irq_bits[] = { 0, 0, 2, 3, 0, 1, 0, 4, 0, 2, 5, 0, 0, 0, 0, 6 }; - static unsigned char jazz_dma_bits[] = { 0, 1, 0, 2, 0, 3, 0, 4 }; + static const unsigned char jazz_dma_bits[] = { 0, 1, 0, 2, 0, 3, 0, 4 }; if (jazz_dma_bits[chip->dma8] == 0 || jazz_dma_bits[chip->dma16] == 0 || @@ -224,9 +224,9 @@ static int snd_jazz16_probe(struct device *devptr, unsigned int dev) struct snd_card_jazz16 *jazz16; struct snd_sb *chip; struct snd_opl3 *opl3; - static int possible_irqs[] = {2, 3, 5, 7, 9, 10, 15, -1}; - static int possible_dmas8[] = {1, 3, -1}; - static int possible_dmas16[] = {5, 7, -1}; + static const int possible_irqs[] = {2, 3, 5, 7, 9, 10, 15, -1}; + static const int possible_dmas8[] = {1, 3, -1}; + static const int possible_dmas16[] = {5, 7, -1}; int err, xirq, xdma8, xdma16, xmpu_port, xmpu_irq; err = snd_card_new(devptr, index[dev], id[dev], THIS_MODULE, diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c index b528238675fe..479197c13803 100644 --- a/sound/isa/sb/sb16.c +++ b/sound/isa/sb/sb16.c @@ -509,9 +509,9 @@ static int snd_sb16_isa_match(struct device *pdev, unsigned int dev) static int snd_sb16_isa_probe(struct device *pdev, unsigned int dev) { int err; - static int possible_irqs[] = {5, 9, 10, 7, -1}; - static int possible_dmas8[] = {1, 3, 0, -1}; - static int possible_dmas16[] = {5, 6, 7, -1}; + static const int possible_irqs[] = {5, 9, 10, 7, -1}; + static const int possible_dmas8[] = {1, 3, 0, -1}; + static const int possible_dmas16[] = {5, 6, 7, -1}; if (irq[dev] == SNDRV_AUTO_IRQ) { if ((irq[dev] = snd_legacy_find_free_irq(possible_irqs)) < 0) { @@ -535,7 +535,7 @@ static int snd_sb16_isa_probe(struct device *pdev, unsigned int dev) if (port[dev] != SNDRV_AUTO_PORT) return snd_sb16_isa_probe1(dev, pdev); else { - static int possible_ports[] = {0x220, 0x240, 0x260, 0x280}; + static const int possible_ports[] = {0x220, 0x240, 0x260, 0x280}; int i; for (i = 0; i < ARRAY_SIZE(possible_ports); i++) { port[dev] = possible_ports[i]; diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c index d67eae3988bd..438109f167d6 100644 --- a/sound/isa/sb/sb8.c +++ b/sound/isa/sb/sb8.c @@ -111,7 +111,7 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev) goto _err; } else { /* auto-probe legacy ports */ - static unsigned long possible_ports[] = { + static const unsigned long possible_ports[] = { 0x220, 0x240, 0x260, }; int i; diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c index 789dcf279a26..3f703b4a304d 100644 --- a/sound/isa/sb/sb_mixer.c +++ b/sound/isa/sb/sb_mixer.c @@ -494,14 +494,14 @@ int snd_sbmixer_add_ctl(struct snd_sb *chip, const char *name, int index, int ty * SB 2.0 specific mixer elements */ -static struct sbmix_elem snd_sb20_controls[] = { +static const struct sbmix_elem snd_sb20_controls[] = { SB_SINGLE("Master Playback Volume", SB_DSP20_MASTER_DEV, 1, 7), SB_SINGLE("PCM Playback Volume", SB_DSP20_PCM_DEV, 1, 3), SB_SINGLE("Synth Playback Volume", SB_DSP20_FM_DEV, 1, 7), SB_SINGLE("CD Playback Volume", SB_DSP20_CD_DEV, 1, 7) }; -static unsigned char snd_sb20_init_values[][2] = { +static const unsigned char snd_sb20_init_values[][2] = { { SB_DSP20_MASTER_DEV, 0 }, { SB_DSP20_FM_DEV, 0 }, }; @@ -509,7 +509,7 @@ static unsigned char snd_sb20_init_values[][2] = { /* * SB Pro specific mixer elements */ -static struct sbmix_elem snd_sbpro_controls[] = { +static const struct sbmix_elem snd_sbpro_controls[] = { SB_DOUBLE("Master Playback Volume", SB_DSP_MASTER_DEV, SB_DSP_MASTER_DEV, 5, 1, 7), SB_DOUBLE("PCM Playback Volume", @@ -529,7 +529,7 @@ static struct sbmix_elem snd_sbpro_controls[] = { SB_SINGLE("Capture Low-Pass Filter", SB_DSP_CAPTURE_FILT, 3, 1) }; -static unsigned char snd_sbpro_init_values[][2] = { +static const unsigned char snd_sbpro_init_values[][2] = { { SB_DSP_MASTER_DEV, 0 }, { SB_DSP_PCM_DEV, 0 }, { SB_DSP_FM_DEV, 0 }, @@ -538,7 +538,7 @@ static unsigned char snd_sbpro_init_values[][2] = { /* * SB16 specific mixer elements */ -static struct sbmix_elem snd_sb16_controls[] = { +static const struct sbmix_elem snd_sb16_controls[] = { SB_DOUBLE("Master Playback Volume", SB_DSP4_MASTER_DEV, (SB_DSP4_MASTER_DEV + 1), 3, 3, 31), SB_DOUBLE("PCM Playback Volume", @@ -576,7 +576,7 @@ static struct sbmix_elem snd_sb16_controls[] = { SB_DSP4_TREBLE_DEV, (SB_DSP4_TREBLE_DEV + 1), 4, 4, 15) }; -static unsigned char snd_sb16_init_values[][2] = { +static const unsigned char snd_sb16_init_values[][2] = { { SB_DSP4_MASTER_DEV + 0, 0 }, { SB_DSP4_MASTER_DEV + 1, 0 }, { SB_DSP4_PCM_DEV + 0, 0 }, @@ -592,7 +592,7 @@ static unsigned char snd_sb16_init_values[][2] = { /* * DT019x specific mixer elements */ -static struct sbmix_elem snd_dt019x_controls[] = { +static const struct sbmix_elem snd_dt019x_controls[] = { /* ALS4000 below has some parts which we might be lacking, * e.g. snd_als4000_ctl_mono_playback_switch - check it! */ SB_DOUBLE("Master Playback Volume", @@ -622,7 +622,7 @@ static struct sbmix_elem snd_dt019x_controls[] = { } }; -static unsigned char snd_dt019x_init_values[][2] = { +static const unsigned char snd_dt019x_init_values[][2] = { { SB_DT019X_MASTER_DEV, 0 }, { SB_DT019X_PCM_DEV, 0 }, { SB_DT019X_SYNTH_DEV, 0 }, @@ -637,7 +637,7 @@ static unsigned char snd_dt019x_init_values[][2] = { /* * ALS4000 specific mixer elements */ -static struct sbmix_elem snd_als4000_controls[] = { +static const struct sbmix_elem snd_als4000_controls[] = { SB_DOUBLE("PCM Playback Switch", SB_DT019X_OUTPUT_SW2, SB_DT019X_OUTPUT_SW2, 2, 1, 1), SB_DOUBLE("Synth Playback Switch", @@ -671,7 +671,7 @@ static struct sbmix_elem snd_als4000_controls[] = { #endif }; -static unsigned char snd_als4000_init_values[][2] = { +static const unsigned char snd_als4000_init_values[][2] = { { SB_DSP4_MASTER_DEV + 0, 0 }, { SB_DSP4_MASTER_DEV + 1, 0 }, { SB_DSP4_PCM_DEV + 0, 0 }, @@ -689,9 +689,9 @@ static unsigned char snd_als4000_init_values[][2] = { /* */ static int snd_sbmixer_init(struct snd_sb *chip, - struct sbmix_elem *controls, + const struct sbmix_elem *controls, int controls_count, - unsigned char map[][2], + const unsigned char map[][2], int map_count, char *name) { @@ -800,14 +800,14 @@ int snd_sbmixer_new(struct snd_sb *chip) } #ifdef CONFIG_PM -static unsigned char sb20_saved_regs[] = { +static const unsigned char sb20_saved_regs[] = { SB_DSP20_MASTER_DEV, SB_DSP20_PCM_DEV, SB_DSP20_FM_DEV, SB_DSP20_CD_DEV, }; -static unsigned char sbpro_saved_regs[] = { +static const unsigned char sbpro_saved_regs[] = { SB_DSP_MASTER_DEV, SB_DSP_PCM_DEV, SB_DSP_PLAYBACK_FILT, @@ -819,7 +819,7 @@ static unsigned char sbpro_saved_regs[] = { SB_DSP_CAPTURE_FILT, }; -static unsigned char sb16_saved_regs[] = { +static const unsigned char sb16_saved_regs[] = { SB_DSP4_MASTER_DEV, SB_DSP4_MASTER_DEV + 1, SB_DSP4_3DSE, SB_DSP4_BASS_DEV, SB_DSP4_BASS_DEV + 1, @@ -837,7 +837,7 @@ static unsigned char sb16_saved_regs[] = { SB_DSP4_MIC_AGC }; -static unsigned char dt019x_saved_regs[] = { +static const unsigned char dt019x_saved_regs[] = { SB_DT019X_MASTER_DEV, SB_DT019X_PCM_DEV, SB_DT019X_SYNTH_DEV, @@ -850,7 +850,7 @@ static unsigned char dt019x_saved_regs[] = { SB_DT019X_CAPTURE_SW, }; -static unsigned char als4000_saved_regs[] = { +static const unsigned char als4000_saved_regs[] = { /* please verify in dsheet whether regs to be added are actually real H/W or just dummy */ SB_DSP4_MASTER_DEV, SB_DSP4_MASTER_DEV + 1, @@ -872,7 +872,7 @@ static unsigned char als4000_saved_regs[] = { SB_ALS4000_CR3_CONFIGURATION, }; -static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs) +static void save_mixer(struct snd_sb *chip, const unsigned char *regs, int num_regs) { unsigned char *val = chip->saved_regs; if (snd_BUG_ON(num_regs > ARRAY_SIZE(chip->saved_regs))) @@ -881,7 +881,7 @@ static void save_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs) *val++ = snd_sbmixer_read(chip, *regs++); } -static void restore_mixer(struct snd_sb *chip, unsigned char *regs, int num_regs) +static void restore_mixer(struct snd_sb *chip, const unsigned char *regs, int num_regs) { unsigned char *val = chip->saved_regs; if (snd_BUG_ON(num_regs > ARRAY_SIZE(chip->saved_regs))) From patchwork Sun Jan 5 14:48: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: 193957 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21F16C33C8C for ; Sun, 5 Jan 2020 15:16:37 +0000 (UTC) Received: from alsa0.perex.cz (unknown [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 A1DB12085B for ; Sun, 5 Jan 2020 15:16:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1DB12085B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=tempfail 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 EA4481805; Sun, 5 Jan 2020 16:15:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EA4481805 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237395; bh=423jmyiXMSRe083oZ/w51lB6C1EmvoLcXnMh/RbNfJk=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=AFP4BlNwixeJ1FrPDQgxe/kaSPJLt4fVwrGLshICXsJZR9fzOVX7AjxPvLt8f0y2N Px6wKb7mu1aWaDxRNxFZ4sQk6L8xgrt2kU0iwTxNCuoFTffj3vOr3F07XbFJoeFiYb WohF7B2hkDMvT2r9jp6OnRxx8pb83zlDxjmuAAeY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 089FDF80492; Sun, 5 Jan 2020 15:50:25 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4241AF8038D; Sun, 5 Jan 2020 15:49:33 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CC1CFF802A9 for ; Sun, 5 Jan 2020 15:48:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CC1CFF802A9 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 DB7F0AC3C for ; Sun, 5 Jan 2020 14:48:33 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:48:01 +0100 Message-Id: <20200105144823.29547-47-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 46/68] ALSA: cmi8330: More constifications 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" Apply const prefix to the static tables for the register, controls and callbacks. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/isa/cmi8330.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index 61d6944a69c7..4669eb0cc8ce 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c @@ -120,7 +120,7 @@ static int pnp_registered; #define CMI8330_LINGAIN 25 #define CMI8330_CDINGAIN 26 -static unsigned char snd_cmi8330_image[((CMI8330_CDINGAIN)-16) + 1] = +static const unsigned char snd_cmi8330_image[((CMI8330_CDINGAIN)-16) + 1] = { 0x40, /* 16 - recording mux (SB-mixer-enabled) */ #ifdef ENABLE_SB_MIXER @@ -235,7 +235,7 @@ WSS_SINGLE(SNDRV_CTL_NAME_IEC958("Input ", PLAYBACK, SWITCH), 0, }; #ifdef ENABLE_SB_MIXER -static struct sbmix_elem cmi8330_sb_mixers[] = { +static const struct sbmix_elem cmi8330_sb_mixers[] = { SB_DOUBLE("SB Master Playback Volume", SB_DSP4_MASTER_DEV, (SB_DSP4_MASTER_DEV + 1), 3, 3, 31), SB_DOUBLE("Tone Control - Bass", SB_DSP4_BASS_DEV, (SB_DSP4_BASS_DEV + 1), 4, 4, 15), SB_DOUBLE("Tone Control - Treble", SB_DSP4_TREBLE_DEV, (SB_DSP4_TREBLE_DEV + 1), 4, 4, 15), @@ -253,7 +253,7 @@ SB_DOUBLE("SB Playback Volume", SB_DSP4_OGAIN_DEV, (SB_DSP4_OGAIN_DEV + 1), 6, 6 SB_SINGLE("SB Mic Auto Gain", SB_DSP4_MIC_AGC, 0, 1), }; -static unsigned char cmi8330_sb_init_values[][2] = { +static const unsigned char cmi8330_sb_init_values[][2] = { { SB_DSP4_MASTER_DEV + 0, 0 }, { SB_DSP4_MASTER_DEV + 1, 0 }, { SB_DSP4_PCM_DEV + 0, 0 }, @@ -428,7 +428,7 @@ static int snd_cmi8330_pcm(struct snd_card *card, struct snd_cmi8330 *chip) struct snd_pcm *pcm; const struct snd_pcm_ops *ops; int err; - static snd_pcm_open_callback_t cmi_open_callbacks[2] = { + static const snd_pcm_open_callback_t cmi_open_callbacks[2] = { snd_cmi8330_playback_open, snd_cmi8330_capture_open }; From patchwork Sun Jan 5 14:48: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: 193943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BF3DC33C8C for ; Sun, 5 Jan 2020 16:17: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 B6203215A4 for ; Sun, 5 Jan 2020 16:17:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="lnlgTFk5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6203215A4 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 4C1ED1829; Sun, 5 Jan 2020 16:21:15 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4C1ED1829 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237725; bh=N4MGby947so8gnkYf6bChNcMf7zo/0GRRRCZg3OKQPo=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lnlgTFk5Ap7IwfQaqnS4f9E25AnBxhbSPFH7KaVH2nM1neNri9qtktFSMScV2yF+o QsSaQ9QCozaeDXbVGkQWFCuwQj7qzl9cB7/aNtf7MVV0RZ3gYD6CfCcYFFyxNhm6it E0snq48v602e/cNCSzem8kn1fjW4kETsGt2OWxV4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 60731F804FD; Sun, 5 Jan 2020 15:50:34 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 88DBEF803A6; Sun, 5 Jan 2020 15:49:44 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 38163F802BE for ; Sun, 5 Jan 2020 15:48:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 38163F802BE 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 01547ADF0 for ; Sun, 5 Jan 2020 14:48:34 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:48:03 +0100 Message-Id: <20200105144823.29547-49-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 48/68] ALSA: es18xx: More constifications 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" Apply const prefix to the static map tables and the static resource tables. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/isa/es18xx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index 6ce5b5c76980..d1135f6ae104 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c @@ -965,7 +965,7 @@ static int snd_es18xx_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_ele static int snd_es18xx_get_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - static unsigned char invMap4Source[8] = {0, 0, 1, 1, 0, 0, 2, 3}; + static const unsigned char invMap4Source[8] = {0, 0, 1, 1, 0, 0, 2, 3}; struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol); int muxSource = snd_es18xx_mixer_read(chip, 0x1c) & 0x07; if (!(chip->version == 0x1869 || chip->version == 0x1879)) { @@ -982,7 +982,7 @@ static int snd_es18xx_get_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem static int snd_es18xx_put_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - static unsigned char map4Source[4] = {0, 2, 6, 7}; + static const unsigned char map4Source[4] = {0, 2, 6, 7}; struct snd_es18xx *chip = snd_kcontrol_chip(kcontrol); unsigned char val = ucontrol->value.enumerated.item[0]; unsigned char retVal = 0; @@ -2173,8 +2173,8 @@ static int snd_es18xx_isa_probe1(int dev, struct device *devptr) static int snd_es18xx_isa_probe(struct device *pdev, unsigned int dev) { int err; - static int possible_irqs[] = {5, 9, 10, 7, 11, 12, -1}; - static int possible_dmas[] = {1, 0, 3, 5, -1}; + static const int possible_irqs[] = {5, 9, 10, 7, 11, 12, -1}; + static const int possible_dmas[] = {1, 0, 3, 5, -1}; if (irq[dev] == SNDRV_AUTO_IRQ) { if ((irq[dev] = snd_legacy_find_free_irq(possible_irqs)) < 0) { @@ -2198,7 +2198,7 @@ static int snd_es18xx_isa_probe(struct device *pdev, unsigned int dev) if (port[dev] != SNDRV_AUTO_PORT) { return snd_es18xx_isa_probe1(dev, pdev); } else { - static unsigned long possible_ports[] = {0x220, 0x240, 0x260, 0x280}; + static const unsigned long possible_ports[] = {0x220, 0x240, 0x260, 0x280}; int i; for (i = 0; i < ARRAY_SIZE(possible_ports); i++) { port[dev] = possible_ports[i]; From patchwork Sun Jan 5 14:48: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: 193955 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0BEBBC33C8C for ; Sun, 5 Jan 2020 15:19:22 +0000 (UTC) Received: from alsa0.perex.cz (unknown [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 907DE2085B for ; Sun, 5 Jan 2020 15:19:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 907DE2085B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=tempfail 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 DFC871816; Sun, 5 Jan 2020 16:18:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DFC871816 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237560; bh=mpDLMx9OSH+8/xcEoRHqSU1JeADYF7fuBUjuIrzgq0I=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rtBJGl0HJJLvEOv5AGLppP0RiBiHwN53VBm3FduzpICzhXZCOvkTf2YEayV9bXD9R zp6rJ08AA9MijIDtJKbL5CumCcGGyU9NsxjWB38c/xnB40CRbLuxyuUyPn8QpGBtVZ h+RIYiMLFFdjlT4UVKMRJQb09ug7NSCCEmqlAVaU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CF1A2F804D7; Sun, 5 Jan 2020 15:50:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8A5AFF80393; Sun, 5 Jan 2020 15:49:40 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1271CF802C3 for ; Sun, 5 Jan 2020 15:48:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1271CF802C3 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 1D60AB158 for ; Sun, 5 Jan 2020 14:48:34 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:48:05 +0100 Message-Id: <20200105144823.29547-51-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 50/68] ALSA: opti9xx: More constifications 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" Apply const prefix to the static resource tables, the mc size tables and the string arrays. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/isa/opti9xx/miro.c | 18 +++++++++--------- sound/isa/opti9xx/opti92x-ad1848.c | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c index a9c773b9f471..e764816a8f7a 100644 --- a/sound/isa/opti9xx/miro.c +++ b/sound/isa/opti9xx/miro.c @@ -119,7 +119,7 @@ struct snd_miro { static struct snd_miro_aci aci_device; -static char * snd_opti9xx_names[] = { +static const char * const snd_opti9xx_names[] = { "unknown", "82C928", "82C929", "82C924", "82C925", @@ -637,7 +637,7 @@ static const struct snd_kcontrol_new snd_miro_capture_control[] = { .put = snd_miro_put_capture, }}; -static unsigned char aci_init_values[][2] = { +static const unsigned char aci_init_values[][2] = { { ACI_SET_MUTE, 0x00 }, { ACI_SET_POWERAMP, 0x00 }, { ACI_SET_PREAMP, 0x00 }, @@ -764,7 +764,7 @@ static int snd_miro_mixer(struct snd_card *card, static int snd_miro_init(struct snd_miro *chip, unsigned short hardware) { - static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2}; + static const int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2}; chip->hardware = hardware; strcpy(chip->name, snd_opti9xx_names[hardware]); @@ -1387,12 +1387,12 @@ static int snd_miro_isa_match(struct device *devptr, unsigned int n) static int snd_miro_isa_probe(struct device *devptr, unsigned int n) { - static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1}; - static long possible_mpu_ports[] = {0x330, 0x300, 0x310, 0x320, -1}; - static int possible_irqs[] = {11, 9, 10, 7, -1}; - static int possible_mpu_irqs[] = {10, 5, 9, 7, -1}; - static int possible_dma1s[] = {3, 1, 0, -1}; - static int possible_dma2s[][2] = { {1, -1}, {0, -1}, {-1, -1}, + static const long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1}; + static const long possible_mpu_ports[] = {0x330, 0x300, 0x310, 0x320, -1}; + static const int possible_irqs[] = {11, 9, 10, 7, -1}; + static const int possible_mpu_irqs[] = {10, 5, 9, 7, -1}; + static const int possible_dma1s[] = {3, 1, 0, -1}; + static const int possible_dma2s[][2] = { {1, -1}, {0, -1}, {-1, -1}, {0, -1} }; int error; diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index 697576459f71..d06b29693c85 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c @@ -163,7 +163,7 @@ MODULE_DEVICE_TABLE(pnp_card, snd_opti9xx_pnpids); #define DEV_NAME KBUILD_MODNAME -static char * snd_opti9xx_names[] = { +static const char * const snd_opti9xx_names[] = { "unknown", "82C928", "82C929", "82C924", "82C925", @@ -173,7 +173,7 @@ static char * snd_opti9xx_names[] = { static int snd_opti9xx_init(struct snd_opti9xx *chip, unsigned short hardware) { - static int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2}; + static const int opti9xx_mc_size[] = {7, 7, 10, 10, 2, 2, 2}; chip->hardware = hardware; strcpy(chip->name, snd_opti9xx_names[hardware]); @@ -808,7 +808,7 @@ static void snd_card_opti9xx_free(struct snd_card *card) static int snd_opti9xx_probe(struct snd_card *card) { - static long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1}; + static const long possible_ports[] = {0x530, 0xe80, 0xf40, 0x604, -1}; int error; int xdma2; struct snd_opti9xx *chip = card->private_data; @@ -958,16 +958,16 @@ static int snd_opti9xx_isa_probe(struct device *devptr, { struct snd_card *card; int error; - static long possible_mpu_ports[] = {0x300, 0x310, 0x320, 0x330, -1}; + static const long possible_mpu_ports[] = {0x300, 0x310, 0x320, 0x330, -1}; #ifdef OPTi93X - static int possible_irqs[] = {5, 9, 10, 11, 7, -1}; + static const int possible_irqs[] = {5, 9, 10, 11, 7, -1}; #else - static int possible_irqs[] = {9, 10, 11, 7, -1}; + static const int possible_irqs[] = {9, 10, 11, 7, -1}; #endif /* OPTi93X */ - static int possible_mpu_irqs[] = {5, 9, 10, 7, -1}; - static int possible_dma1s[] = {3, 1, 0, -1}; + static const int possible_mpu_irqs[] = {5, 9, 10, 7, -1}; + static const int possible_dma1s[] = {3, 1, 0, -1}; #if defined(CS4231) || defined(OPTi93X) - static int possible_dma2s[][2] = {{1,-1}, {0,-1}, {-1,-1}, {0,-1}}; + static const int possible_dma2s[][2] = {{1,-1}, {0,-1}, {-1,-1}, {0,-1}}; #endif /* CS4231 || OPTi93X */ if (mpu_port == SNDRV_AUTO_PORT) { From patchwork Sun Jan 5 14:48: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: 193950 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 961ACC47409 for ; Sun, 5 Jan 2020 15:57: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 13B6024679 for ; Sun, 5 Jan 2020 15:57: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="n3EFONia" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13B6024679 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 10D1C1819; Sun, 5 Jan 2020 16:19:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 10D1C1819 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237636; bh=HXSq3AUmtXKz8oRHphtCgYIQRwheztfjMKRWFxxqCwI=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=n3EFONiaMvqrCd2sSK51IuhD/mFK4yAx+ElrOLO+42FMfAi+bF/Xwrnacg2gkVAQv NSMJUCwrtYXHzMzWsF50l4xCFyOqef2tkKfHtFFpoyq4Z6/wMjs86JYX9J0iqKtkHt VK0KG6TTBU/INGJr4qKsX1jjp9QTM81M+DWkj5es= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D5E48F804E1; Sun, 5 Jan 2020 15:50:31 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5058CF803AD; Sun, 5 Jan 2020 15:49:43 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 195DDF802C4 for ; Sun, 5 Jan 2020 15:48:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 195DDF802C4 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 2A282B2BF for ; Sun, 5 Jan 2020 14:48:34 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:48:06 +0100 Message-Id: <20200105144823.29547-52-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 51/68] ALSA: wss: More constifications 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" Apply const prefix to the static tables for parameters. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/isa/wss/wss_lib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c index d37f4642162a..ea5d3cdfe4e4 100644 --- a/sound/isa/wss/wss_lib.c +++ b/sound/isa/wss/wss_lib.c @@ -38,7 +38,7 @@ MODULE_LICENSE("GPL"); * Some variables */ -static unsigned char freq_bits[14] = { +static const unsigned char freq_bits[14] = { /* 5510 */ 0x00 | CS4231_XTAL2, /* 6620 */ 0x0E | CS4231_XTAL2, /* 8000 */ 0x00 | CS4231_XTAL1, @@ -72,7 +72,7 @@ static int snd_wss_xrate(struct snd_pcm_runtime *runtime) &hw_constraints_rates); } -static unsigned char snd_wss_original_image[32] = +static const unsigned char snd_wss_original_image[32] = { 0x00, /* 00/00 - lic */ 0x00, /* 01/01 - ric */ @@ -108,7 +108,7 @@ static unsigned char snd_wss_original_image[32] = 0x00, /* 1f/31 - cbrl */ }; -static unsigned char snd_opti93x_original_image[32] = +static const unsigned char snd_opti93x_original_image[32] = { 0x00, /* 00/00 - l_mixout_outctrl */ 0x00, /* 01/01 - r_mixout_outctrl */ From patchwork Sun Jan 5 14:48: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: 193947 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 320CFC33C9A for ; Sun, 5 Jan 2020 16:02: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 A6A2D222C4 for ; Sun, 5 Jan 2020 16:02:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="D2gxNTGf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6A2D222C4 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 E1BC81839; Sun, 5 Jan 2020 16:25:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E1BC81839 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237993; bh=uzXdw1ohwJjKWAs8lW88kbHZr5bvQHQSWjO0Bd7u4Qk=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=D2gxNTGfyhIkpFEhjZQdH4tiPXFw0qSJSRmV7uCmaPwhUX3u/lWHuagkRJbvQ+t2+ fFm8+3QaxVYdi6tpEtvTPQqK9tDcymV2fjAZakwj+7ddQQYwkLe2fjHq40U0BZ99r8 j6hDuImfAQGr1brmPsfRG5jHepubYHB8kXWV5mfk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 64D85F8055B; Sun, 5 Jan 2020 15:50:41 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9AE6AF803D1; Sun, 5 Jan 2020 15:49:53 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BECD4F802E9 for ; Sun, 5 Jan 2020 15:48:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BECD4F802E9 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 50253B2C3 for ; Sun, 5 Jan 2020 14:48:34 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:48:09 +0100 Message-Id: <20200105144823.29547-55-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 54/68] ALSA: aw2: More constifications 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" Apply const prefix to the static parameter tables. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/aw2/aw2-tsl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/aw2/aw2-tsl.c b/sound/pci/aw2/aw2-tsl.c index 41fed546ea14..2f35b08809a3 100644 --- a/sound/pci/aw2/aw2-tsl.c +++ b/sound/pci/aw2/aw2-tsl.c @@ -59,7 +59,7 @@ /* SD3: >-------<_4-L___>-------<_4-R___> */ /* WS4: -------\_______________/--------- */ -static int tsl1[8] = { +static const int tsl1[8] = { 1 * TSL_SDW_A1 | 3 * TSL_BSEL_A1 | 0 * TSL_DIS_A1 | 0 * TSL_DOD_A1 | TSL_LF_A1, @@ -85,7 +85,7 @@ static int tsl1[8] = { 0 * TSL_DOD_A1 | TSL_WS1 | TSL_WS0 | TSL_SF_A1 | TSL_EOS, }; -static int tsl2[8] = { +static const int tsl2[8] = { 0 * TSL_SDW_A2 | 3 * TSL_BSEL_A2 | 2 * TSL_DOD_A2 | TSL_LF_A2, 0 * TSL_SDW_A2 | 2 * TSL_BSEL_A2 | 2 * TSL_DOD_A2, 0 * TSL_SDW_A2 | 3 * TSL_BSEL_A2 | 2 * TSL_DOD_A2, From patchwork Sun Jan 5 14:48: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: 193948 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B9A9C47409 for ; Sun, 5 Jan 2020 16:02: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 B965A24676 for ; Sun, 5 Jan 2020 16:02:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Xt6BtgSF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B965A24676 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 76F351821; Sun, 5 Jan 2020 16:23:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 76F351821 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237837; bh=2AdjWdxKM22EDbHMiIiECXrNRgwl5iSn897G+1T6jVI=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Xt6BtgSF8QTWkJvrdxW6+Gv5iVf78o7UXOR33mCQ3poAzMH7RnhwekXJa7UFMjsnU pUC2NeMuXg8qVMAxdISVUs8dILGTj4/n7lJ6e2t1jwAINFm/pCU8guNx5fVOJJJYdj 38lQPymc9KtdrkSTu40aT5qKTvAvM2uObTebaSG0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 80FBCF80526; Sun, 5 Jan 2020 15:50:37 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 18EEAF803CE; Sun, 5 Jan 2020 15:49:50 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9BF60F802E1 for ; Sun, 5 Jan 2020 15:48:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9BF60F802E1 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 6B428B2C5 for ; Sun, 5 Jan 2020 14:48:34 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:48:11 +0100 Message-Id: <20200105144823.29547-57-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 56/68] ALSA: arm: More constification 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" Apply const prefix to the static channel list table. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/arm/aaci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index d663bd7adae6..a0996c47e58f 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -380,7 +380,7 @@ static const struct snd_pcm_hardware aaci_hw_info = { static int aaci_rule_channels(struct snd_pcm_hw_params *p, struct snd_pcm_hw_rule *rule) { - static unsigned int channel_list[] = { 2, 4, 6 }; + static const unsigned int channel_list[] = { 2, 4, 6 }; struct aaci *aaci = rule->private; unsigned int mask = 1 << 0, slots; From patchwork Sun Jan 5 14:48: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: 193953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC69BC33C9A for ; Sun, 5 Jan 2020 15:52:44 +0000 (UTC) Received: from alsa0.perex.cz (unknown [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 A579C2085B for ; Sun, 5 Jan 2020 15:52: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="lJY4NKc/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A579C2085B 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 668721834; Sun, 5 Jan 2020 16:26:33 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 668721834 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578238043; bh=yl0YvKMuXbRn7CZRzF1nFfnNAeFZkv4YXkldO3j53O4=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lJY4NKc/lU/3PdwySqW7jpmmvBwEUBubfEItsWTHxUbpmNAsAA6zNekXrucFoQoHH /+hcrtpKRNmKy/ZCHF50R3MLPBK6fnJqBJvhx1DSyUQFnz0CSqOOd1qzUTPhXMFLhk nMwt4hm4GN5BOfNj6/cbtMLvJgavhhW0V9cH4Cyk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 234D5F8057C; Sun, 5 Jan 2020 15:50:43 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DF089F803D1; Sun, 5 Jan 2020 15:49:55 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B4819F802E2 for ; Sun, 5 Jan 2020 15:48:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B4819F802E2 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 86101B2C7 for ; Sun, 5 Jan 2020 14:48:34 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:48:13 +0100 Message-Id: <20200105144823.29547-59-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 58/68] ALSA: serial-u16550: More constification 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" Apply const prefix to the string array. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/drivers/serial-u16550.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 893c2b57331f..3947f084dd6b 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c @@ -42,7 +42,7 @@ MODULE_SUPPORTED_DEVICE("{{ALSA, MIDI serial u16550}}"); #define SNDRV_SERIAL_MS124W_MB 3 /* Midiator MS-124W in M/B mode */ #define SNDRV_SERIAL_GENERIC 4 /* Generic Interface */ #define SNDRV_SERIAL_MAX_ADAPTOR SNDRV_SERIAL_GENERIC -static char *adaptor_names[] = { +static const char * const adaptor_names[] = { "Soundcanvas", "MS-124T", "MS-124W S/A", From patchwork Sun Jan 5 14:48: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: 193949 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1948FC33C8C for ; Sun, 5 Jan 2020 16:02: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 961FF21734 for ; Sun, 5 Jan 2020 16:02:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="mKMrL91s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 961FF21734 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 362CF183E; Sun, 5 Jan 2020 16:24:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 362CF183E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578237913; bh=x1s3h/8f5gtuqbjVREyTqCZ6kI7T1aC/z7+R8qjouZc=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mKMrL91sgWnsyIB5f0V17LSBgtCbAN3mbHLj751PX+DrtWFwUQPbtZ41E28ckNsYl EN+wyGCDNLuLWlhCbhxR3jlvhh91G+OPJ4mkHh0yxGTMI/xE2SdC/0eXp3tC18BCV0 aj3Y6jk8Gih5ptWvXeDXAfiePhEzNhYwym3/aWjI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 882D1F80543; Sun, 5 Jan 2020 15:50:39 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 691F3F802E1; Sun, 5 Jan 2020 15:49:51 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BDC77F802E7 for ; Sun, 5 Jan 2020 15:48:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BDC77F802E7 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 92EB1B2C8 for ; Sun, 5 Jan 2020 14:48:34 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:48:14 +0100 Message-Id: <20200105144823.29547-60-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 59/68] ALSA: ak4531: More constification 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" Apply const prefix to the initial register map. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/ak4531_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/ak4531_codec.c b/sound/pci/ak4531_codec.c index c00c65726a34..e0a81f99f79a 100644 --- a/sound/pci/ak4531_codec.c +++ b/sound/pci/ak4531_codec.c @@ -335,7 +335,7 @@ static int snd_ak4531_dev_free(struct snd_device *device) return snd_ak4531_free(ak4531); } -static u8 snd_ak4531_initial_map[0x19 + 1] = { +static const u8 snd_ak4531_initial_map[0x19 + 1] = { 0x9f, /* 00: Master Volume Lch */ 0x9f, /* 01: Master Volume Rch */ 0x9f, /* 02: Voice Volume Lch */ From patchwork Sun Jan 5 14:48:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 193952 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9423C33C9B for ; Sun, 5 Jan 2020 15: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 5CE7B217F4 for ; Sun, 5 Jan 2020 15: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="VrfCLSoE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CE7B217F4 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 074E4178D; Sun, 5 Jan 2020 16:27:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 074E4178D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578238115; bh=2QSsmekhwLEYG5rbt7Yjhfs+LKVPNxxyO7Vx7V6lRAg=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VrfCLSoEtDa6bnnhGcBuDkz9e0pRDQMKxJBh4wTYHisuliSamGpj5rySaFO7xgFYd cDGbEcAXOgYgHRlAn2VqVuG91jFcH9Hga1NWZ9J0w41+KI1NjVU6fqDH2b9RcjjZyW bvNsmDmHKhTa8zTGzYYzt2XCJ8soAWkTC/301DcA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 56C3BF805AD; Sun, 5 Jan 2020 15:50:45 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BFC0FF803D6; Sun, 5 Jan 2020 15:49:57 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id EE8AEF802EB for ; Sun, 5 Jan 2020 15:48:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EE8AEF802EB 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 AEC5FB2CB for ; Sun, 5 Jan 2020 14:48:34 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:48:16 +0100 Message-Id: <20200105144823.29547-62-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 61/68] ALSA: cs4281: More constification 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" Apply const prefix to the static register table. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/cs4281.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c index dc89ef906c9b..94d2a6a466a8 100644 --- a/sound/pci/cs4281.c +++ b/sound/pci/cs4281.c @@ -1939,7 +1939,7 @@ static void snd_cs4281_remove(struct pci_dev *pci) */ #ifdef CONFIG_PM_SLEEP -static int saved_regs[SUSPEND_REGISTERS] = { +static const int saved_regs[SUSPEND_REGISTERS] = { BA0_JSCTL, BA0_GPIOR, BA0_SSCR, From patchwork Sun Jan 5 14:48: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: 193946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17B46C33C9A for ; Sun, 5 Jan 2020 16:07: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 9007E222C4 for ; Sun, 5 Jan 2020 16:07:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="evINUyHx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9007E222C4 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 548911841; Sun, 5 Jan 2020 16:29:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 548911841 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578238195; bh=/DDIBMefje2SxifJtdfnsAWfKoSTPkGG6R4NQTQNKoI=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=evINUyHxQTBgrQcMp24G4Rk/auVfH9C9dSXE8IBTBrnp+BvmtO9uHaBCrv1XnKKEE TJzEIWdInclZgQGwnzebyl7iGIHhzPhEKrPiOLZZZ9sAQrGM1AYlcuVjYd/Fev3JK9 0lYw0wlrbOST30UK5hszn38P3b3XQI3ybdbR+9jY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2BFAAF805C7; Sun, 5 Jan 2020 15:50:47 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A44E3F803EA; Sun, 5 Jan 2020 15:49:59 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 63DFEF802F7 for ; Sun, 5 Jan 2020 15:48:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 63DFEF802F7 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 CAF97B2CE for ; Sun, 5 Jan 2020 14:48:34 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:48:18 +0100 Message-Id: <20200105144823.29547-64-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 63/68] ALSA: ens137x: More constification 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" Apply const prefix to the quirk entry, forgotten in the previous fix. Just for minor optimization and no functional changes. Signed-off-by: Takashi Iwai --- sound/pci/ens1370.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 7ef9b7a1b2e6..d9acef0826a9 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c @@ -1574,7 +1574,7 @@ static int es1371_quirk_lookup(struct ensoniq *ensoniq, return 0; } -static struct es1371_quirk es1371_spdif_present[] = { +static const struct es1371_quirk es1371_spdif_present[] = { { .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 }, From patchwork Sun Jan 5 14:48: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: 193945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AF66C33C99 for ; Sun, 5 Jan 2020 16:07: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 96FD524672 for ; Sun, 5 Jan 2020 16:07:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="lp9GreUD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96FD524672 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 BAC01185C; Sun, 5 Jan 2020 16:30:59 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BAC01185C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578238309; bh=z73+Ial2hzon5B0BnYZ+9YP62cWRSgyNuaTRHS6lvwc=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=lp9GreUD/pSoxGAvf0p4RjHI/DT8pCNT7n1UpadsN4+cFaLAgXbc4W1v8/2+vIZxi ZFuX8olSwfsVpfuniPWxlzBHmOag0ULItdrTFQpgfDzGJbXP1tpjGHsvMJu95y8ub+ pJOe1rOqFjmbR6uNpYvpkxjYrCoz8aw4HHc8OuZo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 058C5F805E3; Sun, 5 Jan 2020 15:50:50 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E170DF803F4; Sun, 5 Jan 2020 15:50:03 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7F408F802F9 for ; Sun, 5 Jan 2020 15:48:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7F408F802F9 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 1E321B2D2 for ; Sun, 5 Jan 2020 14:48:35 +0000 (UTC) From: Takashi Iwai To: alsa-devel@alsa-project.org Date: Sun, 5 Jan 2020 15:48:23 +0100 Message-Id: <20200105144823.29547-69-tiwai@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20200105144823.29547-1-tiwai@suse.de> References: <20200105144823.29547-1-tiwai@suse.de> Subject: [alsa-devel] [PATCH 68/68] ALSA: sh: Fix compile warning wrt 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" A long-standing compile warning was seen during build test: sound/sh/aica.c: In function 'load_aica_firmware': sound/sh/aica.c:521:25: warning: passing argument 2 of 'spu_memload' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] Fixes: 198de43d758c ("[ALSA] Add ALSA support for the SEGA Dreamcast PCM device") Signed-off-by: Takashi Iwai --- sound/sh/aica.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/sh/aica.c b/sound/sh/aica.c index f3cd12ff09c3..8fa68432d3c1 100644 --- a/sound/sh/aica.c +++ b/sound/sh/aica.c @@ -101,10 +101,10 @@ static void spu_memset(u32 toi, u32 what, int length) } /* spu_memload - write to SPU address space */ -static void spu_memload(u32 toi, void *from, int length) +static void spu_memload(u32 toi, const void *from, int length) { unsigned long flags; - u32 *froml = from; + const u32 *froml = from; u32 __iomem *to = (u32 __iomem *) (SPU_MEMORY_BASE + toi); int i; u32 val;