* [PATCH] sctp: chunk.c: correct format string for size_t in printk
@ 2019-02-28 11:36 Matthias Maennich
2019-02-28 13:55 ` Marcelo Ricardo Leitner
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Matthias Maennich @ 2019-02-28 11:36 UTC (permalink / raw)
Cc: Matthias Maennich, Vlad Yasevich, Neil Horman,
Marcelo Ricardo Leitner, David S. Miller, linux-sctp, netdev,
linux-kernel
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):
net/sctp/chunk.c:196:25: warning: data argument not used by format string [-Wformat-extra-args]
__func__, asoc, max_data);
~~~~~~~~~~~~~~~~^~~~~~~~~
./include/linux/printk.h:440:49: note: expanded from macro 'pr_warn_ratelimited'
printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
./include/linux/printk.h:424:17: note: expanded from macro 'printk_ratelimited'
printk(fmt, ##__VA_ARGS__); \
~~~ ^
Fixes: 5b5e0928f742 ("lib/vsprintf.c: remove %Z support")
Link: https://github.com/ClangBuiltLinux/linux/issues/378
Signed-off-by: Matthias Maennich <maennich@google.com>
---
net/sctp/chunk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
index 64bef313d436..5cb7c1ff97e9 100644
--- a/net/sctp/chunk.c
+++ b/net/sctp/chunk.c
@@ -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);
}
--
2.21.0.rc2.261.ga7da99ff1b-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] sctp: chunk.c: correct format string for size_t in printk
2019-02-28 11:36 [PATCH] sctp: chunk.c: correct format string for size_t in printk Matthias Maennich
@ 2019-02-28 13:55 ` Marcelo Ricardo Leitner
2019-02-28 18:34 ` David Miller
2019-03-01 22:22 ` Joe Perches
2 siblings, 0 replies; 4+ messages in thread
From: Marcelo Ricardo Leitner @ 2019-02-28 13:55 UTC (permalink / raw)
To: Matthias Maennich
Cc: Vlad Yasevich, Neil Horman, David S. Miller, linux-sctp, netdev,
linux-kernel
On Thu, Feb 28, 2019 at 11:36:52AM +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):
>
> net/sctp/chunk.c:196:25: warning: data argument not used by format string [-Wformat-extra-args]
> __func__, asoc, max_data);
> ~~~~~~~~~~~~~~~~^~~~~~~~~
> ./include/linux/printk.h:440:49: note: expanded from macro 'pr_warn_ratelimited'
> printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
> ./include/linux/printk.h:424:17: note: expanded from macro 'printk_ratelimited'
> printk(fmt, ##__VA_ARGS__); \
> ~~~ ^
>
> Fixes: 5b5e0928f742 ("lib/vsprintf.c: remove %Z support")
> Link: https://github.com/ClangBuiltLinux/linux/issues/378
> Signed-off-by: Matthias Maennich <maennich@google.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> ---
> net/sctp/chunk.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
> index 64bef313d436..5cb7c1ff97e9 100644
> --- a/net/sctp/chunk.c
> +++ b/net/sctp/chunk.c
> @@ -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);
> }
>
> --
> 2.21.0.rc2.261.ga7da99ff1b-goog
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sctp: chunk.c: correct format string for size_t in printk
2019-02-28 11:36 [PATCH] sctp: chunk.c: correct format string for size_t in printk Matthias Maennich
2019-02-28 13:55 ` Marcelo Ricardo Leitner
@ 2019-02-28 18:34 ` David Miller
2019-03-01 22:22 ` Joe Perches
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-02-28 18:34 UTC (permalink / raw)
To: maennich
Cc: vyasevich, nhorman, marcelo.leitner, linux-sctp, netdev, linux-kernel
From: Matthias Maennich <maennich@google.com>
Date: Thu, 28 Feb 2019 11:36:52 +0000
> 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):
>
> net/sctp/chunk.c:196:25: warning: data argument not used by format string [-Wformat-extra-args]
> __func__, asoc, max_data);
> ~~~~~~~~~~~~~~~~^~~~~~~~~
> ./include/linux/printk.h:440:49: note: expanded from macro 'pr_warn_ratelimited'
> printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
> ./include/linux/printk.h:424:17: note: expanded from macro 'printk_ratelimited'
> printk(fmt, ##__VA_ARGS__); \
> ~~~ ^
>
> Fixes: 5b5e0928f742 ("lib/vsprintf.c: remove %Z support")
> Link: https://github.com/ClangBuiltLinux/linux/issues/378
> Signed-off-by: Matthias Maennich <maennich@google.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] sctp: chunk.c: correct format string for size_t in printk
2019-02-28 11:36 [PATCH] sctp: chunk.c: correct format string for size_t in printk Matthias Maennich
2019-02-28 13:55 ` Marcelo Ricardo Leitner
2019-02-28 18:34 ` David Miller
@ 2019-03-01 22:22 ` Joe Perches
2 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2019-03-01 22:22 UTC (permalink / raw)
To: Matthias Maennich
Cc: Vlad Yasevich, Neil Horman, Marcelo Ricardo Leitner,
David S. Miller, linux-sctp, netdev, linux-kernel
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):
[]
> diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c
[]
> @@ -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'
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-03-01 22:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28 11:36 [PATCH] sctp: chunk.c: correct format string for size_t in printk Matthias Maennich
2019-02-28 13:55 ` Marcelo Ricardo Leitner
2019-02-28 18:34 ` David Miller
2019-03-01 22:22 ` Joe Perches
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).