Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5265522pxj; Wed, 26 May 2021 06:46:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhHl0761r/+ZtIV84MCQW7g0mBhroCEBXgeMKCIktTnCd3bUskHzJCjCAMB0uiHgvlea8w X-Received: by 2002:a02:9443:: with SMTP id a61mr3282048jai.60.1622036787995; Wed, 26 May 2021 06:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622036787; cv=none; d=google.com; s=arc-20160816; b=P+JnQl30QfXfbTqfFZSImyMKgGJPngknFAu9Emd9X+Sq0G5qGLLLyOJD5UcZh4nwVc ggCjLirDS9hfiLfn1W2S3Voi6RSNtioC95U/P1i7+DRU+KbO7vIT91jH+npXFw7mcVhY 9ilVfgqXKudg2HKV66n9nAlE+tsHWTpfAWeNS1OoO/ws4NE7nETjP/yfzoHDTWwjCy44 EfJrmpkdy4O7dvuLzLRjLQoO00M9bUAchjcttwcfQKGFPmln2Rq2sEtmqG0gbNC1JawA 0kqKGQi5Te4F2LIekn8jXll5fhsyBz3Pl0/ySS6kIuijDxVQvkDLFRFJLKWla8++gBWc XvYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=o2YpBz8CAYUzWNvDLkw3bMM6ZibNF1Z1qLw+PbAnoKo=; b=oY5i5SBPI4HXMmh1fYd1snbit43IdQYMXO7Lax/6OtgpNs/Ry0fIt1KTCoTyxa6Fi+ iWZ1jVt7j9pl0NlSfawlfna/rY0KReSHZhPFrG1QYZBtaZZgsGQn9WkrYK9KRktQfaWy +HCrQhgvptQNjsTKkWqrqT0uM9gujxTRiq0obJ+f87zLtp4C6YysMLGwGrMxwZ2b/zNu kcpZoUMLWNwirz03xnvm1gytC9Co9dStHpm8Ani4N1pgDmVOskLKola9Axhga+iZOk6r o1HffTpq2TiILVY4zmXPa06M9pydaQw6G7hcagpwv7XzUzXhR+8MzrU4N+Pzna9QoQe6 UcTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i5si23119298iow.84.2021.05.26.06.46.14; Wed, 26 May 2021 06:46:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233836AbhEZNb0 (ORCPT + 99 others); Wed, 26 May 2021 09:31:26 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6717 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232139AbhEZNbZ (ORCPT ); Wed, 26 May 2021 09:31:25 -0400 Received: from dggems702-chm.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FqsCp3kmBzncTW; Wed, 26 May 2021 21:26:14 +0800 (CST) Received: from dggema769-chm.china.huawei.com (10.1.198.211) by dggems702-chm.china.huawei.com (10.3.19.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Wed, 26 May 2021 21:29:51 +0800 Received: from localhost (10.174.179.215) by dggema769-chm.china.huawei.com (10.1.198.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 26 May 2021 21:29:51 +0800 From: YueHaibing To: , , CC: , , YueHaibing Subject: [PATCH -next] RDMA/core: use DEVICE_ATTR_RO macro Date: Wed, 26 May 2021 21:29:49 +0800 Message-ID: <20210526132949.20184-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.179.215] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggema769-chm.china.huawei.com (10.1.198.211) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEVICE_ATTR_RO() helper instead of plain DEVICE_ATTR(), which makes the code a bit shorter and easier to read. Signed-off-by: YueHaibing --- drivers/infiniband/core/ucma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index 1f198c180aa1..74144e513dc7 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c @@ -1830,13 +1830,13 @@ static struct ib_client rdma_cma_client = { }; MODULE_ALIAS_RDMA_CLIENT("rdma_cm"); -static ssize_t show_abi_version(struct device *dev, +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) { -- 2.17.1