Skip to contentSkip to conversation

Update reference to include/asm-<arch>

PATCH Applied Geert Uytterhoeven 4 participants 10 messages Dec 5, 2024 – Dec 10, 2024

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Update reference to include/asm-<arch>

Hi all,

Despite "include/asm-<arch>" having been replaced by "arch/<arch>/include/asm" 15 years ago, there are still several references left.

This patch series updates the most visible ones.

Thanks for your comments!

Geert Uytterhoeven (3):
checkpatch: Update reference to include/asm-<arch>
kbuild: Drop support for include/asm-<arch> in headers_check.pl
include: Update references to include/asm-<arch>

 include/asm-generic/syscall.h | 2 +-
 include/linux/bitmap.h        | 2 +-
 include/linux/types.h         | 2 +-
 scripts/checkpatch.pl         | 2 +-
 usr/include/headers_check.pl  | 4 ----
 5 files changed, 4 insertions(+), 8 deletions(-)
Signature · 12 lines
2.34.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
#1 lore raw

PATCH 1/3 checkpatch: Update reference to include/asm-<arch>

"include/asm-<arch>" was replaced by "arch/<arch>/include/asm" a long time ago.

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index 9eed3683ad76caff..dbb9c3c6fe30f906 100755
@@ -2875,7 +2875,7 @@ sub process {
 
 			if ($realfile =~ m@^include/asm/@) {
 				ERROR("MODIFIED_INCLUDE_ASM",
-				      "do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n");
+				      "do not modify files in include/asm, change architecture specific files in arch/<architecture>/include/asm\n" . "$here$rawline\n");
 			}
 			$found_file = 1;
 		}
Signature · 1 line
2.34.1
maintainer
#2 lore raw

Re: [PATCH 1/3] checkpatch: Update reference to include/asm-<arch>

Quoted 2 lines · Geert Uytterhoeven

"include/asm-<arch>" was replaced by "arch/<arch>/include/asm" a long time ago.

Thanks.

Quoted 19 lines
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index 9eed3683ad76caff..dbb9c3c6fe30f906 100755
@@ -2875,7 +2875,7 @@ sub process {
 
 			if ($realfile =~ m@^include/asm/@) {
 				ERROR("MODIFIED_INCLUDE_ASM",
-				      "do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n");
+				      "do not modify files in include/asm, change architecture specific files in arch/<architecture>/include/asm\n" . "$here$rawline\n");
 			}
 			$found_file = 1;
 		}
#3 lore raw

Re: [PATCH 1/3] checkpatch: Update reference to include/asm-<arch>

Quoted 6 lines · Joe Perches
Quoted 2 lines · Geert Uytterhoeven

"include/asm-<arch>" was replaced by "arch/<arch>/include/asm" a long time ago.

Thanks.

Is this check still needed?

include/asm was a symlink to include/asm-<architecture> in the old days, but it no longer exists.

In which case, is this check triggered?

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw

Re: [PATCH 1/3] checkpatch: Update reference to include/asm-<arch>

Hi Yamada-san,

Quoted 11 lines · Masahiro Yamada
Quoted 3 lines · Joe Perches
Quoted 2 lines · Geert Uytterhoeven

"include/asm-<arch>" was replaced by "arch/<arch>/include/asm" a long time ago.

Is this check still needed?

include/asm was a symlink to include/asm-<architecture> in the old days, but it no longer exists.

In which case, is this check triggered?

Someone might still try to create a header file under include/asm/.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#5 lore raw

PATCH 2/3 kbuild: Drop support for include/asm-<arch> in headers_check.pl

In reply to Geert Uytterhoeven

"include/asm-<arch>" was replaced by "arch/<arch>/include/asm" a long time ago. All assembler header files are now included using "#include <asm/*>", so there is no longer a need to rewrite paths.

---
 usr/include/headers_check.pl | 4 ----
 1 file changed, 4 deletions(-)
usr/include/headers_check.pl +0 -4
index b6aec5e4365f9bf2..7070c891ea294b4d 100755
@@ -54,10 +54,6 @@ sub check_include
 		my $inc = $1;
 		my $found;
 		$found = stat($dir . "/" . $inc);
-		if (!$found) {
-			$inc =~ s#asm/#asm-$arch/#;
-			$found = stat($dir . "/" . $inc);
-		}
 		if (!$found) {
 			printf STDERR "$filename:$lineno: included file '$inc' is not exported\n";
 			$ret = 1;
Signature · 1 line
2.34.1
#6 lore raw

Re: [PATCH 2/3] kbuild: Drop support for include/asm-<arch> in headers_check.pl

Quoted 7 lines · Geert Uytterhoeven

"include/asm-<arch>" was replaced by "arch/<arch>/include/asm" a long time ago. All assembler header files are now included using "#include <asm/*>", so there is no longer a need to rewrite paths.

---

After this commit, the second argument $arch is no longer used.

Please clean up

my ($dir, $arch, @files) = @ARGV;

Quoted 22 lines
 usr/include/headers_check.pl | 4 ----
 1 file changed, 4 deletions(-)
usr/include/headers_check.pl +0 -5
index b6aec5e4365f9bf2..7070c891ea294b4d 100755
@@ -54,10 +54,6 @@ sub check_include
                my $inc = $1;
                my $found;
                $found = stat($dir . "/" . $inc);
-               if (!$found) {
-                       $inc =~ s#asm/#asm-$arch/#;
-                       $found = stat($dir . "/" . $inc);
-               }
                if (!$found) {
                        printf STDERR "$filename:$lineno: included file '$inc' is not exported\n";
                        $ret = 1;
--

2.34.1

Signature · 2 lines
Best Regards
Masahiro Yamada
#7 lore raw

Re: [PATCH 2/3] kbuild: Drop support for include/asm-<arch> in headers_check.pl

I applied this with the follow-up squashed. Thanks.
(https://lore.kernel.org/all/CAK7LNAR8dy-=EcsZFb-tjXSk2sK7sHrV0WSSV4E8dzRh5Veceg@mail.gmail.com/T/#t)

This should be dropped from Andrew Morton's tree.

Quoted 44 lines · Masahiro Yamada
Quoted 7 lines · Geert Uytterhoeven

"include/asm-<arch>" was replaced by "arch/<arch>/include/asm" a long time ago. All assembler header files are now included using "#include <asm/*>", so there is no longer a need to rewrite paths.

---

After this commit, the second argument $arch is no longer used.

Please clean up

my ($dir, $arch, @files) = @ARGV;

Quoted 19 lines
 usr/include/headers_check.pl | 4 ----
 1 file changed, 4 deletions(-)
usr/include/headers_check.pl +0 -5
index b6aec5e4365f9bf2..7070c891ea294b4d 100755
@@ -54,10 +54,6 @@ sub check_include
                my $inc = $1;
                my $found;
                $found = stat($dir . "/" . $inc);
-               if (!$found) {
-                       $inc =~ s#asm/#asm-$arch/#;
-                       $found = stat($dir . "/" . $inc);
-               }
                if (!$found) {
                        printf STDERR "$filename:$lineno: included file '$inc' is not exported\n";
                        $ret = 1;
--
Quoted 8 lines
Quoted 3 lines

2.34.1

--
Best Regards
Masahiro Yamada

--
Best Regards
Masahiro Yamada

#8 lore raw

PATCH 3/3 include: Update references to include/asm-<arch>

In reply to Geert Uytterhoeven

"include/asm-<arch>" was replaced by "arch/<arch>/include/asm" a long time ago.

---
 include/asm-generic/syscall.h | 2 +-
 include/linux/bitmap.h        | 2 +-
 include/linux/types.h         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
include/asm-generic/syscall.h +1 -1
index 5a80fe728dc8b6e1..182b039ce5fa100c 100644
@@ -5,7 +5,7 @@
  * Copyright (C) 2008-2009 Red Hat, Inc.  All rights reserved.
  *
  * This file is a stub providing documentation for what functions
- * asm-ARCH/syscall.h files need to define.  Most arch definitions
+ * arch/ARCH/include/asm/syscall.h files need to define.  Most arch definitions
  * will be simple inlines.
  *
  * All of these functions expect to be called with no locks,
include/linux/bitmap.h +1 -1
index 262b6596eca5eafe..2026953e2c4ed368 100644
@@ -23,7 +23,7 @@ struct device;
  *
  * Function implementations generic to all architectures are in
  * lib/bitmap.c.  Functions implementations that are architecture
- * specific are in various include/asm-<arch>/bitops.h headers
+ * specific are in various arch/<arch>/include/asm/bitops.h headers
  * and other arch/<arch> specific files.
  *
  * See lib/bitmap.c for more details.
include/linux/types.h +1 -1
index 2d7b9ae8714ce522..1c509ce8f7f616e1 100644
@@ -43,7 +43,7 @@ typedef unsigned long		uintptr_t;
 typedef long			intptr_t;
 
 #ifdef CONFIG_HAVE_UID16
-/* This is defined by include/asm-{arch}/posix_types.h */
+/* This is defined by arch/{arch}/include/asm/posix_types.h */
 typedef __kernel_old_uid_t	old_uid_t;
 typedef __kernel_old_gid_t	old_gid_t;
 #endif /* CONFIG_UID16 */
Signature · 1 line
2.34.1
#9 lore raw

Re: [PATCH 3/3] include: Update references to include/asm-<arch>

Quoted 10 lines · Geert Uytterhoeven

"include/asm-<arch>" was replaced by "arch/<arch>/include/asm" a long time ago.

---
 include/asm-generic/syscall.h | 2 +-
 include/linux/bitmap.h        | 2 +-
 include/linux/types.h         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

"git grep include/asm- | grep -v generic"
will find more instances.

Signature · 2 lines
Best Regards
Masahiro Yamada