All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH, RESEND] orangefs: use %zu format string for size_t
@ 2015-11-11 22:32 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2015-11-11 22:32 UTC (permalink / raw)
  To: Mike Marshall; +Cc: linux-kernel, linux-arm-kernel, linux-fsdevel

On 32-bit architectures, 'size_t' and 'unsigned long' are not necessarily
the same, so we get a compiler warning about it:

fs/orangefs/pvfs2-bufmap.c: In function 'pvfs_bufmap_copy_from_iovec':
fs/orangefs/pvfs2-bufmap.c:521:8: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]

This changes the code to use %zu instead of %lu, which always
matches size_t.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 4d1c44043b26e ("Orangefs: use iov_iter interface")
---
Sent originally on October 7, but not yet applied, and we still get the
same warnings. Please apply.

diff --git a/fs/orangefs/pvfs2-bufmap.c b/fs/orangefs/pvfs2-bufmap.c
index 9d0392a3e824..06fb797dedda 100644
--- a/fs/orangefs/pvfs2-bufmap.c
+++ b/fs/orangefs/pvfs2-bufmap.c
@@ -518,7 +518,7 @@ int pvfs_bufmap_copy_from_iovec(struct pvfs2_bufmap *bufmap,
 	int i;
 
 	gossip_debug(GOSSIP_BUFMAP_DEBUG,
-		     "%s: buffer_index:%d: size:%lu:\n",
+		     "%s: buffer_index:%d: size:%zu:\n",
 		     __func__, buffer_index, size);
 
 	to = &bufmap->desc_array[buffer_index];
@@ -550,7 +550,7 @@ int pvfs_bufmap_copy_to_iovec(struct pvfs2_bufmap *bufmap,
 	size_t written;
 
 	gossip_debug(GOSSIP_BUFMAP_DEBUG,
-		     "%s: buffer_index:%d: iov_iter_count(iter):%lu:\n",
+		     "%s: buffer_index:%d: iov_iter_count(iter):%zu:\n",
 		     __func__, buffer_index, iov_iter_count(iter));
 
 	from = &bufmap->desc_array[buffer_index];

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

* [PATCH, RESEND] orangefs: use %zu format string for size_t
@ 2015-11-11 22:32 ` Arnd Bergmann
  0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2015-11-11 22:32 UTC (permalink / raw)
  To: linux-arm-kernel

On 32-bit architectures, 'size_t' and 'unsigned long' are not necessarily
the same, so we get a compiler warning about it:

fs/orangefs/pvfs2-bufmap.c: In function 'pvfs_bufmap_copy_from_iovec':
fs/orangefs/pvfs2-bufmap.c:521:8: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]

This changes the code to use %zu instead of %lu, which always
matches size_t.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 4d1c44043b26e ("Orangefs: use iov_iter interface")
---
Sent originally on October 7, but not yet applied, and we still get the
same warnings. Please apply.

diff --git a/fs/orangefs/pvfs2-bufmap.c b/fs/orangefs/pvfs2-bufmap.c
index 9d0392a3e824..06fb797dedda 100644
--- a/fs/orangefs/pvfs2-bufmap.c
+++ b/fs/orangefs/pvfs2-bufmap.c
@@ -518,7 +518,7 @@ int pvfs_bufmap_copy_from_iovec(struct pvfs2_bufmap *bufmap,
 	int i;
 
 	gossip_debug(GOSSIP_BUFMAP_DEBUG,
-		     "%s: buffer_index:%d: size:%lu:\n",
+		     "%s: buffer_index:%d: size:%zu:\n",
 		     __func__, buffer_index, size);
 
 	to = &bufmap->desc_array[buffer_index];
@@ -550,7 +550,7 @@ int pvfs_bufmap_copy_to_iovec(struct pvfs2_bufmap *bufmap,
 	size_t written;
 
 	gossip_debug(GOSSIP_BUFMAP_DEBUG,
-		     "%s: buffer_index:%d: iov_iter_count(iter):%lu:\n",
+		     "%s: buffer_index:%d: iov_iter_count(iter):%zu:\n",
 		     __func__, buffer_index, iov_iter_count(iter));
 
 	from = &bufmap->desc_array[buffer_index];

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

end of thread, other threads:[~2015-11-11 22:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-11 22:32 [PATCH, RESEND] orangefs: use %zu format string for size_t Arnd Bergmann
2015-11-11 22:32 ` Arnd Bergmann

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.