aboutsummaryrefslogtreecommitdiff
path: root/scripts/headers_check.pl
AgeCommit message (Collapse)AuthorFilesLines
2016-05-24headers_check: don't warn about c++ guardsArnd Bergmann1-0/+4
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. Signed-off-by: Arnd Bergmann <[email protected]> Fixes: 7c10ddf87472 ("Merge branch 'drm-uapi-extern-c-fixes' of https://github.com/evelikov/linux into drm-next") Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2014-08-20kbuild: Make scripts executableMichal Marek1-0/+0
The Makefiles call the respective interpreter explicitly, but this makes it easier to use the scripts manually. Signed-off-by: Michal Marek <[email protected]>
2014-01-23headers_check: special case seqbuf_dump()Paul Bolle1-1/+5
"make headers_check" warns about soundcard.h for (at least) five years now: [...]/usr/include/linux/soundcard.h:1054: userspace cannot reference function or variable defined in the kernel We're apparently stuck with providing OSSlib-3.8 compatibility, so let's special case this declaration just to silence it. Notes: 0) Support for OSSlib post 3.8 was already removed in commit 43a990765a ("sound: Remove OSSlib stuff from linux/soundcard.h"). Five years have passed since that commit: do people still care about OSSlib-3.8? If not, quite a bit of code could be remove from soundcard.h (and probably ultrasound.h). 2) By the way, what is actually meant by: It is no longer possible to actually link against OSSlib with this header, but we still provide these macros for programs using them. Doesn't that mean compatibility to OSSlib isn't even useful? 3) Anyhow, a previous discussion soundcard.h, which led to that commit, starts at https://lkml.org/lkml/2009/1/20/349 . 4) And, yes, I sneaked in a whitespace fix. Signed-off-by: Paul Bolle <[email protected]> Cc: Takashi Iwai <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Cc: Michal Marek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-03-26headers_check: recursively search for linux/types.h inclusionBobby Powers1-1/+37
headers_check.pl currently emits some spurious warnings, especially for the drm headers, about using __[us]{8,16,32,64} types without including linux/types.h. Recursively search for types.h inclusion, avoiding circular references. Signed-off-by: Bobby Powers <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Dave Airlie <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2010-12-14headers_check: Fix warning text[email protected]1-2/+2
Fix the warning text too, per Randy. Cc: Alexander Shishkin <[email protected]> Cc: Michal Marek <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: WANG Cong <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2010-12-14headers_check: better search for functions in headers[email protected]1-1/+1
Some headers don't bother with "extern" in function prototypes, which results in said prototypes being unnoticed and exported to userland. This patch slightly improves detection of such cases by checking for C type names as well in the beginning of a line. Signed-off-by: Alexander Shishkin <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: Michal Marek <[email protected]> Cc: WANG Cong <[email protected]> Cc: Randy Dunlap <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2010-03-07headers_check: fix perl warningsStephen Hemminger1-5/+6
According to PBP; best way practice is to use local reference for file handle and three argument open. Also perl prototypes are a mistake. Signed-off-by: Stephen Hemminger <[email protected]> Acked-by: WANG Cong <[email protected]> Cc: Michal Marek <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Michal Marek <[email protected]>
2009-06-09kbuild/headers_check: refine extern checkAmerigo Wang1-5/+7
'extern' checking information is not clear, refine it. Plus, fix a comment. Signed-off-by: WANG Cong <[email protected]> [sam: redid the extern error message] Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]>
2009-06-09scripts/headers_check.pl: correct RE in header CONFIG leak checkRobert P. J. Day1-1/+1
Correct the regular expression in scripts/headers_check.pl to include '_' as a valid character in the class; otherwise, the check will report a "leaked" symbol of CONFIG_A_B_C as merely CONFIG_A. This patch will make no difference whatsoever in the current kernel tree as the call to the perl routine that does that check is currently commented out: &check_include(); &check_asm_types(); &check_sizetypes(); &check_prototypes(); # Dropped for now. Too much noise &check_config(); However, I noticed that problem when I was building the yum downloadable kernel source rpm for fedora 11 (beta), which *does* run that check, and that's where the problem became obvious. Signed-off-by: Robert P. J. Day <[email protected]> Cc: David Woodhouse <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]>
2009-01-31kbuild: drop check for CONFIG_ in headers_checkSam Ravnborg1-1/+1
The check for references to CONFIG_ symbols in exported headers turned out to be too agressive with the current state of affairs. After the work of Jaswinder to clean up all relevant cases we are down to almost pure noise. So lets drop the check for now - we can always add it back later should our headers be ready for that. Signed-off-by: Sam Ravnborg <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
2009-01-02kbuild: ignore a few files in headers_checkSam Ravnborg1-0/+6
The new check for asm/types.h and linux/types.h had a few false positives. o We cannot let linux/types.h include linux/types.h o The int-ll64.h and int-ll64.h define the types and are included by linux/types.h Handle this by hardcoding the filenames in the headers_check script. Signed-off-by: Sam Ravnborg <[email protected]>
2009-01-02kbuild: add checks for include of linux/types in userspace headersSam Ravnborg1-3/+44
If we see __[us](8|16|32|64) then we must include <linux/types.h> If wee see include of <asm/types.h> then we recommend <linux/types.h> Original script from Mike but modified by me. Cc: Mike Frysinger <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]>
2009-01-02kbuild: check for leaked CONFIG_ symbols to userspaceSam Ravnborg1-1/+10
Signed-off-by: Sam Ravnborg <[email protected]>
2009-01-02headers_check.pl: disallow extern'sMike Frysinger1-1/+11
Since prototypes with "extern" refer to kernel functions, they make no sense in userspace, so reject them automatically. Signed-off-by: Mike Frysinger <[email protected]> [sam: made it into a warning] Signed-off-by: Sam Ravnborg <[email protected]>
2008-10-29Fix incompatibility with versions of Perl less than 5.6.0Jeremy Huntwork1-5/+5
Fix headers_install.pl and headers_check.pl to be compatible with versions of Perl less than 5.6.0. It has been tested with Perl 5.005_03 and 5.8.8. I realize this may not be an issue for most people, but there will still be some that hit it, I imagine. There are three basic issues: 1. Prior to 5.6.0 open() only used 2 arguments, and the versions of the scripts in 2.6.27.1 use 3. 2. 5.6.0 also introduced the ability to use uninitialized scalar variables as file handles, which the current scripts make use of. 3. Lastly, 5.6.0 also introduced the pragma 'use warnings'. We can use the -w switch and be backwards compatible. Signed-off-by: Jeremy Huntwork <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]>
2008-07-25kbuild: optimize headers_* targetsSam Ravnborg1-0/+56
Move the core functionality of headers_install and headers_check to two small perl scripts. The makefile is adapted to use the perl scrip and changed to operate on all files in a directory. So if one file is changed then all files in the directory is processed. perl were chosen for the helper scripts because this is pure text processing which perl is good at and especially the headers_check.pl script are expected to see changes / new checks implmented. The speed is ~300% faster on this box. And the output generated to the screen is now down to two lines per directory (one for install, one for check) so it is easier to scroll back after a kernel build. The perl scripts has been brought to sanity by patient feedback from: Vegard Nossum <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]>