Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756777AbcJ3PDU (ORCPT ); Sun, 30 Oct 2016 11:03:20 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:58604 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756626AbcJ3PDS (ORCPT ); Sun, 30 Oct 2016 11:03:18 -0400 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.wolfsonmicro.com Date: Sun, 30 Oct 2016 15:03:05 +0000 From: Charles Keepax To: Julia Lawall CC: Sebastian Reichel , , , , Subject: Re: [PATCH 03/15] wm8350_power: use permission-specific DEVICE_ATTR variants Message-ID: <20161030150305.GB1575@localhost.localdomain> References: <1477769829-22230-1-git-send-email-Julia.Lawall@lip6.fr> <1477769829-22230-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: <1477769829-22230-4-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 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610300273 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 876 Lines: 39 On Sat, Oct 29, 2016 at 09:36:57PM +0200, Julia Lawall wrote: > Use DEVICE_ATTR_RO for read only attributes. This simplifies the source > code, improves readbility, and reduces the chance of inconsistencies. > > The semantic patch that makes this change is as follows: > (http://coccinelle.lip6.fr/) > > // > @ro@ > declarer name DEVICE_ATTR; > identifier x,x_show; > @@ > > DEVICE_ATTR(x, \(0444\|S_IRUGO\), x_show, NULL); > > @script:ocaml@ > x << ro.x; > x_show << ro.x_show; > @@ > > if not (x^"_show" = x_show) then Coccilib.include_match false > > @@ > declarer name DEVICE_ATTR_RO; > identifier ro.x,ro.x_show; > @@ > > - DEVICE_ATTR(x, \(0444\|S_IRUGO\), x_show, NULL); > + DEVICE_ATTR_RO(x); > // > > Signed-off-by: Julia Lawall > > --- Acked-by: Charles Keepax Thanks, Charles