diff mbox series

[3/6] powerpc/perf:make isa207_pmu_format_group struct static

Message ID 20250422131040.374427-4-maddy@linux.ibm.com (mailing list archive)
State Changes Requested
Headers show
Series Fixes for shellcheck/sparse warnings | expand

Commit Message

Madhavan Srinivasan April 22, 2025, 1:10 p.m. UTC
isa207_pmu_format_group struct is local to the source and does not need to
be in global scope, so make it static

Cleans up sparse warning:
arch/powerpc/perf/isa207-common.c:40:30: warning: symbol 'isa207_pmu_format_group'
was not declared. Should it be static?

Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
---
 arch/powerpc/perf/isa207-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

kernel test robot May 7, 2025, 11:52 a.m. UTC | #1
Hi Madhavan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on powerpc/next]
[also build test WARNING on powerpc/fixes powerpc/topic/ppc-kvm linus/master v6.15-rc5 next-20250507]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Madhavan-Srinivasan/powerpc-kvm-Fix-sparse-warning/20250422-211309
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
patch link:    https://lore.kernel.org/r/20250422131040.374427-4-maddy%40linux.ibm.com
patch subject: [PATCH 3/6] powerpc/perf:make isa207_pmu_format_group struct static
config: powerpc64-randconfig-002-20250424 (https://download.01.org/0day-ci/archive/20250507/202505071909.iZZsdCTI-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250507/202505071909.iZZsdCTI-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505071909.iZZsdCTI-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/powerpc/perf/isa207-common.c:40:37: warning: unused variable 'isa207_pmu_format_group' [-Wunused-const-variable]
      40 | static const struct attribute_group isa207_pmu_format_group = {
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +/isa207_pmu_format_group +40 arch/powerpc/perf/isa207-common.c

    39	
  > 40	static const struct attribute_group isa207_pmu_format_group = {
    41		.name = "format",
    42		.attrs = isa207_pmu_format_attr,
    43	};
    44
diff mbox series

Patch

diff --git a/arch/powerpc/perf/isa207-common.c b/arch/powerpc/perf/isa207-common.c
index 2b3547fdba4a..bbef51849f33 100644
--- a/arch/powerpc/perf/isa207-common.c
+++ b/arch/powerpc/perf/isa207-common.c
@@ -37,7 +37,7 @@  static struct attribute *isa207_pmu_format_attr[] = {
 	NULL,
 };
 
-const struct attribute_group isa207_pmu_format_group = {
+static const struct attribute_group isa207_pmu_format_group = {
 	.name = "format",
 	.attrs = isa207_pmu_format_attr,
 };