|
1 | 1 | #! /usr/bin/env perl
|
2 | 2 | # SPDX-License-Identifier: GPL-2.0
|
3 | 3 | #
|
4 |
| -# checkversion find uses of LINUX_VERSION_CODE or KERNEL_VERSION |
5 |
| -# without including <linux/version.h>, or cases of |
6 |
| -# including <linux/version.h> that don't need it. |
7 |
| -# Copyright (C) 2003, Randy Dunlap <rdunlap@xenotime.net> |
| 4 | +# checkversion finds uses of all macros in <linux/version.h> |
| 5 | +# where the source files do not #include <linux/version.h>; or cases |
| 6 | +# of including <linux/version.h> where it is not needed. |
| 7 | +# Copyright (C) 2003, Randy Dunlap <rdunlap@infradead.org> |
8 | 8 |
|
9 | 9 | use strict;
|
10 | 10 |
|
|
13 | 13 | my $debugging;
|
14 | 14 |
|
15 | 15 | foreach my $file (@ARGV) {
|
16 |
| - next if $file =~ "include/linux/version\.h"; |
| 16 | + next if $file =~ "include/generated/uapi/linux/version\.h"; |
| 17 | + next if $file =~ "usr/include/linux/version\.h"; |
17 | 18 | # Open this file.
|
18 | 19 | open( my $f, '<', $file )
|
19 | 20 | or die "Can't open $file: $!\n";
|
|
41 | 42 | $iLinuxVersion = $. if m/^\s*#\s*include\s*<linux\/version\.h>/o;
|
42 | 43 | }
|
43 | 44 |
|
44 |
| - # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, UTS_RELEASE |
45 |
| - if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/)) { |
| 45 | + # Look for uses: LINUX_VERSION_CODE, KERNEL_VERSION, |
| 46 | + # LINUX_VERSION_MAJOR, LINUX_VERSION_PATCHLEVEL, LINUX_VERSION_SUBLEVEL |
| 47 | + if (($_ =~ /LINUX_VERSION_CODE/) || ($_ =~ /\WKERNEL_VERSION/) || |
| 48 | + ($_ =~ /LINUX_VERSION_MAJOR/) || ($_ =~ /LINUX_VERSION_PATCHLEVEL/) || |
| 49 | + ($_ =~ /LINUX_VERSION_SUBLEVEL/)) { |
46 | 50 | $fUseVersion = 1;
|
47 | 51 | last if $iLinuxVersion;
|
48 | 52 | }
|
|
0 commit comments