Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'kbuild-6.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux

Pull Kbuild updates from Nicolas Schier:

- Enable -fms-extensions, allowing anonymous use of tagged struct or
union in struct/union (tag kbuild-ms-extensions-6.19). An exemplary
conversion patch is added here, too (btrfs).

[ Editor's note: the core of this actually came in early through a
shared branch and a few other trees - Linus ]

- Introduce architecture-specific CC_CAN_LINK and flags for userprogs

- Add new packaging target 'modules-cpio-pkg' for building a initramfs
cpio w/ kmods

- Handle included .c files in gen_compile_commands

- Minor kbuild changes:
- Use objtree for module signing key path, fixing oot kmod signing
- Improve documentation of KBUILD_BUILD_TIMESTAMP
- Reuse KBUILD_USERCFLAGS for UAPI, instead of defining twice
- Rename scripts/Makefile.extrawarn to Makefile.warn
- Drop obsolete types.h check from headers_check.pl
- Remove outdated config leak ignore entries

* tag 'kbuild-6.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux:
kbuild: add target to build a cpio containing modules
initramfs: add gen_init_cpio to hostprogs unconditionally
kbuild: allow architectures to override CC_CAN_LINK
init: deduplicate cc-can-link.sh invocations
kbuild: don't enable CC_CAN_LINK if the dummy program generates warnings
scripts: headers_install.sh: Remove two outdated config leak ignore entries
scripts/clang-tools: Handle included .c files in gen_compile_commands
kbuild: uapi: Drop types.h check from headers_check.pl
kbuild: Rename Makefile.extrawarn to Makefile.warn
MAINTAINERS, .mailmap: Update mail address for Nicolas Schier
kbuild: uapi: reuse KBUILD_USERCFLAGS
kbuild: doc: improve KBUILD_BUILD_TIMESTAMP documentation
kbuild: Use objtree for module signing key path
btrfs: send: make use of -fms-extensions for defining struct fs_path

+207 -115
+2 -2
.mailmap
··· 589 589 Nicolas Pitre <nico@fluxnic.net> <nico@linaro.org> 590 590 Nicolas Saenz Julienne <nsaenz@kernel.org> <nsaenzjulienne@suse.de> 591 591 Nicolas Saenz Julienne <nsaenz@kernel.org> <nsaenzjulienne@suse.com> 592 - Nicolas Schier <nicolas.schier@linux.dev> <n.schier@avm.de> 593 - Nicolas Schier <nicolas.schier@linux.dev> <nicolas@fjasle.eu> 592 + Nicolas Schier <nsc@kernel.org> <n.schier@avm.de> 593 + Nicolas Schier <nsc@kernel.org> <nicolas@fjasle.eu> 594 594 Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> 595 595 Nikolay Aleksandrov <razor@blackwall.org> <naleksan@redhat.com> 596 596 Nikolay Aleksandrov <razor@blackwall.org> <nikolay@redhat.com>
+8 -2
Documentation/kbuild/kbuild.rst
··· 328 328 ---------------------- 329 329 Setting this to a date string overrides the timestamp used in the 330 330 UTS_VERSION definition (uname -v in the running kernel). The value has to 331 - be a string that can be passed to date -d. The default value 332 - is the output of the date command at one point during build. 331 + be a string that can be passed to date -d. E.g.:: 332 + 333 + $ KBUILD_BUILD_TIMESTAMP="Mon Oct 13 00:00:00 UTC 2025" make 334 + 335 + The default value is the output of the date command at one point during 336 + build. If provided, this timestamp will also be used for mtime fields 337 + within any initramfs archive. Initramfs mtimes are 32-bit, so dates before 338 + the 1970 Unix epoch, or after 2106-02-07 06:28:15 UTC will fail. 333 339 334 340 KBUILD_BUILD_USER, KBUILD_BUILD_HOST 335 341 ------------------------------------
+1 -1
MAINTAINERS
··· 13498 13498 13499 13499 KERNEL BUILD + files below scripts/ (unless maintained elsewhere) 13500 13500 M: Nathan Chancellor <nathan@kernel.org> 13501 - M: Nicolas Schier <nicolas@fjasle.eu> 13501 + M: Nicolas Schier <nsc@kernel.org> 13502 13502 L: linux-kbuild@vger.kernel.org 13503 13503 S: Odd Fixes 13504 13504 Q: https://patchwork.kernel.org/project/linux-kbuild/list/
+12 -3
Makefile
··· 1084 1084 endif 1085 1085 1086 1086 # include additional Makefiles when needed 1087 - include-y := scripts/Makefile.extrawarn 1087 + include-y := scripts/Makefile.warn 1088 1088 include-$(CONFIG_DEBUG_INFO) += scripts/Makefile.debug 1089 1089 include-$(CONFIG_DEBUG_INFO_BTF)+= scripts/Makefile.btf 1090 1090 include-$(CONFIG_KASAN) += scripts/Makefile.kasan ··· 1137 1137 LDFLAGS_vmlinux += --emit-relocs --discard-none 1138 1138 endif 1139 1139 1140 - # Align the bit size of userspace programs with the kernel 1141 - USERFLAGS_FROM_KERNEL := -m32 -m64 --target=% 1140 + # Align the architecture of userspace programs with the kernel 1141 + USERFLAGS_FROM_KERNEL := --target=% 1142 + 1143 + ifdef CONFIG_ARCH_USERFLAGS 1144 + KBUILD_USERCFLAGS += $(CONFIG_ARCH_USERFLAGS) 1145 + KBUILD_USERLDFLAGS += $(CONFIG_ARCH_USERFLAGS) 1146 + else 1147 + # If not overridden also inherit the bit size 1148 + USERFLAGS_FROM_KERNEL += -m32 -m64 1149 + endif 1150 + 1142 1151 KBUILD_USERCFLAGS += $(filter $(USERFLAGS_FROM_KERNEL), $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)) 1143 1152 KBUILD_USERLDFLAGS += $(filter $(USERFLAGS_FROM_KERNEL), $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)) 1144 1153
+1 -1
drivers/gpu/drm/Makefile
··· 6 6 CFLAGS-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) += -DDYNAMIC_DEBUG_MODULE 7 7 8 8 # Unconditionally enable W=1 warnings locally 9 - # --- begin copy-paste W=1 warnings from scripts/Makefile.extrawarn 9 + # --- begin copy-paste W=1 warnings from scripts/Makefile.warn 10 10 subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter 11 11 subdir-ccflags-y += $(call cc-option, -Wrestrict) 12 12 subdir-ccflags-y += -Wmissing-format-attribute
+20 -19
fs/btrfs/send.c
··· 47 47 * It allows fast adding of path elements on the right side (normal path) and 48 48 * fast adding to the left side (reversed path). A reversed path can also be 49 49 * unreversed if needed. 50 + * 51 + * The definition of struct fs_path relies on -fms-extensions to allow 52 + * including a tagged struct as an anonymous member. 50 53 */ 51 - struct fs_path { 52 - union { 53 - struct { 54 - char *start; 55 - char *end; 54 + struct __fs_path { 55 + char *start; 56 + char *end; 56 57 57 - char *buf; 58 - unsigned short buf_len:15; 59 - unsigned short reversed:1; 60 - char inline_buf[]; 61 - }; 62 - /* 63 - * Average path length does not exceed 200 bytes, we'll have 64 - * better packing in the slab and higher chance to satisfy 65 - * an allocation later during send. 66 - */ 67 - char pad[256]; 68 - }; 58 + char *buf; 59 + unsigned short buf_len:15; 60 + unsigned short reversed:1; 61 + }; 62 + static_assert(sizeof(struct __fs_path) < 256); 63 + struct fs_path { 64 + struct __fs_path; 65 + /* 66 + * Average path length does not exceed 200 bytes, we'll have 67 + * better packing in the slab and higher chance to satisfy 68 + * an allocation later during send. 69 + */ 70 + char inline_buf[256 - sizeof(struct __fs_path)]; 69 71 }; 70 72 #define FS_PATH_INLINE_SIZE \ 71 - (sizeof(struct fs_path) - offsetof(struct fs_path, inline_buf)) 73 + sizeof_field(struct fs_path, inline_buf) 72 74 73 75 74 76 /* reused for each extent */ ··· 307 305 struct btrfs_lru_cache dir_created_cache; 308 306 struct btrfs_lru_cache dir_utimes_cache; 309 307 310 - /* Must be last as it ends in a flexible-array member. */ 311 308 struct fs_path cur_inode_path; 312 309 }; 313 310
+6 -2
init/Kconfig
··· 82 82 int 83 83 default $(rustc-llvm-version) 84 84 85 + config ARCH_HAS_CC_CAN_LINK 86 + bool 87 + 85 88 config CC_CAN_LINK 86 89 bool 87 - default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m64-flag)) if 64BIT 88 - default $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(m32-flag)) 90 + default ARCH_CC_CAN_LINK if ARCH_HAS_CC_CAN_LINK 91 + default $(cc_can_link_user,$(m64-flag)) if 64BIT 92 + default $(cc_can_link_user,$(m32-flag)) 89 93 90 94 # Fixed in GCC 14, 13.3, 12.4 and 11.5 91 95 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113921
+3
scripts/Kconfig.include
··· 65 65 m32-flag := $(cc-option-bit,-m32) 66 66 m64-flag := $(cc-option-bit,-m64) 67 67 68 + # Test whether the compiler can link userspace applications 69 + cc_can_link_user = $(success,$(srctree)/scripts/cc-can-link.sh $(CC) $(CLANG_FLAGS) $(USERCFLAGS) $(USERLDFLAGS) $(1)) 70 + 68 71 rustc-version := $(shell,$(srctree)/scripts/rustc-version.sh $(RUSTC)) 69 72 rustc-llvm-version := $(shell,$(srctree)/scripts/rustc-llvm-version.sh $(RUSTC)) 70 73
scripts/Makefile.extrawarn scripts/Makefile.warn
+1 -1
scripts/Makefile.modinst
··· 100 100 # Don't stop modules_install even if we can't sign external modules. 101 101 # 102 102 ifeq ($(filter pkcs11:%, $(CONFIG_MODULE_SIG_KEY)),) 103 - sig-key := $(if $(wildcard $(CONFIG_MODULE_SIG_KEY)),,$(srctree)/)$(CONFIG_MODULE_SIG_KEY) 103 + sig-key := $(if $(wildcard $(CONFIG_MODULE_SIG_KEY)),,$(objtree)/)$(CONFIG_MODULE_SIG_KEY) 104 104 else 105 105 sig-key := $(CONFIG_MODULE_SIG_KEY) 106 106 endif
+20
scripts/Makefile.package
··· 189 189 tar%-pkg: linux-$(KERNELRELEASE)-$(ARCH).tar.% FORCE 190 190 @: 191 191 192 + # modules-cpio-pkg - generate an initramfs with the modules 193 + # --------------------------------------------------------------------------- 194 + 195 + .tmp_modules_cpio: FORCE 196 + $(Q)$(MAKE) -f $(srctree)/Makefile 197 + $(Q)rm -rf $@ 198 + $(Q)$(MAKE) -f $(srctree)/Makefile INSTALL_MOD_PATH=$@ modules_install 199 + 200 + quiet_cmd_cpio = CPIO $@ 201 + cmd_cpio = $(CONFIG_SHELL) $(srctree)/usr/gen_initramfs.sh -o $@ $< 202 + 203 + modules-$(KERNELRELEASE)-$(ARCH).cpio: .tmp_modules_cpio 204 + $(Q)$(MAKE) $(build)=usr usr/gen_init_cpio 205 + $(call cmd,cpio) 206 + 207 + PHONY += modules-cpio-pkg 208 + modules-cpio-pkg: modules-$(KERNELRELEASE)-$(ARCH).cpio 209 + @: 210 + 192 211 # perf-tar*-src-pkg - generate a source tarball with perf source 193 212 # --------------------------------------------------------------------------- 194 213 ··· 264 245 @echo ' tarbz2-pkg - Build the kernel as a bzip2 compressed tarball' 265 246 @echo ' tarxz-pkg - Build the kernel as a xz compressed tarball' 266 247 @echo ' tarzst-pkg - Build the kernel as a zstd compressed tarball' 248 + @echo ' modules-cpio-pkg - Build the kernel modules as cpio archive' 267 249 @echo ' perf-tar-src-pkg - Build the perf source tarball with no compression' 268 250 @echo ' perf-targz-src-pkg - Build the perf source tarball with gzip compression' 269 251 @echo ' perf-tarbz2-src-pkg - Build the perf source tarball with bz2 compression'
+1 -1
scripts/cc-can-link.sh
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 4 - cat << "END" | $@ -x c - -o /dev/null >/dev/null 2>&1 4 + cat << "END" | $@ -Werror -Wl,--fatal-warnings -x c - -o /dev/null >/dev/null 2>&1 5 5 #include <stdio.h> 6 6 int main(void) 7 7 {
+128 -7
scripts/clang-tools/gen_compile_commands.py
··· 21 21 _FILENAME_PATTERN = r'^\..*\.cmd$' 22 22 _LINE_PATTERN = r'^(saved)?cmd_[^ ]*\.o := (?P<command_prefix>.* )(?P<file_path>[^ ]*\.[cS]) *(;|$)' 23 23 _VALID_LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] 24 + 25 + # Pre-compiled regexes for better performance 26 + _INCLUDE_PATTERN = re.compile(r'^\s*#\s*include\s*[<"]([^>"]*)[>"]') 27 + _C_INCLUDE_PATTERN = re.compile(r'^\s*#\s*include\s*"([^"]*\.c)"\s*$') 28 + _FILENAME_MATCHER = re.compile(_FILENAME_PATTERN) 29 + 24 30 # The tools/ directory adopts a different build system, and produces .cmd 25 31 # files in a different format. Do not support it. 26 32 _EXCLUDE_DIRS = ['.git', 'Documentation', 'include', 'tools'] ··· 88 82 The path to a .cmd file. 89 83 """ 90 84 91 - filename_matcher = re.compile(_FILENAME_PATTERN) 92 85 exclude_dirs = [ os.path.join(directory, d) for d in _EXCLUDE_DIRS ] 93 86 94 87 for dirpath, dirnames, filenames in os.walk(directory, topdown=True): ··· 97 92 continue 98 93 99 94 for filename in filenames: 100 - if filename_matcher.match(filename): 95 + if _FILENAME_MATCHER.match(filename): 101 96 yield os.path.join(dirpath, filename) 102 97 103 98 ··· 154 149 yield to_cmdfile(mod_line.rstrip()) 155 150 156 151 152 + def extract_includes_from_file(source_file, root_directory): 153 + """Extract #include statements from a C file. 154 + 155 + Args: 156 + source_file: Path to the source .c file to analyze 157 + root_directory: Root directory for resolving relative paths 158 + 159 + Returns: 160 + List of header files that should be included (without quotes/brackets) 161 + """ 162 + includes = [] 163 + if not os.path.exists(source_file): 164 + return includes 165 + 166 + try: 167 + with open(source_file, 'r') as f: 168 + for line in f: 169 + line = line.strip() 170 + # Look for #include statements. 171 + # Match both #include "header.h" and #include <header.h>. 172 + match = _INCLUDE_PATTERN.match(line) 173 + if match: 174 + header = match.group(1) 175 + # Skip including other .c files to avoid circular includes. 176 + if not header.endswith('.c'): 177 + # For relative includes (quoted), resolve path relative to source file. 178 + if '"' in line: 179 + src_dir = os.path.dirname(source_file) 180 + header_path = os.path.join(src_dir, header) 181 + if os.path.exists(header_path): 182 + rel_header = os.path.relpath(header_path, root_directory) 183 + includes.append(rel_header) 184 + else: 185 + includes.append(header) 186 + else: 187 + # System include like <linux/sched.h>. 188 + includes.append(header) 189 + except IOError: 190 + pass 191 + 192 + return includes 193 + 194 + 195 + def find_included_c_files(source_file, root_directory): 196 + """Find .c files that are included by the given source file. 197 + 198 + Args: 199 + source_file: Path to the source .c file 200 + root_directory: Root directory for resolving relative paths 201 + 202 + Yields: 203 + Full paths to included .c files 204 + """ 205 + if not os.path.exists(source_file): 206 + return 207 + 208 + try: 209 + with open(source_file, 'r') as f: 210 + for line in f: 211 + line = line.strip() 212 + # Look for #include "*.c" patterns. 213 + match = _C_INCLUDE_PATTERN.match(line) 214 + if match: 215 + included_file = match.group(1) 216 + # Handle relative paths. 217 + if not os.path.isabs(included_file): 218 + src_dir = os.path.dirname(source_file) 219 + included_file = os.path.join(src_dir, included_file) 220 + 221 + # Normalize the path. 222 + included_file = os.path.normpath(included_file) 223 + 224 + # Check if the file exists. 225 + if os.path.exists(included_file): 226 + yield included_file 227 + except IOError: 228 + pass 229 + 230 + 157 231 def process_line(root_directory, command_prefix, file_path): 158 - """Extracts information from a .cmd line and creates an entry from it. 232 + """Extracts information from a .cmd line and creates entries from it. 159 233 160 234 Args: 161 235 root_directory: The directory that was searched for .cmd files. Usually ··· 244 160 Usually relative to root_directory, but sometimes absolute. 245 161 246 162 Returns: 247 - An entry to append to compile_commands. 163 + A list of entries to append to compile_commands (may include multiple 164 + entries if the source file includes other .c files). 248 165 249 166 Raises: 250 167 ValueError: Could not find the extracted file based on file_path and ··· 261 176 abs_path = os.path.realpath(os.path.join(root_directory, file_path)) 262 177 if not os.path.exists(abs_path): 263 178 raise ValueError('File %s not found' % abs_path) 264 - return { 179 + 180 + entries = [] 181 + 182 + # Create entry for the main source file. 183 + main_entry = { 265 184 'directory': root_directory, 266 185 'file': abs_path, 267 186 'command': prefix + file_path, 268 187 } 188 + entries.append(main_entry) 189 + 190 + # Find and create entries for included .c files. 191 + for included_c_file in find_included_c_files(abs_path, root_directory): 192 + # For included .c files, create a compilation command that: 193 + # 1. Uses the same compilation flags as the parent file 194 + # 2. But compiles the included file directly (not the parent) 195 + # 3. Includes necessary headers from the parent file for proper macro resolution 196 + 197 + # Convert absolute path to relative for the command. 198 + rel_path = os.path.relpath(included_c_file, root_directory) 199 + 200 + # Extract includes from the parent file to provide proper compilation context. 201 + extra_includes = '' 202 + try: 203 + parent_includes = extract_includes_from_file(abs_path, root_directory) 204 + if parent_includes: 205 + extra_includes = ' ' + ' '.join('-include ' + inc for inc in parent_includes) 206 + except IOError: 207 + pass 208 + 209 + included_entry = { 210 + 'directory': root_directory, 211 + 'file': included_c_file, 212 + # Use the same compilation prefix but target the included file directly. 213 + # Add extra headers for proper macro resolution. 214 + 'command': prefix + extra_includes + ' ' + rel_path, 215 + } 216 + entries.append(included_entry) 217 + logging.debug('Added entry for included file: %s', included_c_file) 218 + 219 + return entries 269 220 270 221 271 222 def main(): ··· 334 213 result = line_matcher.match(f.readline()) 335 214 if result: 336 215 try: 337 - entry = process_line(directory, result.group('command_prefix'), 216 + entries = process_line(directory, result.group('command_prefix'), 338 217 result.group('file_path')) 339 - compile_commands.append(entry) 218 + compile_commands.extend(entries) 340 219 except ValueError as err: 341 220 logging.info('Could not add line from %s: %s', 342 221 cmdfile, err)
-2
scripts/headers_install.sh
··· 70 70 # 71 71 # The format is <file-name>:<CONFIG-option> in each line. 72 72 config_leak_ignores=" 73 - arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_16K 74 - arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_4K 75 73 arch/arc/include/uapi/asm/swab.h:CONFIG_ARC_HAS_SWAPE 76 74 arch/arm/include/uapi/asm/ptrace.h:CONFIG_CPU_ENDIAN_BE8 77 75 arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_NO
+2 -2
usr/Makefile
··· 16 16 17 17 $(obj)/initramfs_data.o: $(obj)/initramfs_inc_data 18 18 19 + hostprogs := gen_init_cpio 20 + 19 21 ramfs-input := $(CONFIG_INITRAMFS_SOURCE) 20 22 cpio-data := 21 23 ··· 49 47 ifeq ($(cpio-data),) 50 48 51 49 cpio-data := $(obj)/initramfs_data.cpio 52 - 53 - hostprogs := gen_init_cpio 54 50 55 51 # .initramfs_data.cpio.d is used to identify all files included 56 52 # in initramfs and to detect if any files are added/removed.
+2 -9
usr/include/Makefile
··· 6 6 # 7 7 # -std=c90 (equivalent to -ansi) catches the violation of those. 8 8 # We cannot go as far as adding -Wpedantic since it emits too many warnings. 9 - UAPI_CFLAGS := -std=c90 -Wall -Werror=implicit-function-declaration 9 + UAPI_CFLAGS := -std=c90 -Werror=implicit-function-declaration 10 10 11 - # In theory, we do not care -m32 or -m64 for header compile tests. 12 - # It is here just because CONFIG_CC_CAN_LINK is tested with -m32 or -m64. 13 - UAPI_CFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)) 14 - 15 - # USERCFLAGS might contain sysroot location for CC. 16 - UAPI_CFLAGS += $(USERCFLAGS) 17 - 18 - override c_flags = $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I $(obj) -I $(srctree)/usr/dummy-include 11 + override c_flags = $(KBUILD_USERCFLAGS) $(UAPI_CFLAGS) -Wp,-MMD,$(depfile) -I $(obj) -I $(srctree)/usr/dummy-include 19 12 20 13 # The following are excluded for now because they fail to build. 21 14 #
-63
usr/include/headers_check.pl
··· 39 39 $lineno++; 40 40 &check_include(); 41 41 &check_asm_types(); 42 - &check_sizetypes(); 43 42 &check_declarations(); 44 43 # Dropped for now. Too much noise &check_config(); 45 44 } ··· 99 100 $linux_asm_types = 1; 100 101 printf STDERR "$filename:$lineno: " . 101 102 "include of <linux/types.h> is preferred over <asm/types.h>\n"; 102 - $ret = 1; 103 - } 104 - } 105 - 106 - my $linux_types; 107 - my %import_stack = (); 108 - sub check_include_typesh 109 - { 110 - my $path = $_[0]; 111 - my $import_path; 112 - 113 - my $fh; 114 - my @file_paths = ($path, $dir . "/" . $path, dirname($filename) . "/" . $path); 115 - for my $possible ( @file_paths ) { 116 - if (not $import_stack{$possible} and open($fh, '<', $possible)) { 117 - $import_path = $possible; 118 - $import_stack{$import_path} = 1; 119 - last; 120 - } 121 - } 122 - if (eof $fh) { 123 - return; 124 - } 125 - 126 - my $line; 127 - while ($line = <$fh>) { 128 - if ($line =~ m/^\s*#\s*include\s+<linux\/types.h>/) { 129 - $linux_types = 1; 130 - last; 131 - } 132 - if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) { 133 - check_include_typesh($included); 134 - } 135 - } 136 - close $fh; 137 - delete $import_stack{$import_path}; 138 - } 139 - 140 - sub check_sizetypes 141 - { 142 - if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) { 143 - return; 144 - } 145 - if ($lineno == 1) { 146 - $linux_types = 0; 147 - } elsif ($linux_types >= 1) { 148 - return; 149 - } 150 - if ($line =~ m/^\s*#\s*include\s+<linux\/types.h>/) { 151 - $linux_types = 1; 152 - return; 153 - } 154 - if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) { 155 - check_include_typesh($included); 156 - } 157 - # strip single-line comments, as types may be referenced within them 158 - $line =~ s@/\*.*?\*/@@; 159 - if ($line =~ m/__[us](8|16|32|64)\b/) { 160 - printf STDERR "$filename:$lineno: " . 161 - "found __[us]{8,16,32,64} type " . 162 - "without #include <linux/types.h>\n"; 163 - $linux_types = 2; 164 103 $ret = 1; 165 104 } 166 105 }