From: Mel Gorman Date: Wed, 24 Nov 2010 20:57:17 +0000 (-0800) Subject: scripts: fix gfp-translate for recent changes to gfp.h X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=27af038494ef2f3f3a23aa040bfc1ea29d99d76d;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git scripts: fix gfp-translate for recent changes to gfp.h 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 . [akpm@linux-foundation.org: use `grep -q', per WANG Cong] Signed-off-by: Mel Gorman Cc: Namhyung Kim Reviewed-by: WANG Cong Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/gfp-translate b/scripts/gfp-translate index d81b968d864..c9230e158a8 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 -q ___GFP $SOURCE/include/linux/gfp.h +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="