* [PATCH linux-next] skd: fix some VPRINTK() specifiers for size_t
@ 2013-09-28 17:37 Vincent Stehlé
0 siblings, 0 replies; only message in thread
From: Vincent Stehlé @ 2013-09-28 17:37 UTC (permalink / raw)
To: linux-kernel, linux-next; +Cc: Vincent Stehlé, Andrew Morton
Use %zu for VPRINTK() as size_t specifier in replacement of %u.
This fixes 7 compilation warnings on x86_64 like the following:
drivers/block/skd_main.c:4628:42: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 6 has type ‘long unsigned int’ [-Wformat=]
While at it, remove one cast to unsigned long for a size_t VPRINTK() argument
and specify it as %zu, too.
Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
Hi,
This can be seen on e.g. linux next-20130927.
Best regards,
V.
drivers/block/skd_main.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c
index 3110f68..ee7f7a8 100644
--- a/drivers/block/skd_main.c
+++ b/drivers/block/skd_main.c
@@ -4556,11 +4556,10 @@ static int skd_cons_skmsg(struct skd_device *skdev)
int rc = 0;
u32 i;
- VPRINTK(skdev, "skmsg_table kzalloc, struct %u, count %u total %lu\n",
+ VPRINTK(skdev, "skmsg_table kzalloc, struct %zu, count %u total %zu\n",
sizeof(struct skd_fitmsg_context),
skdev->num_fitmsg_context,
- (unsigned long) sizeof(struct skd_fitmsg_context) *
- skdev->num_fitmsg_context);
+ sizeof(struct skd_fitmsg_context) * skdev->num_fitmsg_context);
skdev->skmsg_table = kzalloc(sizeof(struct skd_fitmsg_context)
*skdev->num_fitmsg_context, GFP_KERNEL);
@@ -4611,7 +4610,7 @@ static int skd_cons_skreq(struct skd_device *skdev)
int rc = 0;
u32 i;
- VPRINTK(skdev, "skreq_table kzalloc, struct %u, count %u total %u\n",
+ VPRINTK(skdev, "skreq_table kzalloc, struct %zu, count %u total %zu\n",
sizeof(struct skd_request_context),
skdev->num_req_context,
sizeof(struct skd_request_context) * skdev->num_req_context);
@@ -4623,7 +4622,7 @@ static int skd_cons_skreq(struct skd_device *skdev)
goto err_out;
}
- VPRINTK(skdev, "alloc sg_table sg_per_req %u scatlist %u total %u\n",
+ VPRINTK(skdev, "alloc sg_table sg_per_req %u scatlist %zu total %zu\n",
skdev->sgs_per_request, sizeof(struct scatterlist),
skdev->sgs_per_request * sizeof(struct scatterlist));
@@ -4668,7 +4667,7 @@ static int skd_cons_skspcl(struct skd_device *skdev)
int rc = 0;
u32 i, nbytes;
- VPRINTK(skdev, "skspcl_table kzalloc, struct %u, count %u total %u\n",
+ VPRINTK(skdev, "skspcl_table kzalloc, struct %zu, count %u total %zu\n",
sizeof(struct skd_special_context),
skdev->n_special,
sizeof(struct skd_special_context) * skdev->n_special);
--
1.8.4.rc3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-09-28 17:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-28 17:37 [PATCH linux-next] skd: fix some VPRINTK() specifiers for size_t Vincent Stehlé
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).