linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] CIFS: use correct format string for size_t
@ 2017-02-02 12:21 Arnd Bergmann
  2017-02-02 18:03 ` Pavel Shilovsky
  2017-02-06 13:57 ` Sachin Prabhu
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2017-02-02 12:21 UTC (permalink / raw)
  To: Steve French
  Cc: Arnd Bergmann, Pavel Shilovsky, Aurelien Aptel, Sachin Prabhu,
	linux-cifs, samba-technical, linux-kernel

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] CIFS: use correct format string for size_t
  2017-02-02 12:21 [PATCH] CIFS: use correct format string for size_t Arnd Bergmann
@ 2017-02-02 18:03 ` Pavel Shilovsky
  2017-02-06 13:57 ` Sachin Prabhu
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Shilovsky @ 2017-02-02 18:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Steve French, Pavel Shilovsky, Aurelien Aptel, Sachin Prabhu,
	linux-cifs, samba-technical, Kernel Mailing List

2017-02-02 4:21 GMT-08:00 Arnd Bergmann <arnd@arndb.de>:
> 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
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

This issue have been already fixed in the Steve's for-next branch. Thanks.

-- 
Best regards,
Pavel Shilovsky

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] CIFS: use correct format string for size_t
  2017-02-02 12:21 [PATCH] CIFS: use correct format string for size_t Arnd Bergmann
  2017-02-02 18:03 ` Pavel Shilovsky
@ 2017-02-06 13:57 ` Sachin Prabhu
  1 sibling, 0 replies; 3+ messages in thread
From: Sachin Prabhu @ 2017-02-06 13:57 UTC (permalink / raw)
  To: Arnd Bergmann, Steve French
  Cc: Pavel Shilovsky, Aurelien Aptel, linux-cifs, samba-technical,
	linux-kernel

On Thu, 2017-02-02 at 13:21 +0100, Arnd Bergmann wrote:
> 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>

Acked-by: Sachin Prabhu <sprabhu@redhat.com>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-06 13:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-02 12:21 [PATCH] CIFS: use correct format string for size_t Arnd Bergmann
2017-02-02 18:03 ` Pavel Shilovsky
2017-02-06 13:57 ` Sachin Prabhu

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