From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752679AbcIBIrH (ORCPT ); Fri, 2 Sep 2016 04:47:07 -0400 Received: from sym2.noone.org ([178.63.92.236]:43350 "EHLO sym2.noone.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751756AbcIBIqz (ORCPT ); Fri, 2 Sep 2016 04:46:55 -0400 X-Greylist: delayed 594 seconds by postgrey-1.27 at vger.kernel.org; Fri, 02 Sep 2016 04:46:54 EDT Date: Fri, 2 Sep 2016 10:36:56 +0200 From: Tobias Klauser To: Julia Lawall Cc: kernel-janitors@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, nios2-dev@lists.rocketboards.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/9] serial: altera: constify uart_ops structures Message-ID: <20160902083655.GE8952@distanz.ch> References: <1472752298-981-1-git-send-email-Julia.Lawall@lip6.fr> <1472752298-981-4-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1472752298-981-4-git-send-email-Julia.Lawall@lip6.fr> X-Editor: Vi IMproved 7.3 User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016-09-01 at 19:51:32 +0200, Julia Lawall wrote: > Check for uart_ops structures that are only stored in the ops field of a > uart_port structure. This field is declared const, so uart_ops structures > that have this property can be declared as const also. > > The semantic patch that makes this change is as follows: > (http://coccinelle.lip6.fr/) > > // > @r disable optional_qualifier@ > identifier i; > position p; > @@ > static struct uart_ops i@p = { ... }; > > @ok@ > identifier r.i; > struct uart_port e; > position p; > @@ > e.ops = &i@p; > > @bad@ > position p != {r.p,ok.p}; > identifier r.i; > struct uart_ops e; > @@ > e@i@p > > @depends on !bad disable optional_qualifier@ > identifier r.i; > @@ > static > +const > struct uart_ops i = { ... }; > // > > Signed-off-by: Julia Lawall Acked-by: Tobias Klauser Thanks a lot.