Re: [PATCH] coresight: tmc: mark coresight_tmc_groups with static
From: Mathieu Poirier
Date: Mon May 11 2020 - 12:46:52 EST
Hi Chunyan,
On Fri, May 08, 2020 at 05:13:40PM +0800, Chunyan Zhang wrote:
> From: Chunyan Zhang <chunyan.zhang@xxxxxxxxxx>
>
> Sparse reports a warning like:
> drivers/hwtracing/coresight/coresight-tmc.c:364:30: warning: symbol
> 'coresight_tmc_groups' was not declared. Should it be static? [sparse]
>
> coresight_tmc_groups is used in the local file only, so it should be
> marked with static.
>
> Signed-off-by: Chunyan Zhang <chunyan.zhang@xxxxxxxxxx>
> ---
> drivers/hwtracing/coresight/coresight-tmc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-tmc.c b/drivers/hwtracing/coresight/coresight-tmc.c
> index 1cf82fa..39fba1d 100644
> --- a/drivers/hwtracing/coresight/coresight-tmc.c
> +++ b/drivers/hwtracing/coresight/coresight-tmc.c
> @@ -361,7 +361,7 @@ static ssize_t buffer_size_store(struct device *dev,
> .name = "mgmt",
> };
>
> -const struct attribute_group *coresight_tmc_groups[] = {
> +static const struct attribute_group *coresight_tmc_groups[] = {
This has already been addressed by Stephen [1] earlier in this cycle. It is
currently in linux-next and will be submitted for inclusion in the next cycle.
Thanks,
Mathieu
[1]. https://www.spinics.net/lists/arm-kernel/msg801714.html
> &coresight_tmc_group,
> &coresight_tmc_mgmt_group,
> NULL,
> --
> 1.9.1
>