From 99e487db5c15a1630b186571c3734f4e3c751d0a Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 18 Sep 2024 12:15:34 +0900 Subject: [PATCH 1/3] xtensa: annotate dtb_start variable as static __initdata The 'dtb_start' variable is only used within arch/xtensa/kernel/setup.c. Mark it as 'static'. It is only used by parse_tag_fdt() and init_arch(), both of which are annotated as __init. Therefore, dtb_start can be annotated as __initdata, so it will discarded after boot. Signed-off-by: Masahiro Yamada Message-Id: <20240918031537.588965-1-masahiroy@kernel.org> Signed-off-by: Max Filippov --- arch/xtensa/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index bdec4a773af0..3e076b64cc61 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c @@ -55,7 +55,7 @@ extern int initrd_below_start_ok; #endif #ifdef CONFIG_USE_OF -void *dtb_start = __dtb_start; +static void *dtb_start __initdata = __dtb_start; #endif extern unsigned long loops_per_jiffy; From 5055d82bcebfba915b1a10b6abcbfa0212c96f35 Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Mon, 9 Dec 2024 12:08:56 +0100 Subject: [PATCH 2/3] xtensa: Remove zero-length alignment array Align the whole struct to 16 bytes instead of using a zero-length alignment array. Signed-off-by: Thorsten Blum Message-Id: <20241209110856.40132-3-thorsten.blum@linux.dev> Signed-off-by: Max Filippov --- arch/xtensa/include/asm/processor.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h index 7ed1a2085bd7..47b5df86ab5c 100644 --- a/arch/xtensa/include/asm/processor.h +++ b/arch/xtensa/include/asm/processor.h @@ -160,9 +160,7 @@ struct thread_struct { struct perf_event *ptrace_bp[XCHAL_NUM_IBREAK]; struct perf_event *ptrace_wp[XCHAL_NUM_DBREAK]; #endif - /* Make structure 16 bytes aligned. */ - int align[0] __attribute__ ((aligned(16))); -}; +} __aligned(16); /* This decides where the kernel will search for a free chunk of vm * space during mmap's. From d14b9a713b3458ce4908ca883c7277f0863cfe21 Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Tue, 10 Dec 2024 12:09:33 +0100 Subject: [PATCH 3/3] xtensa/simdisk: Use str_write_read() helper in simdisk_transfer() Remove hard-coded strings by using the str_write_read() helper. Signed-off-by: Thorsten Blum Message-Id: <20241210110935.104919-2-thorsten.blum@linux.dev> Signed-off-by: Max Filippov --- arch/xtensa/platforms/iss/simdisk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/xtensa/platforms/iss/simdisk.c b/arch/xtensa/platforms/iss/simdisk.c index d6d2b533a574..6ed009318d24 100644 --- a/arch/xtensa/platforms/iss/simdisk.c +++ b/arch/xtensa/platforms/iss/simdisk.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -75,7 +76,7 @@ static void simdisk_transfer(struct simdisk *dev, unsigned long sector, if (offset > dev->size || dev->size - offset < nbytes) { pr_notice("Beyond-end %s (%ld %ld)\n", - write ? "write" : "read", offset, nbytes); + str_write_read(write), offset, nbytes); return; }