Skip to content

Commit 27af038

Browse files
gormanmtorvalds
authored andcommitted
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 <mel@csn.ul.ie> Cc: Namhyung Kim <namhyung@gmail.com> Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent da90587 commit 27af038

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎scripts/gfp-translate‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ fi
6363

6464
# Extract GFP flags from the kernel source
6565
TMPFILE=`mktemp -t gfptranslate-XXXXXX` || exit 1
66-
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
66+
grep -q ___GFP $SOURCE/include/linux/gfp.h
67+
if [ $? -eq 0 ]; then
68+
grep "^#define ___GFP" $SOURCE/include/linux/gfp.h | sed -e 's/u$//' | grep -v GFP_BITS > $TMPFILE
69+
else
70+
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
71+
fi
6772

6873
# Parse the flags
6974
IFS="

0 commit comments

Comments
 (0)