linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: Neaten warn_alloc_failed
Date: Thu, 25 Aug 2011 17:05:34 -0700	[thread overview]
Message-ID: <20110825170534.0d425c75.akpm@linux-foundation.org> (raw)
In-Reply-To: <1314316801.19476.6.camel@Joe-Laptop>

On Thu, 25 Aug 2011 17:00:01 -0700
Joe Perches <joe@perches.com> wrote:

> On Thu, 2011-08-25 at 16:50 -0700, Andrew Morton wrote:
> > On Thu, 25 Aug 2011 13:26:19 -0700
> > Joe Perches <joe@perches.com> wrote:
> > > Add __attribute__((format (printf...) to the function
> > > to validate format and arguments.  Use vsprintf extension
> > > %pV to avoid any possible message interleaving. Coalesce
> > > format string.  Convert printks/pr_warning to pr_warn.
> []
> > > -extern void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...);
> > > +extern __attribute__((format (printf, 3, 4)))
> > > +void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...);
> > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> > looky:
> 
> Looky what?
> 
> There are _far_ more uses of __attribute__((format...)
> than __printf(...)
> 
> I generally go with what's more commonly used,
> especially when it's 206 to 8, and 1 of the
> 8 is the #define itself.
> 
> $ grep -rP --include=*.[ch] "__attribute__.*format" * | wc -l
> 206
> $ grep -rP --include=*.[ch]  -w "__printf" * | wc -l
> 8
> 

So?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-08-26  0:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 20:26 [PATCH] mm: Neaten warn_alloc_failed Joe Perches
2011-08-25 23:50 ` Andrew Morton
2011-08-26  0:00   ` Joe Perches
2011-08-26  0:05     ` Andrew Morton [this message]
2011-08-26  0:38       ` Joe Perches
2011-08-26  1:07         ` Andrew Morton
2011-08-26  2:55           ` [PATCH] treewide: Use __printf not __attribute__((format(printf,...))) Joe Perches
2011-10-11 17:22             ` Kirill A. Shutemov
2011-10-11 17:43               ` 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=20110825170534.0d425c75.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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).