From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: block/blk-crypto-sysfs.c:82:33: warning: Parameter 'attr' can be declared as pointer to const [constParameter]
Date: Tue, 14 Feb 2023 23:23:41 +0800 [thread overview]
Message-ID: <202302142347.7XAcfTOc-lkp@intel.com> (raw)
::::::
:::::: Manual check reason: "low confidence static check warning: block/blk-crypto-sysfs.c:82:33: warning: Parameter 'attr' can be declared as pointer to const [constParameter]"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Eric Biggers <ebiggers@google.com>
CC: Jens Axboe <axboe@kernel.dk>
CC: Hannes Reinecke <hare@suse.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f6feea56f66d34259c4222fa02e8171c4f2673d1
commit: 20f01f163203666010ee1560852590a0c0572726 blk-crypto: show crypto capabilities in sysfs
date: 12 months ago
:::::: branch date: 17 hours ago
:::::: commit date: 12 months ago
compiler: sparc-linux-gcc (GCC) 12.1.0
reproduce (cppcheck warning):
# apt-get install cppcheck
git checkout 20f01f163203666010ee1560852590a0c0572726
cppcheck --quiet --enable=style,performance,portability --template=gcc FILE
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/r/202302142347.7XAcfTOc-lkp@intel.com/
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> crypto/testmgr.c:3661:6: warning: Redundant initialization for 'ret'. The initialized value is overwritten before it is read. [redundantInitialization]
ret = crypto_drbg_reset_test(drng, &pers, &test_data);
^
crypto/testmgr.c:3641:10: note: ret is initialized
int ret = -EAGAIN;
^
crypto/testmgr.c:3661:6: note: ret is overwritten
ret = crypto_drbg_reset_test(drng, &pers, &test_data);
^
>> crypto/testmgr.c:915:41: warning: Parameter 'end' can be declared as pointer to const [constParameter]
size_t max_divs, char *p, char *end,
^
>> block/blk-crypto-sysfs.c:82:33: warning: Parameter 'attr' can be declared as pointer to const [constParameter]
struct blk_crypto_attr *attr, char *page)
^
--
>> block/blk-integrity.c:263:9: warning: %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'. [invalidPrintfArgType_uint]
return sprintf(page, "%un",
^
--
>> block/blk-wbt.c:618:62: warning: Parameter 'rq' can be declared as pointer to const [constParameter]
static void wbt_requeue(struct rq_qos *rqos, struct request *rq)
^
--
>> 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[0], sizeof(bufs[0]), "%llu",
^
block/blk-throttle.c:1476: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:1770:21: warning: Parameter 'this_tg' can be declared as pointer to const [constParameter]
struct throtl_grp *this_tg)
^
vim +/attr +82 block/blk-crypto-sysfs.c
20f01f16320366 Eric Biggers 2022-01-24 80
20f01f16320366 Eric Biggers 2022-01-24 81 static ssize_t blk_crypto_mode_show(struct blk_crypto_profile *profile,
20f01f16320366 Eric Biggers 2022-01-24 @82 struct blk_crypto_attr *attr, char *page)
20f01f16320366 Eric Biggers 2022-01-24 83 {
20f01f16320366 Eric Biggers 2022-01-24 84 int mode_num = attr - __blk_crypto_mode_attrs;
20f01f16320366 Eric Biggers 2022-01-24 85
20f01f16320366 Eric Biggers 2022-01-24 86 return sysfs_emit(page, "0x%x\n", profile->modes_supported[mode_num]);
20f01f16320366 Eric Biggers 2022-01-24 87 }
20f01f16320366 Eric Biggers 2022-01-24 88
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next reply other threads:[~2023-02-14 15:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-14 15:23 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-12-05 18:32 block/blk-crypto-sysfs.c:82:33: warning: Parameter 'attr' can be declared as pointer to const [constParameter] kernel test robot
2022-11-06 17:06 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=202302142347.7XAcfTOc-lkp@intel.com \
--to=lkp@intel.com \
--cc=oe-kbuild@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.