From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754002AbcIAW60 (ORCPT ); Thu, 1 Sep 2016 18:58:26 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53821 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753599AbcIAW6X (ORCPT ); Thu, 1 Sep 2016 18:58:23 -0400 X-IBM-Helo: d24dlp02.br.ibm.com X-IBM-MailFrom: krisman@linux.vnet.ibm.com X-IBM-RcptTo: kernel-janitors@vger.kernel.org;linux-kernel@vger.kernel.org;linux-serial@vger.kernel.org From: Gabriel Krisman Bertazi To: Julia Lawall Cc: kernel-janitors@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/9] tty: serial: jsm_tty: constify uart_ops structures Organization: IBM References: <1472752298-981-1-git-send-email-Julia.Lawall@lip6.fr> <1472752298-981-6-git-send-email-Julia.Lawall@lip6.fr> Date: Thu, 01 Sep 2016 19:58:15 -0300 In-Reply-To: <1472752298-981-6-git-send-email-Julia.Lawall@lip6.fr> (Julia Lawall's message of "Thu, 1 Sep 2016 19:51:34 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16090122-0028-0000-0000-0000013B9FF4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16090122-0029-0000-0000-000013F8180D Message-Id: <87r3935it4.fsf@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-01_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1609010269 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Julia Lawall writes: > 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 = { ... }; > // > Acked-by: Gabriel Krisman Bertazi -- Gabriel Krisman Bertazi