From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Alex Deucher <alexander.deucher@amd.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org,
"Christian König" <christian.koenig@amd.com>,
amd-gfx@lists.freedesktop.org
Subject: [kbuild] drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292 gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 bit type?
Date: Fri, 27 May 2022 13:45:34 +0300 [thread overview]
Message-ID: <202205271813.mDvYkTtW-lkp@intel.com> (raw)
[ I sent this mail on May 9 but didn't hear back. I'm not sure why
kbuild is sending duplicates but it's probably a good thing. -dan ]
Hi Alex,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7e284070abe53d448517b80493863595af4ab5f0
commit: 98bae89647603309ca2a5f172299ecc31c5d2db0 drm/amdgpu/gfx11: remove some register fields that no longer exist
config: arc-randconfig-m031-20220524 (https://download.01.org/0day-ci/archive/20220527/202205271813.mDvYkTtW-lkp@intel.com/config )
compiler: arceb-elf-gcc (GCC) 11.3.0
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c:1292 gfx_v11_0_rlc_backdoor_autoload_copy_ucode() warn: should '1 << id' be a 64 bit type?
vim +1292 drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
3d879e81f0f9ed Hawking Zhang 2022-04-13 1264 static void gfx_v11_0_rlc_backdoor_autoload_copy_ucode(struct amdgpu_device *adev,
3d879e81f0f9ed Hawking Zhang 2022-04-13 1265 SOC21_FIRMWARE_ID id,
3d879e81f0f9ed Hawking Zhang 2022-04-13 1266 const void *fw_data,
3d879e81f0f9ed Hawking Zhang 2022-04-13 1267 uint32_t fw_size,
3d879e81f0f9ed Hawking Zhang 2022-04-13 1268 uint32_t *fw_autoload_mask)
3d879e81f0f9ed Hawking Zhang 2022-04-13 1269 {
3d879e81f0f9ed Hawking Zhang 2022-04-13 1270 uint32_t toc_offset;
3d879e81f0f9ed Hawking Zhang 2022-04-13 1271 uint32_t toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13 1272 char *ptr = adev->gfx.rlc.rlc_autoload_ptr;
3d879e81f0f9ed Hawking Zhang 2022-04-13 1273
3d879e81f0f9ed Hawking Zhang 2022-04-13 1274 if (id <= SOC21_FIRMWARE_ID_INVALID || id >= SOC21_FIRMWARE_ID_MAX)
3d879e81f0f9ed Hawking Zhang 2022-04-13 1275 return;
3d879e81f0f9ed Hawking Zhang 2022-04-13 1276
3d879e81f0f9ed Hawking Zhang 2022-04-13 1277 toc_offset = rlc_autoload_info[id].offset;
3d879e81f0f9ed Hawking Zhang 2022-04-13 1278 toc_fw_size = rlc_autoload_info[id].size;
3d879e81f0f9ed Hawking Zhang 2022-04-13 1279
3d879e81f0f9ed Hawking Zhang 2022-04-13 1280 if (fw_size == 0)
3d879e81f0f9ed Hawking Zhang 2022-04-13 1281 fw_size = toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13 1282
3d879e81f0f9ed Hawking Zhang 2022-04-13 1283 if (fw_size > toc_fw_size)
3d879e81f0f9ed Hawking Zhang 2022-04-13 1284 fw_size = toc_fw_size;
3d879e81f0f9ed Hawking Zhang 2022-04-13 1285
3d879e81f0f9ed Hawking Zhang 2022-04-13 1286 memcpy(ptr + toc_offset, fw_data, fw_size);
3d879e81f0f9ed Hawking Zhang 2022-04-13 1287
3d879e81f0f9ed Hawking Zhang 2022-04-13 1288 if (fw_size < toc_fw_size)
3d879e81f0f9ed Hawking Zhang 2022-04-13 1289 memset(ptr + toc_offset + fw_size, 0, toc_fw_size - fw_size);
3d879e81f0f9ed Hawking Zhang 2022-04-13 1290
3d879e81f0f9ed Hawking Zhang 2022-04-13 1291 if ((id != SOC21_FIRMWARE_ID_RS64_PFP) && (id != SOC21_FIRMWARE_ID_RS64_ME))
3d879e81f0f9ed Hawking Zhang 2022-04-13 @1292 *(uint64_t *)fw_autoload_mask |= 1 << id;
^^^^^^^
"id" can be more than 31 so it needs to BIT_ULL(id) or 1ULL << id.
3d879e81f0f9ed Hawking Zhang 2022-04-13 1293 }
--
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- kbuild@lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org
reply other threads:[~2022-05-27 10:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202205271813.mDvYkTtW-lkp@intel.com \
--to=dan.carpenter@oracle.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
/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®