Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp96908pxj; Thu, 27 May 2021 22:32:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+/c2nI+5W/u53Gon49P0RLKoCxcQ6AwmA+HJIuuagID3TBzLMoqmiPr0oocoakXU3NwwD X-Received: by 2002:a17:906:6a93:: with SMTP id p19mr7434481ejr.319.1622179965756; Thu, 27 May 2021 22:32:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622179965; cv=none; d=google.com; s=arc-20160816; b=EDLUtmUtfuSsExVDy6UH3ItXNnFtSa5IrzwrFzj2I/Fei8vY/R40/DZrUbCbJCBvla nw2FPaVgqsQuH8vDJ6p17+lZNTdnoCCUHJclOrkPhu/blOqYs7qrAf/VXwGRqTkZPVjJ S6piQPay+EOXmHaiIVfeB4AtnIl8QJxXms9X9bVdpC182vwWal71VdJ4DY3gU13r4vQN UiPqq++uLcl7bvbG90wIYoQx8UYUL699geGNHpWjg87NDbuVAhE8Ch7Lc/kBA53CDGAC WFlfvxKlA1Nqo7XyS+RioQB1CSO5FOHzaxafzA8YePkPyhh2PLE7Y3cQPnj/HQ37qSGx JSNw== 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=tLunD2QjOOZOseHOU3NTShn5Pl6z/1aIAmZ8T+xIe8s=; b=NKzKC8c+zM55pteUnJjXkQdq2bWHrXLz/C+ALqE6gtl1y8Fdz3NTu+LMhEVhWeULDF ozXx/GtCE9fABoMMRAGuBaz9fcnapyVfoMYxk8WzSlTjOh/pOdEBPMZBnSx5OfrKrvW5 XvzZokwUIBSVxiosfitUFdWEIn26UwhmpHDBqDaB636Ilh1rp8kAX90AeJ5zLgrhN+NR ZRGka+9GETu1B4HpdubQff1hcNtgLoj3fLj0XJvF1m1fRO6wO6H+N1wNlIGTVAmVKpa+ XuM4rnVxZ56tXNYH2U/23G1lvbOzkxgcDvPRz4c+Z3S4p0HfTR9TH6KbGdu5ZJvm02VM Q2fQ== 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 b24si3839587edt.411.2021.05.27.22.32.22; Thu, 27 May 2021 22:32:45 -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 S234265AbhE1Btn (ORCPT + 99 others); Thu, 27 May 2021 21:49:43 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:2381 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229749AbhE1Btn (ORCPT ); Thu, 27 May 2021 21:49:43 -0400 Received: from dggeml756-chm.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4FrnY80bdKz66Np; Fri, 28 May 2021 09:44:28 +0800 (CST) Received: from dggema769-chm.china.huawei.com (10.1.198.211) by dggeml756-chm.china.huawei.com (10.1.199.158) 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:48:06 +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:48:06 +0800 From: YueHaibing To: , , , CC: , , , YueHaibing Subject: [PATCH -next] perf: qcom: use DEVICE_ATTR_RO macro Date: Fri, 28 May 2021 09:47:49 +0800 Message-ID: <20210528014749.24068-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: dggems703-chm.china.huawei.com (10.3.19.180) 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/qcom_l3_pmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/perf/qcom_l3_pmu.c b/drivers/perf/qcom_l3_pmu.c index bba078077c93..081273543c6b 100644 --- a/drivers/perf/qcom_l3_pmu.c +++ b/drivers/perf/qcom_l3_pmu.c @@ -670,15 +670,15 @@ static const struct attribute_group qcom_l3_cache_pmu_events_group = { /* cpumask */ -static ssize_t qcom_l3_cache_pmu_cpumask_show(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t cpumask_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct l3cache_pmu *l3pmu = to_l3cache_pmu(dev_get_drvdata(dev)); return cpumap_print_to_pagebuf(true, buf, &l3pmu->cpumask); } -static DEVICE_ATTR(cpumask, 0444, qcom_l3_cache_pmu_cpumask_show, NULL); +static DEVICE_ATTR_RO(cpumask); static struct attribute *qcom_l3_cache_pmu_cpumask_attrs[] = { &dev_attr_cpumask.attr, -- 2.17.1