mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c:920:3-56: opportunity for str_enabled_disabled(smu_feature_bits_is_set ( & feature_mask , feature_index ))
@ 2026-07-20 23:47 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-07-20 23:47 UTC (permalink / raw)
  To: Lijo Lazar; +Cc: oe-kbuild-all, linux-kernel, Alex Deucher, Asad Kamal

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b95f03f04d475aa6719d15a636ddf32222d55657
commit: 7b88453a476c9770c094c1f596e0b9fee208e65b drm/amd/pm: Change get_enabled_mask signature
date:   6 months ago
config: powerpc64-randconfig-r064-20260716 (https://download.01.org/0day-ci/archive/20260721/202607210737.OeGpY3kI-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project b3e6e6dabdc02153552a64fc74ff5c7532447eed)

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
| Fixes: 7b88453a476c ("drm/amd/pm: Change get_enabled_mask signature")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202607210737.OeGpY3kI-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c:920:3-56: opportunity for str_enabled_disabled(smu_feature_bits_is_set ( & feature_mask , feature_index ))

vim +920 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c

   878	
   879	size_t smu_cmn_get_pp_feature_mask(struct smu_context *smu,
   880					   char *buf)
   881	{
   882		int8_t sort_feature[MAX(SMU_FEATURE_COUNT, SMU_FEATURE_MAX)];
   883		struct smu_feature_bits feature_mask;
   884		uint32_t features[2];
   885		int i, feature_index;
   886		uint32_t count = 0;
   887		size_t size = 0;
   888	
   889		if (__smu_get_enabled_features(smu, &feature_mask))
   890			return 0;
   891	
   892		/* TBD: Need to handle for > 64 bits */
   893		smu_feature_bits_to_arr32(&feature_mask, features, 64);
   894		size = sysfs_emit_at(buf, size, "features high: 0x%08x low: 0x%08x\n",
   895				     features[1], features[0]);
   896	
   897		memset(sort_feature, -1, sizeof(sort_feature));
   898	
   899		for (i = 0; i < SMU_FEATURE_COUNT; i++) {
   900			feature_index = smu_cmn_to_asic_specific_index(smu,
   901								       CMN2ASIC_MAPPING_FEATURE,
   902								       i);
   903			if (feature_index < 0)
   904				continue;
   905	
   906			sort_feature[feature_index] = i;
   907		}
   908	
   909		size += sysfs_emit_at(buf, size, "%-2s. %-20s  %-3s : %-s\n",
   910				"No", "Feature", "Bit", "State");
   911	
   912		for (feature_index = 0; feature_index < SMU_FEATURE_MAX; feature_index++) {
   913			if (sort_feature[feature_index] < 0)
   914				continue;
   915	
   916			size += sysfs_emit_at(
   917				buf, size, "%02d. %-20s (%2d) : %s\n", count++,
   918				smu_get_feature_name(smu, sort_feature[feature_index]),
   919				feature_index,
 > 920				smu_feature_bits_is_set(&feature_mask, feature_index) ?
   921					"enabled" :
   922					"disabled");
   923		}
   924	
   925		return size;
   926	}
   927	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread
* drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c:920:3-56: opportunity for str_enabled_disabled(smu_feature_bits_is_set ( & feature_mask , feature_index ))
@ 2026-07-18 11:11 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-07-18 11:11 UTC (permalink / raw)
  To: Lijo Lazar; +Cc: oe-kbuild-all, linux-kernel, Alex Deucher, Asad Kamal

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   94515f3a7d4256a5062176b7d6ed0471938cd51a
commit: 7b88453a476c9770c094c1f596e0b9fee208e65b drm/amd/pm: Change get_enabled_mask signature
date:   6 months ago
config: powerpc64-randconfig-r064-20260716 (https://download.01.org/0day-ci/archive/20260718/202607181846.NyQe3GrQ-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project b3e6e6dabdc02153552a64fc74ff5c7532447eed)

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
| Fixes: 7b88453a476c ("drm/amd/pm: Change get_enabled_mask signature")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202607181846.NyQe3GrQ-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c:920:3-56: opportunity for str_enabled_disabled(smu_feature_bits_is_set ( & feature_mask , feature_index ))

vim +920 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c

   878	
   879	size_t smu_cmn_get_pp_feature_mask(struct smu_context *smu,
   880					   char *buf)
   881	{
   882		int8_t sort_feature[MAX(SMU_FEATURE_COUNT, SMU_FEATURE_MAX)];
   883		struct smu_feature_bits feature_mask;
   884		uint32_t features[2];
   885		int i, feature_index;
   886		uint32_t count = 0;
   887		size_t size = 0;
   888	
   889		if (__smu_get_enabled_features(smu, &feature_mask))
   890			return 0;
   891	
   892		/* TBD: Need to handle for > 64 bits */
   893		smu_feature_bits_to_arr32(&feature_mask, features, 64);
   894		size = sysfs_emit_at(buf, size, "features high: 0x%08x low: 0x%08x\n",
   895				     features[1], features[0]);
   896	
   897		memset(sort_feature, -1, sizeof(sort_feature));
   898	
   899		for (i = 0; i < SMU_FEATURE_COUNT; i++) {
   900			feature_index = smu_cmn_to_asic_specific_index(smu,
   901								       CMN2ASIC_MAPPING_FEATURE,
   902								       i);
   903			if (feature_index < 0)
   904				continue;
   905	
   906			sort_feature[feature_index] = i;
   907		}
   908	
   909		size += sysfs_emit_at(buf, size, "%-2s. %-20s  %-3s : %-s\n",
   910				"No", "Feature", "Bit", "State");
   911	
   912		for (feature_index = 0; feature_index < SMU_FEATURE_MAX; feature_index++) {
   913			if (sort_feature[feature_index] < 0)
   914				continue;
   915	
   916			size += sysfs_emit_at(
   917				buf, size, "%02d. %-20s (%2d) : %s\n", count++,
   918				smu_get_feature_name(smu, sort_feature[feature_index]),
   919				feature_index,
 > 920				smu_feature_bits_is_set(&feature_mask, feature_index) ?
   921					"enabled" :
   922					"disabled");
   923		}
   924	
   925		return size;
   926	}
   927	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-20 23:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-20 23:47 drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c:920:3-56: opportunity for str_enabled_disabled(smu_feature_bits_is_set ( & feature_mask , feature_index )) kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-07-18 11:11 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®