diff options
author | YueHaibing <yuehaibing@huawei.com> | 2021-05-26 16:10:19 +0200 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2021-07-05 09:23:31 +0200 |
commit | 2060061767c5d3fd5d2477c8cf3407efeeabe8e0 (patch) | |
tree | ad242a3e591a28d64247e77df7abafc1e1a33306 /drivers/xen/pcpu.c | |
parent | Linux 5.13 (diff) | |
download | linux-2060061767c5d3fd5d2477c8cf3407efeeabe8e0.tar.xz linux-2060061767c5d3fd5d2477c8cf3407efeeabe8e0.zip |
xen: Use DEVICE_ATTR_*() macro
Use DEVICE_ATTR_*() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Link: https://lore.kernel.org/r/20210526141019.13752-1-yuehaibing@huawei.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'drivers/xen/pcpu.c')
-rw-r--r-- | drivers/xen/pcpu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/xen/pcpu.c b/drivers/xen/pcpu.c index 1bcdd5227771..47aa3a1ccaf5 100644 --- a/drivers/xen/pcpu.c +++ b/drivers/xen/pcpu.c @@ -92,7 +92,7 @@ static int xen_pcpu_up(uint32_t cpu_id) return HYPERVISOR_platform_op(&op); } -static ssize_t show_online(struct device *dev, +static ssize_t online_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -101,7 +101,7 @@ static ssize_t show_online(struct device *dev, return sprintf(buf, "%u\n", !!(cpu->flags & XEN_PCPU_FLAGS_ONLINE)); } -static ssize_t __ref store_online(struct device *dev, +static ssize_t __ref online_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { @@ -130,7 +130,7 @@ static ssize_t __ref store_online(struct device *dev, ret = count; return ret; } -static DEVICE_ATTR(online, S_IRUGO | S_IWUSR, show_online, store_online); +static DEVICE_ATTR_RW(online); static struct attribute *pcpu_dev_attrs[] = { &dev_attr_online.attr, |