projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f8f60f
)
RDMA/core: Use the DEVICE_ATTR_RO macro
author
YueHaibing
<yuehaibing@huawei.com>
Wed, 26 May 2021 13:29:49 +0000
(21:29 +0800)
committer
Jason Gunthorpe
<jgg@nvidia.com>
Fri, 28 May 2021 23:39:51 +0000
(20:39 -0300)
Use the DEVICE_ATTR_RO() helper instead of plain DEVICE_ATTR(), which
makes the code a bit shorter and easier to read.
Link:
https://lore.kernel.org/r/20210526132949.20184-1-yuehaibing@huawei.com
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/ucma.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/core/ucma.c
b/drivers/infiniband/core/ucma.c
index
1f198c1
..
2b72c4f
100644
(file)
--- a/
drivers/infiniband/core/ucma.c
+++ b/
drivers/infiniband/core/ucma.c
@@
-1830,13
+1830,12
@@
static struct ib_client rdma_cma_client = {
};
MODULE_ALIAS_RDMA_CLIENT("rdma_cm");
-static ssize_t show_abi_version(struct device *dev,
- struct device_attribute *attr,
- char *buf)
+static ssize_t abi_version_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
return sysfs_emit(buf, "%d\n", RDMA_USER_CM_ABI_VERSION);
}
-static DEVICE_ATTR
(abi_version, S_IRUGO, show_abi_version, NULL
);
+static DEVICE_ATTR
_RO(abi_version
);
static int __init ucma_init(void)
{