scripts: headers_install: fix a false positive
PATCH RESEND 1/1 scripts: headers_install: fix a false positive
The current implementation only handles C89 style comments (/*... */) in the code, and there are false positives for C99 style comments (//...).
This patch fixes this issue.
Signed-off-by Wen Yang <[email protected]>
--- scripts/headers_install.sh | 1 + 1 file changed, 1 insertion(+)
scripts/headers_install.sh +1 -0
@@ -44,6 +44,7 @@ scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $TMPFILE > $OUTFILE # Remove /* ... */ style comments, and find CONFIG_ references in code configs=$(sed -e ' :comment + s://.*:: s:/\*[^*][^*]*:/*: s:/\*\*\**\([^/]\):/*\1: t comment
Signature · 1 line
2.25.1
Quoted 16 lines · Wen Yang
The current implementation only handles C89 style comments (/*... */) in the code, and there are false positives for C99 style comments (//...).
This patch fixes this issue.
Signed-off-by Wen Yang <[email protected]>--- scripts/headers_install.sh | 1 + 1 file changed, 1 insertion(+)scripts/headers_install.sh +0
-0
scripts/headers_install.sh scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $TMPFILE > $OUTFILE · line 47
Quoted 4 lines
scripts/headers_install.sh +1
-0@@ -44,6 +44,7 @@ scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $TMPFILE > $OUTFILE # Remove /* ... */ style comments, and find CONFIG_ references in code configs=$(sed -e ' :comment + s://.*::
This is wrong.
For example, apply the following patch.CONFIG_FOO is outside the comment line,
but it does not detect it.
include/uapi/linux/kernel.h +3 -0
@@ -5,4 +5,7 @@#include <linux/sysinfo.h> #include <linux/const.h> +/* // */ +#define FOO CONFIG_FOO +#endif /* _UAPI_LINUX_KERNEL_H */
Quoted 6 lines
scripts/headers_install.sh +0
-1s:/\*[^*][^*]*:/*: s:/\*\*\**\([^/]\):/*\1: t comment --2.25.1
Signature · 2 lines
Best Regards Masahiro Yamada