]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
riscv: Simplify assignment for UTS_MACHINE
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Sun, 5 Apr 2026 00:42:40 +0000 (18:42 -0600)
committerPaul Walmsley <pjw@kernel.org>
Sun, 5 Apr 2026 00:42:40 +0000 (18:42 -0600)
The BITS variable conveniently allows to simplify the assignment for
UTS_MACHINE.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/20260313164012.1153936-2-u.kleine-koenig@baylibre.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/Makefile

index 371da75a47f96089391f077966af6168f38a5059..87102314103c234f5f5d9fa0145679b0de3f611e 100644 (file)
@@ -28,7 +28,6 @@ endif
 export BITS
 ifeq ($(CONFIG_ARCH_RV64I),y)
        BITS := 64
-       UTS_MACHINE := riscv64
 
        KBUILD_CFLAGS += -mabi=lp64
        KBUILD_AFLAGS += -mabi=lp64
@@ -39,13 +38,14 @@ ifeq ($(CONFIG_ARCH_RV64I),y)
                            -Cno-redzone
 else
        BITS := 32
-       UTS_MACHINE := riscv32
 
        KBUILD_CFLAGS += -mabi=ilp32
        KBUILD_AFLAGS += -mabi=ilp32
        KBUILD_LDFLAGS += -melf32lriscv
 endif
 
+UTS_MACHINE := riscv$(BITS)
+
 # LLVM has an issue with target-features and LTO: https://github.com/llvm/llvm-project/issues/59350
 # Ensure it is aware of linker relaxation with LTO, otherwise relocations may
 # be incorrect: https://github.com/llvm/llvm-project/issues/65090