Skip to content

Commit bdcb37a

Browse files
arndbYuryNorov
authored andcommitted
buildid: reduce header file dependencies for module
The vmlinux decompressor code intentionally has only a limited set of included header files, but this started running into a build failure because of the bitmap logic needing linux/errno.h: In file included from include/linux/cpumask.h:12, from include/linux/mm_types_task.h:14, from include/linux/mm_types.h:5, from include/linux/buildid.h:5, from include/linux/module.h:14, from arch/arm/boot/compressed/../../../../lib/lz4/lz4_decompress.c:39, from arch/arm/boot/compressed/../../../../lib/decompress_unlz4.c:10, from arch/arm/boot/compressed/decompress.c:60: include/linux/bitmap.h: In function 'bitmap_allocate_region': include/linux/bitmap.h:527:25: error: 'EBUSY' undeclared (first use in this function) 527 | return -EBUSY; | ^~~~~ include/linux/bitmap.h:527:25: note: each undeclared identifier is reported only once for each function it appears in include/linux/bitmap.h: In function 'bitmap_find_free_region': include/linux/bitmap.h:554:17: error: 'ENOMEM' undeclared (first use in this function) 554 | return -ENOMEM; | ^~~~~~ This is easily avoided by changing linux/buildid.h to no longer depend on linux/mm_types.h, a header that pulls in a huge number of indirect dependencies. Fixes: b9c957f ("bitmap: move bitmap_*_region() functions to bitmap.h") Fixes: bd7525d ("bpf: Move stack_map_get_build_id into lib") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Yury Norov <yury.norov@gmail.com>
1 parent 6cb42f9 commit bdcb37a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/linux/buildid.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
#ifndef _LINUX_BUILDID_H
33
#define _LINUX_BUILDID_H
44

5-
#include <linux/mm_types.h>
5+
#include <linux/types.h>
66

77
#define BUILD_ID_SIZE_MAX 20
88

9+
struct vm_area_struct;
910
int build_id_parse(struct vm_area_struct *vma, unsigned char *build_id,
1011
__u32 *size);
1112
int build_id_parse_buf(const void *buf, unsigned char *build_id, u32 buf_size);

0 commit comments

Comments
 (0)