[cxl-cxl:pending 10/11] drivers/cxl/pci.c:1302:34: sparse: sparse: cast to restricted __le64
From: kernel test robot
Date: Mon Aug 09 2021 - 23:11:18 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git pending
head: 427832674f6e2413c21ca2271ec945a720608ff2
commit: f2e82407d7df984ef4369bd9a8cf749991db87a0 [10/11] cxl/mem: Account for partitionable space in ram/pmem ranges
config: i386-randconfig-s002-20210809 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-348-gf0e6938b-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git/commit/?id=f2e82407d7df984ef4369bd9a8cf749991db87a0
git remote add cxl-cxl https://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl.git
git fetch --no-tags cxl-cxl pending
git checkout f2e82407d7df984ef4369bd9a8cf749991db87a0
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/cxl/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
sparse warnings: (new ones prefixed by >>)
>> drivers/cxl/pci.c:1302:34: sparse: sparse: cast to restricted __le64
drivers/cxl/pci.c:1303:36: sparse: sparse: cast to restricted __le64
drivers/cxl/pci.c:1304:32: sparse: sparse: cast to restricted __le64
drivers/cxl/pci.c:1305:34: sparse: sparse: cast to restricted __le64
vim +1302 drivers/cxl/pci.c
1265
1266 /**
1267 * cxl_mem_get_partition_info - Get partition info
1268 * @cxlm: The device to act on
1269 * @active_volatile_bytes: returned active volatile capacity; in bytes
1270 * @active_persistent_bytes: returned active persistent capacity; in bytes
1271 * @next_volatile_bytes: return next volatile capacity; in bytes
1272 * @next_persistent_bytes: return next persistent capacity; in bytes
1273 *
1274 * Retrieve the current partition info for the device specified. The active
1275 * values are the current capacity in bytes. If not 0, the 'next' values are
1276 * the pending values, in bytes, which take affect on next cold reset.
1277 *
1278 * Return: 0 if no error: or the result of the mailbox command.
1279 *
1280 * See CXL @8.2.9.5.2.1 Get Partition Info
1281 */
1282 static int cxl_mem_get_partition_info(struct cxl_mem *cxlm,
1283 u64 *active_volatile_bytes,
1284 u64 *active_persistent_bytes,
1285 u64 *next_volatile_bytes,
1286 u64 *next_persistent_bytes)
1287 {
1288 struct cxl_mbox_get_partition_info {
1289 u64 active_volatile_cap;
1290 u64 active_persistent_cap;
1291 u64 next_volatile_cap;
1292 u64 next_persistent_cap;
1293 } __packed pi;
1294 int rc;
1295
1296 rc = cxl_mem_mbox_send_cmd(cxlm, CXL_MBOX_OP_GET_PARTITION_INFO,
1297 NULL, 0, &pi, sizeof(pi));
1298
1299 if (rc)
1300 return rc;
1301
> 1302 *active_volatile_bytes = le64_to_cpu(pi.active_volatile_cap);
1303 *active_persistent_bytes = le64_to_cpu(pi.active_persistent_cap);
1304 *next_volatile_bytes = le64_to_cpu(pi.next_volatile_cap);
1305 *next_persistent_bytes = le64_to_cpu(pi.next_volatile_cap);
1306
1307 *active_volatile_bytes *= CXL_CAPACITY_MULTIPLIER;
1308 *active_persistent_bytes *= CXL_CAPACITY_MULTIPLIER;
1309 *next_volatile_bytes *= CXL_CAPACITY_MULTIPLIER;
1310 *next_persistent_bytes *= CXL_CAPACITY_MULTIPLIER;
1311
1312 return 0;
1313 }
1314
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip