From: Takashi Iwai Subject: Re: [PATCH] ALSA: constify snd_kcontrol_new structures Date: Sun, 19 Feb 2017 22:07:07 +0100 Message-ID: References: <1487530089-6361-1-git-send-email-bhumirks@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 7E85626583C for ; Sun, 19 Feb 2017 22:07:08 +0100 (CET) In-Reply-To: <1487530089-6361-1-git-send-email-bhumirks@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Bhumika Goyal Cc: julia.lawall@lip6.fr, alsa-devel@alsa-project.org, clemens@ladisch.de, linux-kernel@vger.kernel.org List-Id: alsa-devel@alsa-project.org On Sun, 19 Feb 2017 19:48:09 +0100, Bhumika Goyal wrote: > > Declare snd_kcontrol_new structures as const as they are only passed as > an argument to the function snd_ctl_new1. This argument is of type > const, so snd_kcontrol_new structures having the same property can be > made const too. > Done using Coccinelle: > > @r1 disable optional_qualifier @ > identifier i; > position p; > @@ > static struct snd_kcontrol_new i@p = {...}; > > @ok1@ > identifier r1.i; > position p; > expression e1; > @@ > snd_ctl_new1(&i@p,e1) > > @bad@ > position p!={r1.p,ok1.p}; > identifier r1.i; > @@ > i@p > > @depends on !bad disable optional_qualifier@ > identifier r1.i; > @@ > +const > struct snd_kcontrol_new i; > > Signed-off-by: Bhumika Goyal It's too large for a change at a minute before the merge window. I'll postpone this for 4.12. thanks, Takashi