From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751752AbdBSVHL (ORCPT ); Sun, 19 Feb 2017 16:07:11 -0500 Received: from mx2.suse.de ([195.135.220.15]:49306 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751167AbdBSVHK (ORCPT ); Sun, 19 Feb 2017 16:07:10 -0500 Date: Sun, 19 Feb 2017 22:07:07 +0100 Message-ID: From: Takashi Iwai To: "Bhumika Goyal" Cc: , , , , Subject: Re: [PATCH] ALSA: constify snd_kcontrol_new structures In-Reply-To: <1487530089-6361-1-git-send-email-bhumirks@gmail.com> References: <1487530089-6361-1-git-send-email-bhumirks@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.1 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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