From patchwork Wed Jun 14 07:33:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 9785593 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2809A602C9 for ; Wed, 14 Jun 2017 07:33:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 173C428583 for ; Wed, 14 Jun 2017 07:33:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09728285B0; Wed, 14 Jun 2017 07:33:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19CC828583 for ; Wed, 14 Jun 2017 07:33:20 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0481B267199; Wed, 14 Jun 2017 09:33:18 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id DFFA326719A; Wed, 14 Jun 2017 09:33:16 +0200 (CEST) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id A5B1F266A38 for ; Wed, 14 Jun 2017 09:33:14 +0200 (CEST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D1F5EAC2F; Wed, 14 Jun 2017 07:33:13 +0000 (UTC) From: Takashi Iwai To: Mark Brown Date: Wed, 14 Jun 2017 09:33:06 +0200 Message-Id: <20170614073306.22646-1-tiwai@suse.de> X-Mailer: git-send-email 2.13.1 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH v2] ASoC: intel: bxt: Constify hw_constraints X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the const pointers. Constify the corresponding static objects for better hardening. Signed-off-by: Takashi Iwai --- v1->v2: rebased to topic/intel branch sound/soc/intel/boards/bxt_da7219_max98357a.c | 12 ++++++------ sound/soc/intel/boards/bxt_rt298.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c index 3a8c4d954a91..1429eb391da8 100644 --- a/sound/soc/intel/boards/bxt_da7219_max98357a.c +++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c @@ -238,31 +238,31 @@ static int broxton_da7219_fe_init(struct snd_soc_pcm_runtime *rtd) return 0; } -static unsigned int rates[] = { +static const unsigned int rates[] = { 48000, }; -static struct snd_pcm_hw_constraint_list constraints_rates = { +static const struct snd_pcm_hw_constraint_list constraints_rates = { .count = ARRAY_SIZE(rates), .list = rates, .mask = 0, }; -static unsigned int channels[] = { +static const unsigned int channels[] = { DUAL_CHANNEL, }; -static struct snd_pcm_hw_constraint_list constraints_channels = { +static const struct snd_pcm_hw_constraint_list constraints_channels = { .count = ARRAY_SIZE(channels), .list = channels, .mask = 0, }; -static unsigned int channels_quad[] = { +static const unsigned int channels_quad[] = { QUAD_CHANNEL, }; -static struct snd_pcm_hw_constraint_list constraints_channels_quad = { +static const struct snd_pcm_hw_constraint_list constraints_channels_quad = { .count = ARRAY_SIZE(channels_quad), .list = channels_quad, .mask = 0, diff --git a/sound/soc/intel/boards/bxt_rt298.c b/sound/soc/intel/boards/bxt_rt298.c index 36ee7480e9f1..0c3a3cbcb884 100644 --- a/sound/soc/intel/boards/bxt_rt298.c +++ b/sound/soc/intel/boards/bxt_rt298.c @@ -207,11 +207,11 @@ static const struct snd_soc_ops broxton_rt298_ops = { .hw_params = broxton_rt298_hw_params, }; -static unsigned int rates[] = { +static const unsigned int rates[] = { 48000, }; -static struct snd_pcm_hw_constraint_list constraints_rates = { +static const struct snd_pcm_hw_constraint_list constraints_rates = { .count = ARRAY_SIZE(rates), .list = rates, .mask = 0, @@ -227,11 +227,11 @@ static int broxton_dmic_fixup(struct snd_soc_pcm_runtime *rtd, return 0; } -static unsigned int channels_dmic[] = { +static const unsigned int channels_dmic[] = { 1, 2, 3, 4, }; -static struct snd_pcm_hw_constraint_list constraints_dmic_channels = { +static const struct snd_pcm_hw_constraint_list constraints_dmic_channels = { .count = ARRAY_SIZE(channels_dmic), .list = channels_dmic, .mask = 0, @@ -253,11 +253,11 @@ static const struct snd_soc_ops broxton_dmic_ops = { .startup = broxton_dmic_startup, }; -static unsigned int channels[] = { +static const unsigned int channels[] = { 2, }; -static struct snd_pcm_hw_constraint_list constraints_channels = { +static const struct snd_pcm_hw_constraint_list constraints_channels = { .count = ARRAY_SIZE(channels), .list = channels, .mask = 0,