CC: [email protected] BCC: [email protected] CC: [email protected] TO: Christoph Hellwig <[email protected]> CC: Jens Axboe <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 30c8e80f79329617012f07b09b70114592092ea4 commit: e4a19f7289f3fa9b2a4e65d0f4b3a7816e8e445b block: don't include blk-mq.h in blk.h date: 5 months ago :::::: branch date: 3 hours ago :::::: commit date: 5 months ago compiler: alpha-linux-gcc (GCC) 11.3.0 reproduce (cppcheck warning): # apt-get install cppcheck git checkout e4a19f7289f3fa9b2a4e65d0f4b3a7816e8e445b cppcheck --quiet --enable=style,performance,portability --template=gcc FILE If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> cppcheck warnings: (new ones prefixed by >>) >> block/blk-throttle.c:1470:3: warning: %llu in format string (no. 1) requires >> 'unsigned long long' but the argument type is 'unsigned long'. >> [invalidPrintfArgType_uint] snprintf(bufs[0], sizeof(bufs[0]), "%llu", ^ block/blk-throttle.c:1473:3: warning: %llu in format string (no. 1) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint] snprintf(bufs[1], sizeof(bufs[1]), "%llu", ^ cppcheck possible warnings: (new ones prefixed by >>, may not real problems) >> block/blk-throttle.c:1470:3: warning: %llu in format string (no. 1) requires >> 'unsigned long long' but the argument type is 'unsigned long'. >> [invalidPrintfArgType_uint] snprintf(bufs[0], sizeof(bufs[0]), "%llu", ^ block/blk-throttle.c:1473:3: warning: %llu in format string (no. 1) requires 'unsigned long long' but the argument type is 'unsigned long'. [invalidPrintfArgType_uint] snprintf(bufs[1], sizeof(bufs[1]), "%llu", ^ >> block/blk-throttle.c:1767:21: warning: Parameter 'this_tg' can be declared >> with const [constParameter] struct throtl_grp *this_tg) ^ vim +1470 block/blk-throttle.c 60c2bc2d5a1236 Tejun Heo 2012-04-01 1437 cd5ab1b0fcb44a Shaohua Li 2017-03-27 1438 static u64 tg_prfill_limit(struct seq_file *sf, struct blkg_policy_data *pd, 2ee867dcfa2eae Tejun Heo 2015-08-18 1439 int off) 2ee867dcfa2eae Tejun Heo 2015-08-18 1440 { 2ee867dcfa2eae Tejun Heo 2015-08-18 1441 struct throtl_grp *tg = pd_to_tg(pd); 2ee867dcfa2eae Tejun Heo 2015-08-18 1442 const char *dname = blkg_dev_name(pd->blkg); 2ee867dcfa2eae Tejun Heo 2015-08-18 1443 char bufs[4][21] = { "max", "max", "max", "max" }; cd5ab1b0fcb44a Shaohua Li 2017-03-27 1444 u64 bps_dft; cd5ab1b0fcb44a Shaohua Li 2017-03-27 1445 unsigned int iops_dft; ada75b6e5b2a93 Shaohua Li 2017-03-27 1446 char idle_time[26] = ""; ec80991d6fc2cb Shaohua Li 2017-03-27 1447 char latency_time[26] = ""; 2ee867dcfa2eae Tejun Heo 2015-08-18 1448 2ee867dcfa2eae Tejun Heo 2015-08-18 1449 if (!dname) 2ee867dcfa2eae Tejun Heo 2015-08-18 1450 return 0; 9f626e372a6024 Shaohua Li 2017-03-27 1451 cd5ab1b0fcb44a Shaohua Li 2017-03-27 1452 if (off == LIMIT_LOW) { cd5ab1b0fcb44a Shaohua Li 2017-03-27 1453 bps_dft = 0; cd5ab1b0fcb44a Shaohua Li 2017-03-27 1454 iops_dft = 0; cd5ab1b0fcb44a Shaohua Li 2017-03-27 1455 } else { cd5ab1b0fcb44a Shaohua Li 2017-03-27 1456 bps_dft = U64_MAX; cd5ab1b0fcb44a Shaohua Li 2017-03-27 1457 iops_dft = UINT_MAX; cd5ab1b0fcb44a Shaohua Li 2017-03-27 1458 } cd5ab1b0fcb44a Shaohua Li 2017-03-27 1459 cd5ab1b0fcb44a Shaohua Li 2017-03-27 1460 if (tg->bps_conf[READ][off] == bps_dft && cd5ab1b0fcb44a Shaohua Li 2017-03-27 1461 tg->bps_conf[WRITE][off] == bps_dft && cd5ab1b0fcb44a Shaohua Li 2017-03-27 1462 tg->iops_conf[READ][off] == iops_dft && ada75b6e5b2a93 Shaohua Li 2017-03-27 1463 tg->iops_conf[WRITE][off] == iops_dft && ec80991d6fc2cb Shaohua Li 2017-03-27 1464 (off != LIMIT_LOW || b4f428ef2844e9 Shaohua Li 2017-05-17 1465 (tg->idletime_threshold_conf == DFL_IDLE_THRESHOLD && 5b81fc3cc625e8 Shaohua Li 2017-05-17 1466 tg->latency_target_conf == DFL_LATENCY_TARGET))) 2ee867dcfa2eae Tejun Heo 2015-08-18 1467 return 0; 2ee867dcfa2eae Tejun Heo 2015-08-18 1468 9bb67aeb967845 Shaohua Li 2017-05-17 1469 if (tg->bps_conf[READ][off] != U64_MAX) 9f626e372a6024 Shaohua Li 2017-03-27 @1470 snprintf(bufs[0], sizeof(bufs[0]), "%llu", cd5ab1b0fcb44a Shaohua Li 2017-03-27 1471 tg->bps_conf[READ][off]); 9bb67aeb967845 Shaohua Li 2017-05-17 1472 if (tg->bps_conf[WRITE][off] != U64_MAX) 9f626e372a6024 Shaohua Li 2017-03-27 1473 snprintf(bufs[1], sizeof(bufs[1]), "%llu", cd5ab1b0fcb44a Shaohua Li 2017-03-27 1474 tg->bps_conf[WRITE][off]); 9bb67aeb967845 Shaohua Li 2017-05-17 1475 if (tg->iops_conf[READ][off] != UINT_MAX) 9f626e372a6024 Shaohua Li 2017-03-27 1476 snprintf(bufs[2], sizeof(bufs[2]), "%u", cd5ab1b0fcb44a Shaohua Li 2017-03-27 1477 tg->iops_conf[READ][off]); 9bb67aeb967845 Shaohua Li 2017-05-17 1478 if (tg->iops_conf[WRITE][off] != UINT_MAX) 9f626e372a6024 Shaohua Li 2017-03-27 1479 snprintf(bufs[3], sizeof(bufs[3]), "%u", cd5ab1b0fcb44a Shaohua Li 2017-03-27 1480 tg->iops_conf[WRITE][off]); ada75b6e5b2a93 Shaohua Li 2017-03-27 1481 if (off == LIMIT_LOW) { 5b81fc3cc625e8 Shaohua Li 2017-05-17 1482 if (tg->idletime_threshold_conf == ULONG_MAX) ada75b6e5b2a93 Shaohua Li 2017-03-27 1483 strcpy(idle_time, " idle=max"); ada75b6e5b2a93 Shaohua Li 2017-03-27 1484 else ada75b6e5b2a93 Shaohua Li 2017-03-27 1485 snprintf(idle_time, sizeof(idle_time), " idle=%lu", 5b81fc3cc625e8 Shaohua Li 2017-05-17 1486 tg->idletime_threshold_conf); ec80991d6fc2cb Shaohua Li 2017-03-27 1487 5b81fc3cc625e8 Shaohua Li 2017-05-17 1488 if (tg->latency_target_conf == ULONG_MAX) ec80991d6fc2cb Shaohua Li 2017-03-27 1489 strcpy(latency_time, " latency=max"); ec80991d6fc2cb Shaohua Li 2017-03-27 1490 else ec80991d6fc2cb Shaohua Li 2017-03-27 1491 snprintf(latency_time, sizeof(latency_time), 5b81fc3cc625e8 Shaohua Li 2017-05-17 1492 " latency=%lu", tg->latency_target_conf); ada75b6e5b2a93 Shaohua Li 2017-03-27 1493 } 2ee867dcfa2eae Tejun Heo 2015-08-18 1494 ec80991d6fc2cb Shaohua Li 2017-03-27 1495 seq_printf(sf, "%s rbps=%s wbps=%s riops=%s wiops=%s%s%s\n", ec80991d6fc2cb Shaohua Li 2017-03-27 1496 dname, bufs[0], bufs[1], bufs[2], bufs[3], idle_time, ec80991d6fc2cb Shaohua Li 2017-03-27 1497 latency_time); 2ee867dcfa2eae Tejun Heo 2015-08-18 1498 return 0; 2ee867dcfa2eae Tejun Heo 2015-08-18 1499 } 2ee867dcfa2eae Tejun Heo 2015-08-18 1500 :::::: The code at line 1470 was first introduced by commit :::::: 9f626e372a602486fa319c2c6ab18e8068b30094 blk-throttle: prepare support multiple limits :::::: TO: Shaohua Li <[email protected]> :::::: CC: Jens Axboe <[email protected]> -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
