Thread (4 messages) 4 messages, 4 authors, 2019-03-01

Re: [PATCH] sctp: chunk.c: correct format string for size_t in printk

From: Joe Perches <joe@perches.com>
Date: 2019-03-01 22:22:37
Also in: linux-sctp, lkml

On Thu, 2019-02-28 at 11:36 +0000, Matthias Maennich wrote:
According to Documentation/core-api/printk-formats.rst, size_t should be
printed with %zu, rather than %Zu.

In addition, using %Zu triggers a warning on clang (-Wformat-extra-args):
[]
quoted hunk ↗ jump to hunk
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
[]
quoted hunk ↗ jump to hunk
@@ -192,7 +192,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,
 	if (unlikely(!max_data)) {
 		max_data = sctp_min_frag_point(sctp_sk(asoc->base.sk),
 					       sctp_datachk_len(&asoc->stream));
-		pr_warn_ratelimited("%s: asoc:%p frag_point is zero, forcing max_data to default minimum (%Zu)",
+		pr_warn_ratelimited("%s: asoc:%p frag_point is zero, forcing max_data to default minimum (%zu)",
 				    __func__, asoc, max_data);
trivia: the format is also missing a terminating '\n'
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help