]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
treewide: Use DEVICE_ATTR_WO
authorJoe Perches <joe@perches.com>
Tue, 19 Dec 2017 18:15:09 +0000 (10:15 -0800)
committerSeth Forshee <seth.forshee@canonical.com>
Fri, 16 Mar 2018 12:18:50 +0000 (07:18 -0500)
BugLink: http://bugs.launchpad.net/bugs/1752182
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 <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6cbaefb4bf2ce6746e49c972289702133b347ffa)
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
arch/s390/kernel/smp.c
arch/x86/kernel/cpu/microcode/core.c
drivers/input/touchscreen/elants_i2c.c
drivers/net/ethernet/ibm/ibmvnic.c
drivers/net/wimax/i2400m/sysfs.c
drivers/scsi/lpfc/lpfc_attr.c
drivers/thermal/thermal_sysfs.c

index b8c1a85bcf2de75eccba0b5b86eb2870bd4b71b6..a919b2f0141da3be91cbdda76afe106a594e489b 100644 (file)
@@ -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)
index e4fc595cd6eaa6ee9b51a380e62fa05270c184e1..319dd65f98a25530d3a55cb6ea1cf61f6c2004bc 100644 (file)
@@ -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);
 
index a458e5ec9e41eaee8a3e04c6643aca614c79a1c3..819213e88f321311ec4de87b931d429592272e92 100644 (file)
@@ -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);
 
index 47b68cd7c898c7342ec27060e8b7c282f0beb98c..1b3cc8bb07050f6856eb4f3e7fe28e4296219d49 100644 (file)
@@ -4538,7 +4538,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)
 {
index 1237109f251abf103434ebfaa53740750b6cd65e..8c67df11105ca74c764be0b0a4d25a472644a732 100644 (file)
@@ -65,8 +65,7 @@ error_bad_value:
 }
 
 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[] = {
index 418a5434329ee44476f217e0d0d04e8ab49de596..ac77081e6e9ebcc629826db7dc382a7b6d6cbfbe 100644 (file)
@@ -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
index 2bc964392924747b0cec220c613b746f70bd7b73..ba81c9080f6ecadd123ce70e5a1cccc8e6e0a8a2 100644 (file)
@@ -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