Skip to content

Commit

Permalink
scripts: fix gfp-translate for recent changes to gfp.h
Browse files Browse the repository at this point in the history
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 .

[[email protected]: use `grep -q', per WANG Cong]
Signed-off-by: Mel Gorman <[email protected]>
Cc: Namhyung Kim <[email protected]>
Reviewed-by: WANG Cong <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
gormanm authored and torvalds committed Nov 24, 2010
1 parent da90587 commit 27af038
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/gfp-translate
Original file line number Diff line number Diff line change
Expand Up @@ -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="
Expand Down

0 comments on commit 27af038

Please sign in to comment.