Skip to content

Commit 8a7eab2

Browse files
dhowellstorvalds
authored andcommitted
UAPI: Strip _UAPI prefix on header install no matter the whitespace
Commit 56c176c ("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: David Howells <dhowell@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 3d33fcc commit 8a7eab2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/headers_install.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
$line =~ s/(^|\s)(inline)\b/$1__$2__/g;
4343
$line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;
4444
$line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g;
45-
$line =~ s/#ifndef _UAPI/#ifndef /;
46-
$line =~ s/#define _UAPI/#define /;
47-
$line =~ s!#endif /[*] _UAPI!#endif /* !;
45+
$line =~ s/#ifndef\s+_UAPI/#ifndef /;
46+
$line =~ s/#define\s+_UAPI/#define /;
47+
$line =~ s!#endif\s+/[*]\s*_UAPI!#endif /* !;
4848
printf {$out} "%s", $line;
4949
}
5050
close $out;

0 commit comments

Comments
 (0)