From: kernel test robot <lkp@intel.com>
To: Lijo Lazar <lijo.lazar@amd.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Alex Deucher <alexander.deucher@amd.com>,
Asad Kamal <asad.kamal@amd.com>
Subject: 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 ))
Date: Tue, 21 Jul 2026 07:47:17 +0800 [thread overview]
Message-ID: <202607210737.OeGpY3kI-lkp@intel.com> (raw)
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
next reply other threads:[~2026-07-20 23:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 23:47 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-07-18 11:11 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202607210737.OeGpY3kI-lkp@intel.com \
--to=lkp@intel.com \
--cc=alexander.deucher@amd.com \
--cc=asad.kamal@amd.com \
--cc=lijo.lazar@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®