mirror of
https://github.com/torvalds/linux.git
synced 2026-11-10 17:11:02 +01:00
perf pmu: Include the headers that are used
pmu.c uses errno, free() and the str*() functions but declares none of them directly. <string.h> arrives by way of <linux/string.h>, and <errno.h> and <stdlib.h> come from whatever the other headers happen to drag in, which is fragile and breaks on C libraries that don't nest their headers the same way. Include the three directly. <ctype.h> is deliberately not added. The isdigit(), tolower() and toupper() used here are the macros from <linux/ctype.h>, which is included on purpose and documents that it doesn't handle EOF the way the standard C library does, so pulling in <ctype.h> would change which implementation is used. size_t is left alone too, as <stdio.h> is already included directly and declares it. No functional change. Signed-off-by: Ian Rogers <irogers@google.com> Assisted-by: Antigravity:gemini-3.1-pro Acked-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
f963226016
commit
cd1f5f952a
|
|
@ -8,8 +8,11 @@
|
|||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <dirent.h>
|
||||
#include <api/fs/fs.h>
|
||||
#include <api/io.h>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user