Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp92961pxj; Thu, 27 May 2021 22:24:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqdaBtMXwqXkYeGFkE78dSgxtIP5mj8Z0Ne+iIKPHG+xPN+Orskr28TP2qBhWit607aXve X-Received: by 2002:a05:6e02:2149:: with SMTP id d9mr5737704ilv.162.1622179499634; Thu, 27 May 2021 22:24:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622179499; cv=none; d=google.com; s=arc-20160816; b=xGyiINh+Fy564+ZzJvZdubhz3kuHj2CyoxfwGpOAAUMlL3QYyPVOVHBfwxuRSkfMO9 XhzIhHliS5ywj1rjC8UVezCS16vjpG5OqZ4n6iMRSzX1EVYIeu4R8hxm2p/DzAfg2jGR SwjtmIp8HR2qLYtTagoqIDiY4nWFJWGBppeijl6Wio25mFdQwDSeY/tf5f4n+wCZ20Wb w8u9b3aNhu1/W7pfoL8CKvDaq1MK21eW2BZfUSjsqCaCdQxtzE0/CsHDU9NuZ+x6wHKC yDNb1hhGOk+ck4fP+LWV1n4tplYGhzembqacimHJdcRElFhvp2ASI+qJ9Ok1cmUrwgQ6 Xl8g== 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=LCzE0NlG5jJ0puTEg7YzO4UAqz77ULeyF5TsppNYfkU=; b=zCEe0Em/U4bSQ0NazD/SCsuxgIr+qya9Gj9oqRcERcPy2iu6cgghzr2uU2hyhbnfwl gC6drWl/T6fR+WGj33iTZ94t0Wx5Y7Q/7l4r8+FhGZWy1xQQen/JMI53CXZav96sMtuJ pmQFqduhOZJ2klBaOIPIFU2OsXzjRgIIAhdj+6VDGMF5UlK2UmxhsKOoln/9c5GY8aor xD6nQxEuMjIG2l03lLjCIi5tOZGAYquMeOVJyky+SUtbOSBPQpiRQPZPowZ3dusLvY6k V872XacxLXuMGrkfGSzo+zWXIBuIGRpJKB1EhN3wHiRLRbWeUii/dqFiq+8etePE9xmu 3Q6g== 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 n9si4457402jaj.15.2021.05.27.22.24.45; Thu, 27 May 2021 22:24:59 -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 S233477AbhE1BnM (ORCPT + 99 others); Thu, 27 May 2021 21:43:12 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:2067 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233253AbhE1BnM (ORCPT ); Thu, 27 May 2021 21:43:12 -0400 Received: from dggeml715-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4FrnNX74sVzWnqr; Fri, 28 May 2021 09:37:00 +0800 (CST) Received: from dggema769-chm.china.huawei.com (10.1.198.211) by dggeml715-chm.china.huawei.com (10.3.17.126) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 28 May 2021 09:41:36 +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; Fri, 28 May 2021 09:41:36 +0800 From: YueHaibing To: , , CC: , , YueHaibing Subject: [PATCH -next] perf: arm_pmu: use DEVICE_ATTR_RO macro Date: Fri, 28 May 2021 09:41:30 +0800 Message-ID: <20210528014130.7708-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: dggems704-chm.china.huawei.com (10.3.19.181) 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/perf/arm_pmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index e57b348c1628..a64e254a731b 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -563,14 +563,14 @@ static int armpmu_filter_match(struct perf_event *event) return ret; } -static ssize_t armpmu_cpumask_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t cpus_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct arm_pmu *armpmu = to_arm_pmu(dev_get_drvdata(dev)); return cpumap_print_to_pagebuf(true, buf, &armpmu->supported_cpus); } -static DEVICE_ATTR(cpus, S_IRUGO, armpmu_cpumask_show, NULL); +static DEVICE_ATTR_RO(cpus); static struct attribute *armpmu_common_attrs[] = { &dev_attr_cpus.attr, -- 2.17.1