[PATCH] drivers/perf: hisi: Fix DEVICE_ATTR style tests warning for later PMU driver

Will Deacon will at kernel.org
Mon Sep 14 08:29:53 EDT 2020


On Sat, Sep 12, 2020 at 05:03:06PM +0800, Shaokun Zhang wrote:
> 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'

[...]

> 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);

This seems like a colossally bad idea to me.

Will



More information about the linux-arm-kernel mailing list