History

headers_check: don't warn about c++ guards

A recent addition to the DRM tree for 4.7 added 'extern "C"' guards for c++ to all the DRM headers, and that now causes warnings in 'make headers_check': usr/include/drm/amdgpu_drm.h:38: userspace cannot reference function or variable defined in the kernel usr/include/drm/drm.h:63: userspace cannot reference function or variable defined in the kernel usr/include/drm/drm.h:699: userspace cannot reference function or variable defined in the kernel usr/include/drm/drm_fourcc.h:30: userspace cannot reference function or variable defined in the kernel usr/include/drm/drm_mode.h:33: userspace cannot reference function or variable defined in the kernel usr/include/drm/drm_sarea.h:38: userspace cannot reference function or variable defined in the kernel usr/include/drm/exynos_drm.h:21: userspace cannot reference function or variable defined in the kernel usr/include/drm/i810_drm.h:7: userspace cannot reference function or variable defined in the kernel This changes the headers_check.pl script to not warn about this. I'm listing the merge commit as introducing the problem, because there are several patches in this branch that each do this for one file.

Arnd Bergmann committed 10 years ago

Commit 92181d41 parent 84787c51 file · +4 −0Browse files

Unified · Split

scripts/headers_check.pl+4−0
@@ -69,6 +69,10 @@ sub check_declarations · 68 unmodified lines
6969 if ($line =~ m/^void seqbuf_dump\(void\);/) {
7070 return;
7171 }
72+ # drm headers are being C++ friendly
73+ if ($line =~ m/^extern "C"/) {
74+ return;
75+ }
7276 if ($line =~ m/^(\s*extern|unsigned|char|short|int|long|void)\b/) {
7377 printf STDERR "$filename:$lineno: " .
7478 "userspace cannot reference function or " .