linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bhumika Goyal <bhumirks@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
	broonie@kernel.org, clemens@ladisch.de,
	Julia Lawall <julia.lawall@lip6.fr>,
	linuxppc-dev@lists.ozlabs.org, perex@perex.cz,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ALSA: declare snd_kcontrol_new structures as const
Date: Tue, 30 May 2017 14:26:23 +0530	[thread overview]
Message-ID: <CAOH+1jEahJz3XYhopE8t=nhMX0a7Ref+U9Qg39fWy3-g2KHjxQ@mail.gmail.com> (raw)
In-Reply-To: <s5hvaoiencx.wl-tiwai@suse.de>

On Tue, May 30, 2017 at 2:24 PM, Takashi Iwai <tiwai@suse.de> wrote:
> On Sat, 27 May 2017 16:46:15 +0200,
> Bhumika Goyal wrote:
>>
>> 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;
>>
>> Cross compiled these files:
>> sound/aoa/codecs/tas.c - powerpc
>> sound/mips/{hal2.c/sgio2audio.c} - mips
>> sound/ppc/{awacs.c/beep.c/tumbler.c} - powerpc
>> sound/soc/sh/siu_dai.c - sh
>> Could not find an architecture to compile sound/sh/aica.c.
>>
>> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
>
> Applied now, as it looks safe enough.  But I prefer splitting to
> individual patches, so please try to do that at the next time.
>
>

Okay :)

Thanks,
Bhumika

> thanks,
>
> Takashi

  reply	other threads:[~2017-05-30  8:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-27 14:46 [PATCH] ALSA: declare snd_kcontrol_new structures as const Bhumika Goyal
2017-05-29 13:14 ` Mark Brown
2017-05-30  8:54 ` Takashi Iwai
2017-05-30  8:56   ` Bhumika Goyal [this message]
2017-05-30  8:56   ` Julia Lawall
2017-05-30  8:59     ` Bhumika Goyal
2017-05-30  9:03     ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOH+1jEahJz3XYhopE8t=nhMX0a7Ref+U9Qg39fWy3-g2KHjxQ@mail.gmail.com' \
    --to=bhumirks@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=clemens@ladisch.de \
    --cc=johannes@sipsolutions.net \
    --cc=julia.lawall@lip6.fr \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).