summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/ucma.c
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2021-05-26 15:29:49 +0200
committerJason Gunthorpe <jgg@nvidia.com>2021-05-29 01:39:51 +0200
commitc5b8eaf8afd8c2711233a344a5e2e8e4aa562301 (patch)
tree7ba9326ef8a3792e57a8084b2d314156a5f2b3ab /drivers/infiniband/core/ucma.c
parentIB/ipoib: Use DEVICE_ATTR_*() macros (diff)
downloadlinux-c5b8eaf8afd8c2711233a344a5e2e8e4aa562301.tar.xz
linux-c5b8eaf8afd8c2711233a344a5e2e8e4aa562301.zip
RDMA/core: Use the DEVICE_ATTR_RO macro
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>
Diffstat (limited to 'drivers/infiniband/core/ucma.c')
-rw-r--r--drivers/infiniband/core/ucma.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
index 1f198c180aa1..2b72c4fa9550 100644
--- 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)
{