Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752461AbdIAN3t (ORCPT ); Fri, 1 Sep 2017 09:29:49 -0400 Received: from ozlabs.org ([103.22.144.67]:34297 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751778AbdIAN3r (ORCPT ); Fri, 1 Sep 2017 09:29:47 -0400 X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 8a7aef2cb3dafd2e8560750f4e5ad2cc2d9b1d17 In-Reply-To: <1477769829-22230-9-git-send-email-Julia.Lawall@lip6.fr> To: Julia Lawall , Benjamin Herrenschmidt From: Michael Ellerman Cc: Paul Mackerras , kernel-janitors@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [08/15] powerpc/iommu: use permission-specific DEVICE_ATTR variants Message-Id: <3xkKpy0Lxrz9t2d@ozlabs.org> Date: Fri, 1 Sep 2017 23:29:45 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1041 Lines: 42 On Sat, 2016-10-29 at 19:37:02 UTC, Julia Lawall wrote: > Use DEVICE_ATTR_RW for read-write 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/) > > // > @rw@ > declarer name DEVICE_ATTR; > identifier x,x_show,x_store; > @@ > > DEVICE_ATTR(x, \(0644\|S_IRUGO|S_IWUSR\), x_show, x_store); > > @script:ocaml@ > x << rw.x; > x_show << rw.x_show; > x_store << rw.x_store; > @@ > > if not (x^"_show" = x_show && x^"_store" = x_store) > then Coccilib.include_match false > > @@ > declarer name DEVICE_ATTR_RW; > identifier rw.x,rw.x_show,rw.x_store; > @@ > > - DEVICE_ATTR(x, \(0644\|S_IRUGO|S_IWUSR\), x_show, x_store); > + DEVICE_ATTR_RW(x); > // > > Signed-off-by: Julia Lawall > Acked-by: Michael Ellerman (powerpc) Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/8a7aef2cb3dafd2e8560750f4e5ad2 cheers