From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932295AbcIAJrT (ORCPT ); Thu, 1 Sep 2016 05:47:19 -0400 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:48308 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751080AbcIAJrR (ORCPT ); Thu, 1 Sep 2016 05:47:17 -0400 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.wolfsonmicro.com Date: Thu, 1 Sep 2016 10:45:41 +0100 From: Charles Keepax To: Julia Lawall CC: Liam Girdwood , , Mark Brown , Jaroslav Kysela , "Takashi Iwai" , , , Subject: Re: [PATCH] ASoC: constify snd_soc_codec_driver structures Message-ID: <20160901094541.GD21682@localhost.localdomain> References: <1472680347-19575-1-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1472680347-19575-1-git-send-email-Julia.Lawall@lip6.fr> User-Agent: Mutt/1.5.23 (2014-03-12) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1609010108 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 31, 2016 at 11:52:27PM +0200, Julia Lawall wrote: > Check for snd_soc_codec_driver structures that are only passed to > snd_soc_register_codec or memcpy (2nd arg), for which the corresponding > parameters are declared const. Declare as const snd_soc_codec_driver > structures that have these properties. > > The semantic patch that makes this change is as follows: > (http://coccinelle.lip6.fr/) > > // > @r disable optional_qualifier@ > identifier i; > position p; > @@ > static struct snd_soc_codec_driver i@p = { ... }; > > @ok@ > identifier r.i; > expression e1,e2,e3; > position p; > @@ > ( > snd_soc_register_codec(e1,&i@p,e2,e3) > | > memcpy(e1,&i@p,e2) > ) > > @bad@ > position p != {r.p,ok.p}; > identifier r.i; > @@ > i@p > > @depends on !bad disable optional_qualifier@ > identifier r.i; > @@ > static > +const > struct snd_soc_codec_driver i = { ... }; > // > > Signed-off-by: Julia Lawall > > --- I haven't looked at every single case individually, but the ones I have looked at look fine. Acked-by: Charles Keepax Thanks, Charles