]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
kheaders: avoid unnecessary process forks of grep
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 18 Dec 2024 10:37:06 +0000 (19:37 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Fri, 10 Jan 2025 14:01:22 +0000 (23:01 +0900)
Exclude include/generated/{utsversion.h,autoconf.h} by using the -path
option to reduce the cost of forking new processes.

No functional changes are intended.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
kernel/gen_kheaders.sh

index a0e3fbf4afa4299f4aa055090da691961e50cf53..c2eba1a0d772e87d2775c8f7a22842c026b6501e 100755 (executable)
@@ -48,9 +48,9 @@ all_dirs="$all_dirs $dir_list"
 # check include/generated/autoconf.h explicitly.
 #
 # Ignore them for md5 calculation to avoid pointless regeneration.
-headers_md5="$(find $all_dirs -name "*.h"                      |
-               grep -v "include/generated/utsversion.h"        |
-               grep -v "include/generated/autoconf.h"  |
+headers_md5="$(find $all_dirs -name "*.h" -a                   \
+               ! -path include/generated/utsversion.h -a       \
+               ! -path include/generated/autoconf.h            |
                xargs ls -l | md5sum | cut -d ' ' -f1)"
 
 # Any changes to this script will also cause a rebuild of the archive.