From: kernel test robot <lkp@intel.com>
To: Jarkko Sakkinen <jarkko@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [jarkko-tpmdd:tpm2key-v8 4/7] crypto/tpm2_key.c:66:46: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int')
Date: Thu, 13 Jun 2024 19:38:37 +0800 [thread overview]
Message-ID: <202406131947.HQPeOX9t-lkp@intel.com> (raw)
tree: git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git tpm2key-v8
head: d9163bc5bda8b6415ef960406b9bc952fa1b1b9f
commit: a6354b96f28990ba3d0b8753f0f639127febccb0 [4/7] crypto: tpm2_key: Implement a robust parser
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240613/202406131947.HQPeOX9t-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 78ee473784e5ef6f0b19ce4cb111fb6e4d23c6b2)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240613/202406131947.HQPeOX9t-lkp@intel.com/reproduce)
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
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406131947.HQPeOX9t-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> crypto/tpm2_key.c:66:46: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
66 | pr_info("%s: header size: %lu\n", __func__, header_size);
| ~~~ ^~~~~~~~~~~
| %zu
include/linux/printk.h:537:34: note: expanded from macro 'pr_info'
537 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ~~~ ^~~~~~~~~~~
include/linux/printk.h:464:60: note: expanded from macro 'printk'
464 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
| ~~~ ^~~~~~~~~~~
include/linux/printk.h:436:19: note: expanded from macro 'printk_index_wrap'
436 | _p_func(_fmt, ##__VA_ARGS__); \
| ~~~~ ^~~~~~~~~~~
crypto/tpm2_key.c:67:46: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
67 | pr_info("%s: public size: %lu\n", __func__, size);
| ~~~ ^~~~
| %zu
include/linux/printk.h:537:34: note: expanded from macro 'pr_info'
537 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ~~~ ^~~~~~~~~~~
include/linux/printk.h:464:60: note: expanded from macro 'printk'
464 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
| ~~~ ^~~~~~~~~~~
include/linux/printk.h:436:19: note: expanded from macro 'printk_index_wrap'
436 | _p_func(_fmt, ##__VA_ARGS__); \
| ~~~~ ^~~~~~~~~~~
2 warnings generated.
vim +66 crypto/tpm2_key.c
44
45 int tpm2_parse_public(void *context, size_t hdrlen, u8 tag, const void *value, size_t size)
46 {
47 const void *ptr = value + sizeof(struct tpm2_public);
48 struct tpm2_key *work = context;
49 size_t header_size;
50
51 if (!tpm2_key_valid(value, size))
52 return -EBADMSG;
53
54 if (sizeof(struct tpm2_public) > size - 2)
55 return -EBADMSG;
56
57 ptr += 2 + get_unaligned_be16(ptr);
58 header_size = ptr - value;
59
60 if ((ptr - value) > size - 2)
61 return -EBADMSG;
62
63 work->public = value;
64 work->public_size = size;
65
> 66 pr_info("%s: header size: %lu\n", __func__, header_size);
67 pr_info("%s: public size: %lu\n", __func__, size);
68 return 0;
69 }
70
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-06-13 11:38 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=202406131947.HQPeOX9t-lkp@intel.com \
--to=lkp@intel.com \
--cc=jarkko@kernel.org \
--cc=llvm@lists.linux.dev \
--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;
as well as URLs for NNTP newsgroup(s).