llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jarkko Sakkinen <jarkko.sakkinen@iki.fi>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [jarkko-tpmdd:tpm2key-v8 7/7] security/keys/key.c:705:37: warning: format specifies type 'int' but the argument has type 'long'
Date: Thu, 13 Jun 2024 11:36:47 +0800	[thread overview]
Message-ID: <202406131149.L4cvaVlD-lkp@intel.com> (raw)

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git tpm2key-v8
head:   d9163bc5bda8b6415ef960406b9bc952fa1b1b9f
commit: d9163bc5bda8b6415ef960406b9bc952fa1b1b9f [7/7] fixup
config: riscv-defconfig (https://download.01.org/0day-ci/archive/20240613/202406131149.L4cvaVlD-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 4403cdbaf01379de96f8d0d6ea4f51a085e37766)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240613/202406131149.L4cvaVlD-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/202406131149.L4cvaVlD-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from security/keys/key.c:13:
   In file included from include/linux/security.h:33:
   In file included from include/linux/mm.h:2253:
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
>> security/keys/key.c:705:37: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
     705 |                 pr_info("%s: ret=%d\n", __func__, PTR_ERR(key));
         |                                  ~~               ^~~~~~~~~~~~
         |                                  %ld
   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 +705 security/keys/key.c

   666	
   667	/*
   668	 * Find a key by its serial number.
   669	 */
   670	struct key *key_lookup(key_serial_t id)
   671	{
   672		struct rb_node *n;
   673		struct key *key;
   674	
   675		pr_info("%s: enter\n", __func__);
   676		spin_lock(&key_serial_lock);
   677	
   678		/* search the tree for the specified key */
   679		n = key_serial_tree.rb_node;
   680		while (n) {
   681			key = rb_entry(n, struct key, serial_node);
   682	
   683			if (id < key->serial)
   684				n = n->rb_left;
   685			else if (id > key->serial)
   686				n = n->rb_right;
   687			else
   688				goto found;
   689		}
   690	
   691	not_found:
   692		key = ERR_PTR(-ENOKEY);
   693		goto error;
   694	
   695	found:
   696		/* A key is allowed to be looked up only if someone still owns a
   697		 * reference to it - otherwise it's awaiting the gc.
   698		 */
   699		if (!refcount_inc_not_zero(&key->usage))
   700			goto not_found;
   701	
   702	error:
   703		spin_unlock(&key_serial_lock);
   704		if (IS_ERR(key))
 > 705			pr_info("%s: ret=%d\n", __func__, PTR_ERR(key));
   706		return key;
   707	}
   708	EXPORT_SYMBOL(key_lookup);
   709	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2024-06-13  3:37 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=202406131149.L4cvaVlD-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jarkko.sakkinen@iki.fi \
    --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).