The patch titled Subject: scripts: checkversion: modernize linux/version.h search strings has been added to the -mm tree. Its filename is scripts-checkversion-modernize-linux-versionh-search-strings.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/scripts-checkversion-modernize-linux-versionh-search-strings.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/scripts-checkversion-modernize-linux-versionh-search-strings.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> Subject: scripts: checkversion: modernize linux/version.h search strings Update scripts/checkversion.pl to recognize the current contents of <linux/version.h> and both of its current locations. Also update my email address. Link: https://lkml.kernel.org/r/20210727025737.30553-1-rdunlap@xxxxxxxxxxxxx Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx> Cc: Masahiro Yamada <masahiroy@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- scripts/checkversion.pl | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) --- a/scripts/checkversion.pl~scripts-checkversion-modernize-linux-versionh-search-strings +++ a/scripts/checkversion.pl @@ -1,10 +1,10 @@ #! /usr/bin/env perl # SPDX-License-Identifier: GPL-2.0 # -# checkversion find uses of LINUX_VERSION_CODE or KERNEL_VERSION -# without including <linux/version.h>, or cases of -# including <linux/version.h> that don't need it. -# Copyright (C) 2003, Randy Dunlap <rdunlap@xxxxxxxxxxxx> +# checkversion finds uses of all macros in <linux/version.h> +# where the source files do not #include <linux/version.h>; or cases +# of including <linux/version.h> where it is not needed. +# Copyright (C) 2003, Randy Dunlap <rdunlap@xxxxxxxxxxxxx> use strict; @@ -13,7 +13,8 @@ $| = 1; my $debugging; foreach my $file (@ARGV) { - next if $file =~ "include/linux/version\.h"; + next if $file =~ "include/generated/uapi/linux/version\.h"; + next if $file =~ "usr/include/linux/version\.h"; # Open this file. open( my $f, '<', $file ) or die "Can't open $file: $!\n"; @@ -41,8 +42,11 @@ foreach my $file (@ARGV) { $iLinuxVersion = $. if m/^\s*#\s*include\s*<linux\/version\.h>/o; } - # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE - if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) { + # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, + # LINUX_VERSION_MAJOR, LINUX_VERSION_PATCHLEVEL, LINUX_VERSION_SUBLEVEL + if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/) || + ($_ =~ /LINUX_VERSION_MAJOR/) || ($_ =~ /LINUX_VERSION_PATCHLEVEL/) || + ($_ =~ /LINUX_VERSION_SUBLEVEL/)) { $fUseVersion = 1; last if $iLinuxVersion; } _ Patches currently in -mm which might be from rdunlap@xxxxxxxxxxxxx are scripts-check_extable-fix-typo-in-user-error-message.patch scripts-checkversion-modernize-linux-versionh-search-strings.patch