diff options
author | Joe Perches <joe@perches.com> | 2017-12-19 10:15:08 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-09 16:34:34 +0100 |
commit | c828a8920307185b7194b575731e8387c99a5a67 (patch) | |
tree | ba6d8d4416693df1b322938fbb3eaceea1322df9 /drivers/char | |
parent | b6b996b6cdeecf7e1646c87422e04e446ddce124 (diff) | |
download | linux-c828a8920307185b7194b575731e8387c99a5a67.tar.bz2 |
treewide: Use DEVICE_ATTR_RO
Convert DEVICE_ATTR uses to DEVICE_ATTR_RO 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_IRUGO\s*|\s*0444\s*)\)?\s*,\s*\1_show\s*,\s*NULL\s*\)/DEVICE_ATTR_RO(\1)/g; print;}'
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Sagi Grimberg <sagi@grimberg.me>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index f45732a2cb3e..7f51acd74e10 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -2588,7 +2588,7 @@ static ssize_t device_id_show(struct device *dev, return snprintf(buf, 10, "%u\n", id.device_id); } -static DEVICE_ATTR(device_id, S_IRUGO, device_id_show, NULL); +static DEVICE_ATTR_RO(device_id); static ssize_t provides_device_sdrs_show(struct device *dev, struct device_attribute *attr, @@ -2604,8 +2604,7 @@ static ssize_t provides_device_sdrs_show(struct device *dev, return snprintf(buf, 10, "%u\n", (id.device_revision & 0x80) >> 7); } -static DEVICE_ATTR(provides_device_sdrs, S_IRUGO, provides_device_sdrs_show, - NULL); +static DEVICE_ATTR_RO(provides_device_sdrs); static ssize_t revision_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -2620,7 +2619,7 @@ static ssize_t revision_show(struct device *dev, struct device_attribute *attr, return snprintf(buf, 20, "%u\n", id.device_revision & 0x0F); } -static DEVICE_ATTR(revision, S_IRUGO, revision_show, NULL); +static DEVICE_ATTR_RO(revision); static ssize_t firmware_revision_show(struct device *dev, struct device_attribute *attr, @@ -2637,7 +2636,7 @@ static ssize_t firmware_revision_show(struct device *dev, return snprintf(buf, 20, "%u.%x\n", id.firmware_revision_1, id.firmware_revision_2); } -static DEVICE_ATTR(firmware_revision, S_IRUGO, firmware_revision_show, NULL); +static DEVICE_ATTR_RO(firmware_revision); static ssize_t ipmi_version_show(struct device *dev, struct device_attribute *attr, @@ -2655,7 +2654,7 @@ static ssize_t ipmi_version_show(struct device *dev, ipmi_version_major(&id), ipmi_version_minor(&id)); } -static DEVICE_ATTR(ipmi_version, S_IRUGO, ipmi_version_show, NULL); +static DEVICE_ATTR_RO(ipmi_version); static ssize_t add_dev_support_show(struct device *dev, struct device_attribute *attr, @@ -2688,7 +2687,7 @@ static ssize_t manufacturer_id_show(struct device *dev, return snprintf(buf, 20, "0x%6.6x\n", id.manufacturer_id); } -static DEVICE_ATTR(manufacturer_id, S_IRUGO, manufacturer_id_show, NULL); +static DEVICE_ATTR_RO(manufacturer_id); static ssize_t product_id_show(struct device *dev, struct device_attribute *attr, @@ -2704,7 +2703,7 @@ static ssize_t product_id_show(struct device *dev, return snprintf(buf, 10, "0x%4.4x\n", id.product_id); } -static DEVICE_ATTR(product_id, S_IRUGO, product_id_show, NULL); +static DEVICE_ATTR_RO(product_id); static ssize_t aux_firmware_rev_show(struct device *dev, struct device_attribute *attr, @@ -2742,7 +2741,7 @@ static ssize_t guid_show(struct device *dev, struct device_attribute *attr, return snprintf(buf, 38, "%pUl\n", guid.b); } -static DEVICE_ATTR(guid, S_IRUGO, guid_show, NULL); +static DEVICE_ATTR_RO(guid); static struct attribute *bmc_dev_attrs[] = { &dev_attr_device_id.attr, |