Skip to contentSkip to conversation

mm: fix gfp-translate for changes in gfp.h

PATCH New Charan Teja Kalla 1 participant 1 message Jun 13, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: fix gfp-translate for changes in gfp.h

The commit cb5a065b4ea9 ("headers/deps: mm: Split <linux/gfp_types.h> out of <linux/gfp.h>") made all the gfp flags that the gfp-translate script needed to move from gfp.h to gfp_types.h. Made changes accordingly in the gfp-translate scipt.

w/o this patch:
$./scripts/gfp-translate 0xc2cc0
Source: /local/mnt/workspace/linux_next/linux
Parsing: 0xc2cc0

with this patch:
Source: /local/mnt/workspace/linux_next/linux
Parsing: 0xc2cc0

 #define ___GFP_IO               0x40
 #define ___GFP_FS               0x80
 #define ___GFP_DIRECT_RECLAIM   0x400
 #define ___GFP_KSWAPD_RECLAIM   0x800
 #define ___GFP_NOWARN           0x2000
 #define ___GFP_COMP             0x40000
 #define ___GFP_NOMEMALLOC       0x80000
Fixes cb5a065b4ea9 ("headers/deps: mm: Split <linux/gfp_types.h> out of <linux/gfp.h>")
---
 scripts/gfp-translate | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
scripts/gfp-translate +3 -3
index b2ce416..6c9aed1 100755
@@ -63,11 +63,11 @@ fi
 
 # Extract GFP flags from the kernel source
 TMPFILE=`mktemp -t gfptranslate-XXXXXX` || exit 1
-grep -q ___GFP $SOURCE/include/linux/gfp.h
+grep -q ___GFP $SOURCE/include/linux/gfp_types.h
 if [ $? -eq 0 ]; then
-	grep "^#define ___GFP" $SOURCE/include/linux/gfp.h | sed -e 's/u$//' | grep -v GFP_BITS > $TMPFILE
+	grep "^#define ___GFP" $SOURCE/include/linux/gfp_types.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
+	grep "^#define __GFP" $SOURCE/include/linux/gfp_types.h | sed -e 's/(__force gfp_t)//' | sed -e 's/u)/)/' | grep -v GFP_BITS | sed -e 's/)\//) \//' > $TMPFILE
 fi
 
 # Parse the flags
Signature · 1 line
2.7.4