Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1572325

[PATCH] CIFS: use correct format string for size_t

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject [PATCH] CIFS: use correct format string for size_t
Date 2017-02-02 13:30 +0100
Message-ID <t6oGu-3Tn-23@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


This warning is harmless as size_t is always as wide as 'unsigned long':

fs/cifs/smb2ops.c:2008:245: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'size_t {aka unsigned int}' [-Werror=format=]

Using %zu however is the correct format string that we don't get a warning for.

Fixes: c9d651a5a2fe ("CIFS: Decrypt and process small encrypted packets")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/cifs/smb2ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 0764c32754b0..ac6e10adf000 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -2005,7 +2005,7 @@ handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid,
 	rdata->iov[0].iov_len = 4;
 	rdata->iov[1].iov_base = buf + 4;
 	rdata->iov[1].iov_len = server->vals->read_rsp_size - 4;
-	cifs_dbg(FYI, "0: iov_base=%p iov_len=%lu\n",
+	cifs_dbg(FYI, "0: iov_base=%p iov_len=%zu\n",
 		 rdata->iov[0].iov_base, server->vals->read_rsp_size);
 
 	length = rdata->copy_into_pages(server, rdata, &iter);
-- 
2.9.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] CIFS: use correct format string for size_t Arnd Bergmann <arnd@arndb.de> - 2017-02-02 13:30 +0100
  Re: [PATCH] CIFS: use correct format string for size_t Pavel Shilovsky <piastryyy@gmail.com> - 2017-02-02 19:10 +0100
  Re: [PATCH] CIFS: use correct format string for size_t Sachin Prabhu <sprabhu@redhat.com> - 2017-02-06 15:00 +0100

csiph-web