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

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



WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: Neaten warn_alloc_failed
Date: Thu, 25 Aug 2011 17:00:01 -0700	[thread overview]
Message-ID: <1314316801.19476.6.camel@Joe-Laptop> (raw)
In-Reply-To: <20110825165006.af771ef7.akpm@linux-foundation.org>

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


--
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:00 UTC|newest]

Thread overview: 20+ 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 20:26 ` Joe Perches
2011-08-25 23:50 ` Andrew Morton
2011-08-25 23:50   ` Andrew Morton
2011-08-26  0:00   ` Joe Perches [this message]
2011-08-26  0:00     ` Joe Perches
2011-08-26  0:05     ` Andrew Morton
2011-08-26  0:05       ` Andrew Morton
2011-08-26  0:38       ` Joe Perches
2011-08-26  0:38         ` Joe Perches
2011-08-26  1:07         ` Andrew Morton
2011-08-26  1:07           ` Andrew Morton
2011-08-26  2:55           ` [PATCH] treewide: Use __printf not __attribute__((format(printf,...))) Joe Perches
2011-08-26  2:55             ` Joe Perches
2011-10-11 17:22             ` Kirill A. Shutemov
2011-10-11 17:22               ` Kirill A. Shutemov
2011-10-11 17:22               ` Kirill A. Shutemov
2011-10-11 17:43               ` Joe Perches
2011-10-11 17:43                 ` Joe Perches
     [not found]             ` <20111101150908.b482fad5.akpm@linux-foundation.org>
2011-11-02  2:27               ` [PATCH] checkpatch: Prefer " 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=1314316801.19476.6.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.