From patchwork Sat Sep 12 09:03:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaokun Zhang X-Patchwork-Id: 11771709 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AC89714F6 for ; Sat, 12 Sep 2020 09:06:18 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 43056214F1 for ; Sat, 12 Sep 2020 09:06:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qqcRh5kd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43056214F1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=hisilicon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=YR8Os+s+hew40Qe4Ze05pVkGsq+VazueR/bn1fyCIsA=; b=qqcRh5kdZPsSRX/zKCIdIc7ppc Jzn2uazt6P1y0Sh1w762M8d4ghq8d1N7j8gRmrsERs3+TLJPi+NRGMbkhs7JNKv5IMexfN6smQG4L DtK/PzS9zvH63za9SM7gp3uYnDBWKRHWdz4nlWAKCcRHk6dPkIhXk7C7pFzIMGDcB/cmBG+l+n68b p5+P1U7qWBOuWoyT/Nmf4S2cl3pD+JUO11aPYtKRRHJPp6cJ1KJKOXaPB+/7i0XbuVLtXHdsJTynV 6IJSer7EezcIflVtYkwy13xAOpDuXTaxKdIZM7x6V591wtkyEaU/NAPWC2asymYbQVb9b/pTrir5i cipGrh9A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kH1Tm-0005mK-Ep; Sat, 12 Sep 2020 09:05:54 +0000 Received: from szxga06-in.huawei.com ([45.249.212.32] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kH1Ti-0005ly-Ap for linux-arm-kernel@lists.infradead.org; Sat, 12 Sep 2020 09:05:51 +0000 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 5246DE139618B6B35F18; Sat, 12 Sep 2020 17:05:40 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Sat, 12 Sep 2020 17:05:33 +0800 From: Shaokun Zhang To: Subject: [PATCH] drivers/perf: hisi: Fix DEVICE_ATTR style tests warning for later PMU driver Date: Sat, 12 Sep 2020 17:03:06 +0800 Message-ID: <1599901386-41601-1-git-send-email-zhangshaokun@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200912_050550_902900_E97AE5F8 X-CRM114-Status: GOOD ( 13.31 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [45.249.212.32 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [45.249.212.32 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Shaokun Zhang , Mark Rutland , Will Deacon , Qi Liu Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Since commit 001804689b0d ("checkpatch: add a few DEVICE_ATTR style tests") has checked DEVICE_ATTR style, let's cleanup the sysfs interface to get rid of the warning for later HiSilicon uncore PMU drivers. Otherwise the warning is throwed by checkpatch.pl for new drivers as follow: WARNING: Consider renaming function(s) 'hisi_cpumask_sysfs_show' to 'cpumask_show' Cc: Will Deacon Cc: Mark Rutland Signed-off-by: Shaokun Zhang Signed-off-by: Qi Liu --- drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_hha_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c | 2 +- drivers/perf/hisilicon/hisi_uncore_pmu.c | 6 +++--- drivers/perf/hisilicon/hisi_uncore_pmu.h | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c index 5e3645c96443..a6305ae8dd79 100644 --- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c @@ -297,7 +297,7 @@ static const struct attribute_group hisi_ddrc_pmu_events_group = { .attrs = hisi_ddrc_pmu_events_attr, }; -static DEVICE_ATTR(cpumask, 0444, hisi_cpumask_sysfs_show, NULL); +static DEVICE_ATTR_RO(cpumask); static struct attribute *hisi_ddrc_pmu_cpumask_attrs[] = { &dev_attr_cpumask.attr, diff --git a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c index 5eb8168029c0..a7fffa3b701f 100644 --- a/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_hha_pmu.c @@ -309,7 +309,7 @@ static const struct attribute_group hisi_hha_pmu_events_group = { .attrs = hisi_hha_pmu_events_attr, }; -static DEVICE_ATTR(cpumask, 0444, hisi_cpumask_sysfs_show, NULL); +static DEVICE_ATTR_RO(cpumask); static struct attribute *hisi_hha_pmu_cpumask_attrs[] = { &dev_attr_cpumask.attr, diff --git a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c index 3e8b5eab5514..dc7dfcec15df 100644 --- a/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_l3c_pmu.c @@ -299,7 +299,7 @@ static const struct attribute_group hisi_l3c_pmu_events_group = { .attrs = hisi_l3c_pmu_events_attr, }; -static DEVICE_ATTR(cpumask, 0444, hisi_cpumask_sysfs_show, NULL); +static DEVICE_ATTR_RO(cpumask); static struct attribute *hisi_l3c_pmu_cpumask_attrs[] = { &dev_attr_cpumask.attr, diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.c b/drivers/perf/hisilicon/hisi_uncore_pmu.c index 97aff877a4e7..e2612a73edf6 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pmu.c +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.c @@ -54,14 +54,14 @@ EXPORT_SYMBOL_GPL(hisi_event_sysfs_show); /* * sysfs cpumask attributes. For uncore PMU, we only have a single CPU to show */ -ssize_t hisi_cpumask_sysfs_show(struct device *dev, - struct device_attribute *attr, char *buf) +ssize_t cpumask_show(struct device *dev, struct device_attribute *attr, + char *buf) { struct hisi_pmu *hisi_pmu = to_hisi_pmu(dev_get_drvdata(dev)); return sprintf(buf, "%d\n", hisi_pmu->on_cpu); } -EXPORT_SYMBOL_GPL(hisi_cpumask_sysfs_show); +EXPORT_SYMBOL_GPL(cpumask_show); static bool hisi_validate_event_group(struct perf_event *event) { diff --git a/drivers/perf/hisilicon/hisi_uncore_pmu.h b/drivers/perf/hisilicon/hisi_uncore_pmu.h index b59ec22169ab..59a16e9d9f70 100644 --- a/drivers/perf/hisilicon/hisi_uncore_pmu.h +++ b/drivers/perf/hisilicon/hisi_uncore_pmu.h @@ -93,8 +93,8 @@ ssize_t hisi_event_sysfs_show(struct device *dev, struct device_attribute *attr, char *buf); ssize_t hisi_format_sysfs_show(struct device *dev, struct device_attribute *attr, char *buf); -ssize_t hisi_cpumask_sysfs_show(struct device *dev, - struct device_attribute *attr, char *buf); +ssize_t cpumask_show(struct device *dev, + struct device_attribute *attr, char *buf); int hisi_uncore_pmu_online_cpu(unsigned int cpu, struct hlist_node *node); int hisi_uncore_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node); #endif /* __HISI_UNCORE_PMU_H__ */