提交 8a7eab2b 编写于 作者: D David Howells 提交者: Linus Torvalds

UAPI: Strip _UAPI prefix on header install no matter the whitespace

Commit 56c176c9 ("UAPI: strip the _UAPI prefix from header guards
during header installation") strips the _UAPI prefix from header guards,
but only if there's a single space between the cpp directive and the
label.

Make it more flexible and able to handle tabs and multiple white space
characters.
Signed-off-by: NDavid Howells <dhowell@redhat.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 3d33fcc1
......@@ -42,9 +42,9 @@ foreach my $filename (@files) {
$line =~ s/(^|\s)(inline)\b/$1__$2__/g;
$line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;
$line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g;
$line =~ s/#ifndef _UAPI/#ifndef /;
$line =~ s/#define _UAPI/#define /;
$line =~ s!#endif /[*] _UAPI!#endif /* !;
$line =~ s/#ifndef\s+_UAPI/#ifndef /;
$line =~ s/#define\s+_UAPI/#define /;
$line =~ s!#endif\s+/[*]\s*_UAPI!#endif /* !;
printf {$out} "%s", $line;
}
close $out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册