All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jeff Layton <jlayton@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [jlayton:kdevops 43/47] net/sunrpc/svcsock.c:1294:11: warning: format specifies type 'int' but the argument has type 'unsigned long'
Date: Sat, 9 Aug 2025 15:18:47 +0200	[thread overview]
Message-ID: <202508091526.CVVPmLwu-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux.git kdevops
head:   78cea35b7fffda7d71482e5881bcd3e4a30b0acb
commit: 562305ff2066e7dd88d087577f23fab6b6a76b2d [43/47] sunrpc: fix pr_notice in svc_tcp_sendto() to show correct length
config: x86_64-rhel-9.4-rust (https://download.01.org/0day-ci/archive/20250809/202508091526.CVVPmLwu-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250809/202508091526.CVVPmLwu-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/202508091526.CVVPmLwu-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> net/sunrpc/svcsock.c:1294:11: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
    1291 |         pr_notice("rpc-srv/tcp: %s: %s %d when sending %d bytes - shutting down socket\n",
         |                                                        ~~
         |                                                        %lu
    1292 |                   xprt->xpt_server->sv_name,
    1293 |                   (sent < 0) ? "got error" : "sent",
    1294 |                   sent, xdr->len + sizeof(marker));
         |                         ^~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/printk.h:577:36: note: expanded from macro 'pr_notice'
     577 |         printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
         |                                   ~~~     ^~~~~~~~~~~
   include/linux/printk.h:514:60: note: expanded from macro 'printk'
     514 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
         |                                                     ~~~    ^~~~~~~~~~~
   include/linux/printk.h:486:19: note: expanded from macro 'printk_index_wrap'
     486 |                 _p_func(_fmt, ##__VA_ARGS__);                           \
         |                         ~~~~    ^~~~~~~~~~~
   1 warning generated.


vim +1294 net/sunrpc/svcsock.c

  1255	
  1256	/**
  1257	 * svc_tcp_sendto - Send out a reply on a TCP socket
  1258	 * @rqstp: completed svc_rqst
  1259	 *
  1260	 * xpt_mutex ensures @rqstp's whole message is written to the socket
  1261	 * without interruption.
  1262	 *
  1263	 * Returns the number of bytes sent, or a negative errno.
  1264	 */
  1265	static int svc_tcp_sendto(struct svc_rqst *rqstp)
  1266	{
  1267		struct svc_xprt *xprt = rqstp->rq_xprt;
  1268		struct svc_sock	*svsk = container_of(xprt, struct svc_sock, sk_xprt);
  1269		struct xdr_buf *xdr = &rqstp->rq_res;
  1270		rpc_fraghdr marker = cpu_to_be32(RPC_LAST_STREAM_FRAGMENT |
  1271						 (u32)xdr->len);
  1272		int sent;
  1273	
  1274		svc_tcp_release_ctxt(xprt, rqstp->rq_xprt_ctxt);
  1275		rqstp->rq_xprt_ctxt = NULL;
  1276	
  1277		mutex_lock(&xprt->xpt_mutex);
  1278		if (svc_xprt_is_dead(xprt))
  1279			goto out_notconn;
  1280		sent = svc_tcp_sendmsg(svsk, rqstp, marker);
  1281		trace_svcsock_tcp_send(xprt, sent);
  1282		if (sent < 0 || sent != (xdr->len + sizeof(marker)))
  1283			goto out_close;
  1284		mutex_unlock(&xprt->xpt_mutex);
  1285		return sent;
  1286	
  1287	out_notconn:
  1288		mutex_unlock(&xprt->xpt_mutex);
  1289		return -ENOTCONN;
  1290	out_close:
  1291		pr_notice("rpc-srv/tcp: %s: %s %d when sending %d bytes - shutting down socket\n",
  1292			  xprt->xpt_server->sv_name,
  1293			  (sent < 0) ? "got error" : "sent",
> 1294			  sent, xdr->len + sizeof(marker));
  1295		svc_xprt_deferred_close(xprt);
  1296		mutex_unlock(&xprt->xpt_mutex);
  1297		return -EAGAIN;
  1298	}
  1299	

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

             reply	other threads:[~2025-08-09 13:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-09 13:18 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-08-09 16:53 [jlayton:kdevops 43/47] net/sunrpc/svcsock.c:1294:11: warning: format specifies type 'int' but the argument has type 'unsigned long' 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=202508091526.CVVPmLwu-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jlayton@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 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.