[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110825165006.af771ef7.akpm@linux-foundation.org>
Date: Thu, 25 Aug 2011 16:50:06 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Joe Perches <joe@...ches.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH] mm: Neaten warn_alloc_failed
On Thu, 25 Aug 2011 13:26:19 -0700
Joe Perches <joe@...ches.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.
>
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1334,7 +1334,8 @@ extern void si_meminfo(struct sysinfo * val);
> extern void si_meminfo_node(struct sysinfo *val, int nid);
> extern int after_bootmem;
>
> -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, ...);
>
> extern void setup_per_cpu_pageset(void);
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
looky:
--- a/include/linux/mm.h~mm-neaten-warn_alloc_failed-fix
+++ a/include/linux/mm.h
@@ -1335,7 +1335,7 @@ extern void si_meminfo(struct sysinfo *
extern void si_meminfo_node(struct sysinfo *val, int nid);
extern int after_bootmem;
-extern __attribute__((format (printf, 3, 4)))
+extern __printf(3, 4)
void warn_alloc_failed(gfp_t gfp_mask, int order, const char *fmt, ...);
extern void setup_per_cpu_pageset(void);
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists