All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts: Fix gfp-translate for recent changes to gfp.h
@ 2010-11-22 12:00 ` Mel Gorman
  0 siblings, 0 replies; 8+ messages in thread
From: Mel Gorman @ 2010-11-22 12:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Namhyung Kim, linux-mm, linux-kernel

The recent changes to gfp.h to satisfy sparse broke
scripts/gfp-translate. This patch fixes it up to work with old and new
versions of gfp.h .

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 scripts/gfp-translate |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/scripts/gfp-translate b/scripts/gfp-translate
index d81b968..128937e 100644
--- a/scripts/gfp-translate
+++ b/scripts/gfp-translate
@@ -63,7 +63,12 @@ fi
 
 # Extract GFP flags from the kernel source
 TMPFILE=`mktemp -t gfptranslate-XXXXXX` || exit 1
-grep "^#define __GFP" $SOURCE/include/linux/gfp.h | sed -e 's/(__force gfp_t)//' | sed -e 's/u)/)/' | grep -v GFP_BITS | sed -e 's/)\//) \//' > $TMPFILE
+grep ___GFP $SOURCE/include/linux/gfp.h > /dev/null
+if [ $? -eq 0 ]; then
+	grep "^#define ___GFP" $SOURCE/include/linux/gfp.h | sed -e 's/u$//' | grep -v GFP_BITS > $TMPFILE
+else
+	grep "^#define __GFP" $SOURCE/include/linux/gfp.h | sed -e 's/(__force gfp_t)//' | sed -e 's/u)/)/' | grep -v GFP_BITS | sed -e 's/)\//) \//' > $TMPFILE
+fi
 
 # Parse the flags
 IFS="

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-11-23  8:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-22 12:00 [PATCH] scripts: Fix gfp-translate for recent changes to gfp.h Mel Gorman
2010-11-22 12:00 ` Mel Gorman
2010-11-23  2:54 ` Namhyung Kim
2010-11-23  2:54   ` Namhyung Kim
2010-11-23  4:37 ` Américo Wang
2010-11-23  4:37   ` Américo Wang
2010-11-23  8:22   ` Mel Gorman
2010-11-23  8:22     ` Mel Gorman

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.