Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753179AbeADOg0 (ORCPT + 1 other); Thu, 4 Jan 2018 09:36:26 -0500 Received: from mail-pl0-f68.google.com ([209.85.160.68]:33556 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753079AbeADOgY (ORCPT ); Thu, 4 Jan 2018 09:36:24 -0500 X-Google-Smtp-Source: ACJfBos6G/xVyb8rDN3u8T/JBgMOpeYXbh+dGb5OCKBRGDihmg0LEuNcT7wpxTPa0pZlnuso4f5Wyg== Date: Thu, 4 Jan 2018 20:06:18 +0530 From: Aishwarya Pant To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Julia Lawall , Joe Perches Subject: [PATCH 0/5] iio: use permission specific variants of DEVICE_ATTR Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Series of clean-up patches which replace all DEVICE_ATTR macros with the permission specific variants DEVICE_ATTR_{RO/WO/RW}. Patches were created using coccinelle. The following script is for conversion to the DEVICE_ATTR_RO macro and the other conversions are similar. The script may require some manual intervention when multiple attributes share the show or store function. @r@ identifier attr, show_fn; declarer name DEVICE_ATTR; @@ DEVICE_ATTR(attr, \(S_IRUGO\|0444\), show_fn, NULL); @script: python p@ attr_show; attr << r.attr; @@ // standardise the show fn name to {attr}_show coccinelle.attr_show = attr + "_show" @@ identifier r.attr, r.show_fn; declarer name DEVICE_ATTR_RO; @@ // change the attr declaration - DEVICE_ATTR(attr, \(S_IRUGO\|0444\), show_fn, NULL); + DEVICE_ATTR_RO(attr); @rr@ identifier r.show_fn, p.attr_show; @@ // rename the show function - show_fn + attr_show (...) { ... } @depends on rr@ identifier r.show_fn, p.attr_show; @@ // rename fn usages - show_fun + attr_show Aishwarya Pant (5): iio: buffer: use permission specific variants of DEVICE_ATTR iio: core: use permission specific variants of DEVICE_ATTR iio: trigger: use permission specific variants of DEVICE_ATTR iio: hrtimer: use permission specific variants of DEVICE_ATTR iio: trigger: sysfs: use permisssion specific variants of DEVICE_ATTR drivers/iio/industrialio-buffer.c | 25 +++++++++++-------------- drivers/iio/industrialio-core.c | 11 +++++------ drivers/iio/industrialio-trigger.c | 18 ++++++++---------- drivers/iio/trigger/iio-trig-hrtimer.c | 8 +++----- drivers/iio/trigger/iio-trig-sysfs.c | 4 ++-- 5 files changed, 29 insertions(+), 37 deletions(-) -- 2.15.1