netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Matthias Maennich <maennich@google.com>
Cc: Vlad Yasevich <vyasevich@gmail.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sctp: chunk.c: correct format string for size_t in printk
Date: Thu, 28 Feb 2019 10:55:34 -0300	[thread overview]
Message-ID: <20190228135534.GC13343@localhost.localdomain> (raw)
In-Reply-To: <20190228113652.55552-1-maennich@google.com>

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
> 

  reply	other threads:[~2019-02-28 13:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2019-02-28 18:34 ` David Miller
2019-03-01 22:22 ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190228135534.GC13343@localhost.localdomain \
    --to=marcelo.leitner@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=maennich@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=vyasevich@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).