Skip to contentSkip to conversation

coresight: tmc: mark coresight_tmc_groups with static

PATCH In review Chunyan Zhang 2 participants 3 messages May 8, 2020 – May 12, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 coresight: tmc: mark coresight_tmc_groups with static

From: Chunyan Zhang <[email protected]>

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.

---
 drivers/hwtracing/coresight/coresight-tmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-tmc.c +1 -1
index 1cf82fa..39fba1d 100644
@@ -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[] = {
 	&coresight_tmc_group,
 	&coresight_tmc_mgmt_group,
 	NULL,
Signature · 1 line
1.9.1
#1 lore raw

Hi Chunyan,

Quoted 19 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

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.

---
 drivers/hwtracing/coresight/coresight-tmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-tmc.c +0 -0
index 1cf82fa..39fba1d 100644

drivers/hwtracing/coresight/coresight-tmc.c static ssize_t buffer_size_store(struct device *dev, · line 364

Quoted 5 lines
drivers/hwtracing/coresight/coresight-tmc.c +1 -1
@@ -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

Quoted 6 lines
drivers/hwtracing/coresight/coresight-tmc.c +0 -0
 	&coresight_tmc_group,
 	&coresight_tmc_mgmt_group,
 	NULL,
Signature · 1 line
1.9.1
#2 lore raw
Quoted 32 lines · Mathieu Poirier

Hi Chunyan,

Quoted 19 lines · Chunyan Zhang

From: Chunyan Zhang <[email protected]>

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.

---
 drivers/hwtracing/coresight/coresight-tmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-tmc.c +0 -0
index 1cf82fa..39fba1d 100644

drivers/hwtracing/coresight/coresight-tmc.c static ssize_t buffer_size_store(struct device *dev, · line 364

Quoted 5 lines
drivers/hwtracing/coresight/coresight-tmc.c +1 -1
@@ -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.

Quoted 4 lines

Thanks,
Mathieu

[1]. https://www.spinics.net/lists/arm-kernel/msg801714.html

It is better, I will backport this patch。

Thanks Mathieu!

Quoted 7 lines
Quoted 7 lines
drivers/hwtracing/coresight/coresight-tmc.c +0 -1
      &coresight_tmc_group,
      &coresight_tmc_mgmt_group,
      NULL,
--

1.9.1

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel