From patchwork Wed May 17 11:38:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9730927 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 4E43E602DB for ; Wed, 17 May 2017 11:40:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D2B028700 for ; Wed, 17 May 2017 11:40:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3026828753; Wed, 17 May 2017 11:40:00 +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=-0.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=no 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 7FD6328700 for ; Wed, 17 May 2017 11:39:55 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 812DF266834; Wed, 17 May 2017 13:39:49 +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 1396F266E84; Wed, 17 May 2017 13:39:44 +0200 (CEST) Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by alsa0.perex.cz (Postfix) with ESMTP id BFCA52664EB for ; Wed, 17 May 2017 13:39:39 +0200 (CEST) Received: by mail-pg0-f67.google.com with SMTP id s62so1534343pgc.0 for ; Wed, 17 May 2017 04:39:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=DMcgLX53wDfE3qr0dhD1QfcDdaXe46oo82ABzoKh2L0=; b=AobCrTGwRrJbbfeIcdrOjvr08/9MtXjbchX7wGZOMLhjgYyC/dXmVk4mNgKwXxcc1n Hp1hdUAOCB9KoTZIgcn4lNAKXPsnaOs8f0HO6ufUsf/5zng/LJY+Yd+rGcNnEEKOPEhg Bq2eeWnUTCLzUByT9ZQnS4oHW4VxqsC3g2+PvJvslEf37xo5Qdy9K7hbAC8t6TO+zVsd Ytue8axYij3xAJByyVrEKPHKELr4xj+KgpVl/7PU71FhVjtcI6RyoFhV/nMEWhG8cTTU YQw9On0nhcWCV7fXAikG4a2HXM/CaQAIjORmOC7ysgQGbj6ECFTSf+QLNLO5rQuC505P 23Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DMcgLX53wDfE3qr0dhD1QfcDdaXe46oo82ABzoKh2L0=; b=HP29ryC5K259otBo2/El21OsobZiE7pXH6U5ovXmvPv1CzJjDN+ZOn2QCo5jo/qMTP TVM6luy24yMibZRq7EheLWHpfX5/uOm9ySfgn8hVQFGAOKcw+eBC0zikAQKeqMVrTFsQ 85CPo/Z8R8dtdqw03Ci0sjRI26PRY4BhKw5/c9s+tXHOZNNH1I6fqtbO7il2zsKIVM8W kqk2VRceSMuLai2DJzSTm9YsuDitS9JZBIFSMvhx0uRrs11id5AJc+ah2QcTuX55SZ+I 5ZEutjVuaHx8ulvdqXvwiOZvNqio9jQ05xVW+YPlaIBuoM4+fa8Kjnd/O2ApgwLLpXUY W/Ig== X-Gm-Message-State: AODbwcBH3Cptat3jvLGGQfrvtH8y8CWzkcBB8f7Os+BNPs206AMh/G54 RU5hpasgo0cA3g== X-Received: by 10.99.123.81 with SMTP id k17mr3281686pgn.125.1495021178016; Wed, 17 May 2017 04:39:38 -0700 (PDT) Received: from gmail.com ([106.51.8.234]) by smtp.gmail.com with ESMTPSA id l7sm5435384pgn.10.2017.05.17.04.39.33 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 17 May 2017 04:39:37 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Wed, 17 May 2017 17:08:57 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Date: Wed, 17 May 2017 17:08:56 +0530 Message-Id: <1495021136-6999-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 2.7.4 Cc: Bhumika Goyal Subject: [alsa-devel] [PATCH] ALSA: sound/isa: constify snd_kcontrol_new structures 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 Declare snd_kcontrol_new structures as const as they are only passed an argument to the function snd_ctl_new1. This argument is of type const, so snd_kcontrol_new structures having this property can be made const. Done using Coccinelle: @r disable optional_qualifier@ identifier x; position p; @@ static struct snd_kcontrol_new x@p={...}; @ok@ identifier r.x; position p; @@ snd_ctl_new1(&x@p,...) @bad@ position p != {r.p,ok.p}; identifier r.x; @@ x@p @depends on !bad disable optional_qualifier@ identifier r.x; @@ +const struct snd_kcontrol_new x; Signed-off-by: Bhumika Goyal --- sound/isa/gus/gus_main.c | 2 +- sound/isa/gus/gus_pcm.c | 4 ++-- sound/isa/sb/sb16_csp.c | 4 ++-- sound/isa/sb/sb16_main.c | 2 +- sound/isa/sscape.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/isa/gus/gus_main.c b/sound/isa/gus/gus_main.c index 4490ee4..3cf9b13 100644 --- a/sound/isa/gus/gus_main.c +++ b/sound/isa/gus/gus_main.c @@ -82,7 +82,7 @@ static int snd_gus_joystick_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el return change; } -static struct snd_kcontrol_new snd_gus_joystick_control = { +static const struct snd_kcontrol_new snd_gus_joystick_control = { .iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = "Joystick Speed", .info = snd_gus_joystick_info, diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c index 0650599..33c1891 100644 --- a/sound/isa/gus/gus_pcm.c +++ b/sound/isa/gus/gus_pcm.c @@ -809,7 +809,7 @@ static int snd_gf1_pcm_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ return change; } -static struct snd_kcontrol_new snd_gf1_pcm_volume_control = +static const struct snd_kcontrol_new snd_gf1_pcm_volume_control = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "PCM Playback Volume", @@ -818,7 +818,7 @@ static struct snd_kcontrol_new snd_gf1_pcm_volume_control = .put = snd_gf1_pcm_volume_put }; -static struct snd_kcontrol_new snd_gf1_pcm_volume_control1 = +static const struct snd_kcontrol_new snd_gf1_pcm_volume_control1 = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "GPCM Playback Volume", diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c index 48da227..fa5780b 100644 --- a/sound/isa/sb/sb16_csp.c +++ b/sound/isa/sb/sb16_csp.c @@ -1029,7 +1029,7 @@ static int snd_sb_qsound_space_put(struct snd_kcontrol *kcontrol, struct snd_ctl return change; } -static struct snd_kcontrol_new snd_sb_qsound_switch = { +static const struct snd_kcontrol_new snd_sb_qsound_switch = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "3D Control - Switch", .info = snd_sb_qsound_switch_info, @@ -1037,7 +1037,7 @@ static struct snd_kcontrol_new snd_sb_qsound_switch = { .put = snd_sb_qsound_switch_put }; -static struct snd_kcontrol_new snd_sb_qsound_space = { +static const struct snd_kcontrol_new snd_sb_qsound_space = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "3D Control - Space", .info = snd_sb_qsound_space_info, diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c index 8b2d6c6..4be1350 100644 --- a/sound/isa/sb/sb16_main.c +++ b/sound/isa/sb/sb16_main.c @@ -737,7 +737,7 @@ static int snd_sb16_dma_control_put(struct snd_kcontrol *kcontrol, struct snd_ct return change; } -static struct snd_kcontrol_new snd_sb16_dma_control = { +static const struct snd_kcontrol_new snd_sb16_dma_control = { .iface = SNDRV_CTL_ELEM_IFACE_CARD, .name = "16-bit DMA Allocation", .info = snd_sb16_dma_control_info, diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c index 54f5758a..1cd2908 100644 --- a/sound/isa/sscape.c +++ b/sound/isa/sscape.c @@ -671,7 +671,7 @@ static int sscape_midi_put(struct snd_kcontrol *kctl, return change; } -static struct snd_kcontrol_new midi_mixer_ctl = { +static const struct snd_kcontrol_new midi_mixer_ctl = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "MIDI", .info = sscape_midi_info,