From patchwork Tue Dec 19 18:15:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 10123937 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0438B6019C for ; Tue, 19 Dec 2017 18:16:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3361289AD for ; Tue, 19 Dec 2017 18:16:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7D8A2914A; Tue, 19 Dec 2017 18:16:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C7D3289AD for ; Tue, 19 Dec 2017 18:16:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752518AbdLSSQT (ORCPT ); Tue, 19 Dec 2017 13:16:19 -0500 Received: from smtprelay0001.hostedemail.com ([216.40.44.1]:41930 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752274AbdLSSPv (ORCPT ); Tue, 19 Dec 2017 13:15:51 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 0C87B181D341D; Tue, 19 Dec 2017 18:15:48 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: shop85_320c45d86f52b X-Filterd-Recvd-Size: 5932 Received: from joe-laptop.perches.com (unknown [47.151.150.235]) (Authenticated sender: joe@perches.com) by omf09.hostedemail.com (Postfix) with ESMTPA; Tue, 19 Dec 2017 18:15:43 +0000 (UTC) From: Joe Perches To: Borislav Petkov , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Thomas Falcon , John Allen , Inaky Perez-Gonzalez , linux-wimax@intel.com, James Smart , Dick Kennedy , Zhang Rui , Eduardo Valentin Cc: Martin Schwidefsky , Heiko Carstens , Thomas Gleixner , "H. Peter Anvin" , x86@kernel.org, Dmitry Torokhov , "James E.J. Bottomley" , "Martin K. Petersen" , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-scsi@vger.kernel.org, linux-pm@vger.kernel.org Subject: [-next PATCH 4/4] treewide: Use DEVICE_ATTR_WO Date: Tue, 19 Dec 2017 10:15:09 -0800 Message-Id: X-Mailer: git-send-email 2.15.0 In-Reply-To: References: Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Convert DEVICE_ATTR uses to DEVICE_ATTR_WO where possible. Done with perl script: $ git grep -w --name-only DEVICE_ATTR | \ xargs perl -i -e 'local $/; while (<>) { s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(?:\s*S_IWUSR\s*|\s*0200\s*)\)?\s*,\s*NULL\s*,\s*\s_store\s*\)/DEVICE_ATTR_WO(\1)/g; print;}' Signed-off-by: Joe Perches Acked-by: Zhang Rui --- arch/s390/kernel/smp.c | 2 +- arch/x86/kernel/cpu/microcode/core.c | 2 +- drivers/input/touchscreen/elants_i2c.c | 2 +- drivers/net/ethernet/ibm/ibmvnic.c | 2 +- drivers/net/wimax/i2400m/sysfs.c | 3 +-- drivers/scsi/lpfc/lpfc_attr.c | 3 +-- drivers/thermal/thermal_sysfs.c | 2 +- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index b8c1a85bcf2d..a919b2f0141d 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c @@ -1151,7 +1151,7 @@ static ssize_t __ref rescan_store(struct device *dev, rc = smp_rescan_cpus(); return rc ? rc : count; } -static DEVICE_ATTR(rescan, 0200, NULL, rescan_store); +static DEVICE_ATTR_WO(rescan); #endif /* CONFIG_HOTPLUG_CPU */ static int __init s390_smp_init(void) diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index c4fa4a85d4cb..09c74b0560dd 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -560,7 +560,7 @@ static ssize_t pf_show(struct device *dev, return sprintf(buf, "0x%x\n", uci->cpu_sig.pf); } -static DEVICE_ATTR(reload, 0200, NULL, reload_store); +static DEVICE_ATTR_WO(reload); static DEVICE_ATTR(version, 0400, version_show, NULL); static DEVICE_ATTR(processor_flags, 0400, pf_show, NULL); diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index a458e5ec9e41..819213e88f32 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -1000,7 +1000,7 @@ static ssize_t show_iap_mode(struct device *dev, "Normal" : "Recovery"); } -static DEVICE_ATTR(calibrate, S_IWUSR, NULL, calibrate_store); +static DEVICE_ATTR_WO(calibrate); static DEVICE_ATTR(iap_mode, S_IRUGO, show_iap_mode, NULL); static DEVICE_ATTR(update_fw, S_IWUSR, NULL, write_update_fw); diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c index 1dc4aef37d3a..42b96e1a1b13 100644 --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -4411,7 +4411,7 @@ static ssize_t failover_store(struct device *dev, struct device_attribute *attr, return count; } -static DEVICE_ATTR(failover, 0200, NULL, failover_store); +static DEVICE_ATTR_WO(failover); static unsigned long ibmvnic_get_desired_dma(struct vio_dev *vdev) { diff --git a/drivers/net/wimax/i2400m/sysfs.c b/drivers/net/wimax/i2400m/sysfs.c index 1237109f251a..8c67df11105c 100644 --- a/drivers/net/wimax/i2400m/sysfs.c +++ b/drivers/net/wimax/i2400m/sysfs.c @@ -65,8 +65,7 @@ ssize_t i2400m_idle_timeout_store(struct device *dev, } static -DEVICE_ATTR(i2400m_idle_timeout, S_IWUSR, - NULL, i2400m_idle_timeout_store); +DEVICE_ATTR_WO(i2400m_idle_timeout); static struct attribute *i2400m_dev_attrs[] = { diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 517ff203cfde..6ddaf51a23f6 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -2418,8 +2418,7 @@ lpfc_soft_wwn_enable_store(struct device *dev, struct device_attribute *attr, return count; } -static DEVICE_ATTR(lpfc_soft_wwn_enable, S_IWUSR, NULL, - lpfc_soft_wwn_enable_store); +static DEVICE_ATTR_WO(lpfc_soft_wwn_enable); /** * lpfc_soft_wwpn_show - Return the cfg soft ww port name of the adapter diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c index 2bc964392924..ba81c9080f6e 100644 --- a/drivers/thermal/thermal_sysfs.c +++ b/drivers/thermal/thermal_sysfs.c @@ -317,7 +317,7 @@ emul_temp_store(struct device *dev, struct device_attribute *attr, return ret ? ret : count; } -static DEVICE_ATTR(emul_temp, S_IWUSR, NULL, emul_temp_store); +static DEVICE_ATTR_WO(emul_temp); #endif static ssize_t