llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [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')
@ 2024-06-13 11:38 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-06-13 11:38 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: llvm, oe-kbuild-all

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-06-13 11:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-13 11:38 [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') kernel test robot

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).