public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/16] xtensa: fix W=1 build warnings
@ 2023-09-20  5:21 Randy Dunlap
  2023-09-20  5:21 ` [PATCH 01/16] xtensa: FSF: define XCHAL_HAVE_DIV32 Randy Dunlap
                   ` (16 more replies)
  0 siblings, 17 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Chris Zankel, Max Filippov, Thomas Gleixner,
	Marc Zyngier

This series fixes all xtensa W=1 build warnings that I have seen
with the exception of some in arch/xtensa/boot/. [1]

These have been through defconfig, allnoconfig, tinyconfig, allyesconfig,
allmodconfig, and many randconfig builds.

 [PATCH 01/16] xtensa: FSF: define XCHAL_HAVE_DIV32
 [PATCH 02/16] xtensa: fault: include <asm/traps.h>
 [PATCH 03/16] xtensa: irq: include <asm/traps.h>
 [PATCH 04/16] xtensa: ptrace: add prototypes to <asm/ptrace.h>
 [PATCH 05/16] xtensa: processor.h: add init_arch() prototype
 [PATCH 06/16] xtensa: signal: include headers for function prototypes
 [PATCH 07/16] xtensa: stacktrace: include <asm/ftrace.h> for prototype
 [PATCH 08/16] xtensa: traps: add <linux/cpu.h> for function prototype
 [PATCH 09/16] irqchip: irq-xtensa-mx: include header for missing prototype
 [PATCH 10/16] xtensa: smp: add headers for missing function prototypes
 [PATCH 11/16] xtensa: hw_breakpoing: include header for missing prototype
 [PATCH 12/16] xtensa: tlb: include <asm/tlb.h> for missing prototype
 [PATCH 13/16] xtensa: iss/network: make functions static
 [PATCH 14/16] xtensa: boot: don't add include-dirs
 [PATCH 15/16] xtensa: umulsidi3: fix conditional expression
 [PATCH 16/16] xtensa: boot/lib: add missing prototypes for functions

1:
arch/xtensa/boot/boot-elf/bootstrap.S:68: Warning: value 0x1a0003000 truncated to 0xa0003000

 arch/xtensa/boot/Makefile                       |    3 +--
 arch/xtensa/boot/lib/zmem.c                     |    4 ++++
 arch/xtensa/include/asm/hw_breakpoint.h         |    1 +
 arch/xtensa/include/asm/processor.h             |    5 +++++
 arch/xtensa/include/asm/ptrace.h                |    3 +++
 arch/xtensa/include/asm/smp.h                   |    1 +
 arch/xtensa/include/asm/tlb.h                   |    2 ++
 arch/xtensa/kernel/hw_breakpoint.c              |    1 +
 arch/xtensa/kernel/irq.c                        |    1 +
 arch/xtensa/kernel/ptrace.c                     |    1 -
 arch/xtensa/kernel/signal.c                     |    2 ++
 arch/xtensa/kernel/smp.c                        |    1 +
 arch/xtensa/kernel/stacktrace.c                 |    1 +
 arch/xtensa/kernel/traps.c                      |    1 +
 arch/xtensa/lib/umulsidi3.S                     |    4 +++-
 arch/xtensa/mm/fault.c                          |    1 +
 arch/xtensa/mm/tlb.c                            |    1 +
 arch/xtensa/platforms/iss/network.c             |    4 ++--
 arch/xtensa/variants/fsf/include/variant/core.h |    1 +
 drivers/irqchip/irq-xtensa-mx.c                 |    1 +
 20 files changed, 33 insertions(+), 6 deletions(-)

Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Marc Zyngier <maz@kernel.org>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 01/16] xtensa: FSF: define XCHAL_HAVE_DIV32
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20 11:53   ` Max Filippov
  2023-09-20  5:21 ` [PATCH 02/16] xtensa: fault: include <asm/traps.h> Randy Dunlap
                   ` (15 subsequent siblings)
  16 siblings, 1 reply; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, kernel test robot, Chris Zankel, Max Filippov

When variant FSF is set, XCHAL_HAVE_DIV32 is not defined,
so add the define for FSF to prevent build warnings:

arch/xtensa/lib/divsi3.S:9:5: warning: "XCHAL_HAVE_DIV32" is not defined, evaluates to 0 [-Wundef]
    9 | #if XCHAL_HAVE_DIV32
arch/xtensa/lib/modsi3.S:9:5: warning: "XCHAL_HAVE_DIV32" is not defined, evaluates to 0 [-Wundef]
    9 | #if XCHAL_HAVE_DIV32

Fixes: 173d6681380a ("xtensa: remove extra header files")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: lore.kernel.org/r/202309150556.t0yCdv3g-lkp@intel.com
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/variants/fsf/include/variant/core.h |    1 +
 1 file changed, 1 insertion(+)

diff -- a/arch/xtensa/variants/fsf/include/variant/core.h b/arch/xtensa/variants/fsf/include/variant/core.h
--- a/arch/xtensa/variants/fsf/include/variant/core.h
+++ b/arch/xtensa/variants/fsf/include/variant/core.h
@@ -41,6 +41,7 @@
 #define XCHAL_HAVE_MUL16		0	/* MUL16S/MUL16U instructions */
 #define XCHAL_HAVE_MUL32		0	/* MULL instruction */
 #define XCHAL_HAVE_MUL32_HIGH		0	/* MULUH/MULSH instructions */
+#define XCHAL_HAVE_DIV32		0	/* QUOS/QUOU/REMS/REMU instructions */
 #define XCHAL_HAVE_L32R			1	/* L32R instruction */
 #define XCHAL_HAVE_ABSOLUTE_LITERALS	1	/* non-PC-rel (extended) L32R */
 #define XCHAL_HAVE_CONST16		0	/* CONST16 instruction */

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 02/16] xtensa: fault: include <asm/traps.h>
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
  2023-09-20  5:21 ` [PATCH 01/16] xtensa: FSF: define XCHAL_HAVE_DIV32 Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  5:21 ` [PATCH 03/16] xtensa: irq: " Randy Dunlap
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Use <asm/traps.h> to provide the function prototype for do_page_fault()
to prevent a build warning:

arch/xtensa/mm/fault.c:87:6: warning: no previous prototype for 'do_page_fault' [-Wmissing-prototypes]
   87 | void do_page_fault(struct pt_regs *regs)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/mm/fault.c |    1 +
 1 file changed, 1 insertion(+)

diff -- a/arch/xtensa/mm/fault.c b/arch/xtensa/mm/fault.c
--- a/arch/xtensa/mm/fault.c
+++ b/arch/xtensa/mm/fault.c
@@ -20,6 +20,7 @@
 #include <asm/mmu_context.h>
 #include <asm/cacheflush.h>
 #include <asm/hardirq.h>
+#include <asm/traps.h>
 
 void bad_page_fault(struct pt_regs*, unsigned long, int);
 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 03/16] xtensa: irq: include <asm/traps.h>
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
  2023-09-20  5:21 ` [PATCH 01/16] xtensa: FSF: define XCHAL_HAVE_DIV32 Randy Dunlap
  2023-09-20  5:21 ` [PATCH 02/16] xtensa: fault: include <asm/traps.h> Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  5:21 ` [PATCH 04/16] xtensa: ptrace: add prototypes to <asm/ptrace.h> Randy Dunlap
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Use <asm/traps.h> to provide the function prototype for do_IRQ()
to prevent a build warning:

arch/xtensa/kernel/irq.c:34:17: warning: no previous prototype for 'do_IRQ' [-Wmissing-prototypes]
   34 | asmlinkage void do_IRQ(int hwirq, struct pt_regs *regs)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/kernel/irq.c |    1 +
 1 file changed, 1 insertion(+)

diff -- a/arch/xtensa/kernel/irq.c b/arch/xtensa/kernel/irq.c
--- a/arch/xtensa/kernel/irq.c
+++ b/arch/xtensa/kernel/irq.c
@@ -28,6 +28,7 @@
 #include <asm/mxregs.h>
 #include <linux/uaccess.h>
 #include <asm/platform.h>
+#include <asm/traps.h>
 
 DECLARE_PER_CPU(unsigned long, nmi_count);
 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 04/16] xtensa: ptrace: add prototypes to <asm/ptrace.h>
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (2 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 03/16] xtensa: irq: " Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  5:21 ` [PATCH 05/16] xtensa: processor.h: add init_arch() prototype Randy Dunlap
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Add prototype for do_syscall_trace_enter() to asm/ptrace.h.
Move prototype for do_syscall_trace_leave() there to be consistent.

Fixes a build warning:

arch/xtensa/kernel/ptrace.c:545:5: warning: no previous prototype for 'do_syscall_trace_enter' [-Wmissing-prototypes]
  545 | int do_syscall_trace_enter(struct pt_regs *regs)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/include/asm/ptrace.h |    3 +++
 arch/xtensa/kernel/ptrace.c      |    1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff -- a/arch/xtensa/include/asm/ptrace.h b/arch/xtensa/include/asm/ptrace.h
--- a/arch/xtensa/include/asm/ptrace.h
+++ b/arch/xtensa/include/asm/ptrace.h
@@ -106,6 +106,9 @@ static inline unsigned long regs_return_
 	return regs->areg[2];
 }
 
+int do_syscall_trace_enter(struct pt_regs *regs);
+void do_syscall_trace_leave(struct pt_regs *regs);
+
 #else	/* __ASSEMBLY__ */
 
 # include <asm/asm-offsets.h>
diff -- a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c
--- a/arch/xtensa/kernel/ptrace.c
+++ b/arch/xtensa/kernel/ptrace.c
@@ -541,7 +541,6 @@ long arch_ptrace(struct task_struct *chi
 	return ret;
 }
 
-void do_syscall_trace_leave(struct pt_regs *regs);
 int do_syscall_trace_enter(struct pt_regs *regs)
 {
 	if (regs->syscall == NO_SYSCALL)

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 05/16] xtensa: processor.h: add init_arch() prototype
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (3 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 04/16] xtensa: ptrace: add prototypes to <asm/ptrace.h> Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  5:21 ` [PATCH 06/16] xtensa: signal: include headers for function prototypes Randy Dunlap
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Add the prototype for init_arch() to asm/processor.h to prevent a
build warning:

arch/xtensa/kernel/setup.c:244:13: warning: no previous prototype for 'init_arch' [-Wmissing-prototypes]
  244 | void __init init_arch(bp_tag_t *bp_start)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/include/asm/processor.h |    4 ++++
 1 file changed, 4 insertions(+)

diff -- a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h
--- a/arch/xtensa/include/asm/processor.h
+++ b/arch/xtensa/include/asm/processor.h
@@ -14,6 +14,8 @@
 
 #include <linux/compiler.h>
 #include <linux/stringify.h>
+
+#include <asm/bootparam.h>
 #include <asm/ptrace.h>
 #include <asm/types.h>
 #include <asm/regs.h>
@@ -217,6 +219,8 @@ struct mm_struct;
 
 extern unsigned long __get_wchan(struct task_struct *p);
 
+void init_arch(bp_tag_t *bp_start);
+
 #define KSTK_EIP(tsk)		(task_pt_regs(tsk)->pc)
 #define KSTK_ESP(tsk)		(task_pt_regs(tsk)->areg[1])
 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 06/16] xtensa: signal: include headers for function prototypes
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (4 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 05/16] xtensa: processor.h: add init_arch() prototype Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  5:21 ` [PATCH 07/16] xtensa: stacktrace: include <asm/ftrace.h> for prototype Randy Dunlap
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Add <asm/syscall.h> to satisfy the xtensa_rt_sigreturn() prototype
warning.
Add <asm/processor.h> to satisfy the do_notify_resume() prototype
warning.

arch/xtensa/kernel/signal.c:246:17: warning: no previous prototype for 'xtensa_rt_sigreturn' [-Wmissing-prototypes]
arch/xtensa/kernel/signal.c:525:6: warning: no previous prototype for 'do_notify_resume' [-Wmissing-prototypes]
  525 | void do_notify_resume(struct pt_regs *regs)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/include/asm/processor.h |    1 +
 arch/xtensa/kernel/signal.c         |    2 ++
 2 files changed, 3 insertions(+)

diff -- a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c
--- a/arch/xtensa/kernel/signal.c
+++ b/arch/xtensa/kernel/signal.c
@@ -26,6 +26,8 @@
 #include <linux/uaccess.h>
 #include <asm/cacheflush.h>
 #include <asm/coprocessor.h>
+#include <asm/processor.h>
+#include <asm/syscall.h>
 #include <asm/unistd.h>
 
 extern struct task_struct *coproc_owners[];
diff -- a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h
--- a/arch/xtensa/include/asm/processor.h
+++ b/arch/xtensa/include/asm/processor.h
@@ -220,6 +220,7 @@ struct mm_struct;
 extern unsigned long __get_wchan(struct task_struct *p);
 
 void init_arch(bp_tag_t *bp_start);
+void do_notify_resume(struct pt_regs *regs);
 
 #define KSTK_EIP(tsk)		(task_pt_regs(tsk)->pc)
 #define KSTK_ESP(tsk)		(task_pt_regs(tsk)->areg[1])

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 07/16] xtensa: stacktrace: include <asm/ftrace.h> for prototype
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (5 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 06/16] xtensa: signal: include headers for function prototypes Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  5:21 ` [PATCH 08/16] xtensa: traps: add <linux/cpu.h> for function prototype Randy Dunlap
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Use <asm/ftrace.h> to prevent a build warning:

arch/xtensa/kernel/stacktrace.c:263:15: warning: no previous prototype for 'return_address' [-Wmissing-prototypes]
  263 | unsigned long return_address(unsigned level)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/kernel/stacktrace.c |    1 +
 1 file changed, 1 insertion(+)

diff -- a/arch/xtensa/kernel/stacktrace.c b/arch/xtensa/kernel/stacktrace.c
--- a/arch/xtensa/kernel/stacktrace.c
+++ b/arch/xtensa/kernel/stacktrace.c
@@ -12,6 +12,7 @@
 #include <linux/sched.h>
 #include <linux/stacktrace.h>
 
+#include <asm/ftrace.h>
 #include <asm/stacktrace.h>
 #include <asm/traps.h>
 #include <linux/uaccess.h>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 08/16] xtensa: traps: add <linux/cpu.h> for function prototype
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (6 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 07/16] xtensa: stacktrace: include <asm/ftrace.h> for prototype Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  5:21 ` [PATCH 09/16] irqchip: irq-xtensa-mx: include header for missing prototype Randy Dunlap
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Use <linux/cpu.h> to provide the prototype for trap_init(), to prevent
a build warning:

arch/xtensa/kernel/traps.c:484:13: warning: no previous prototype for 'trap_init' [-Wmissing-prototypes]
  484 | void __init trap_init(void)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/kernel/traps.c |    1 +
 1 file changed, 1 insertion(+)

diff -- a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -23,6 +23,7 @@
  * for more details.
  */
 
+#include <linux/cpu.h>
 #include <linux/kernel.h>
 #include <linux/sched/signal.h>
 #include <linux/sched/debug.h>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 09/16] irqchip: irq-xtensa-mx: include header for missing prototype
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (7 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 08/16] xtensa: traps: add <linux/cpu.h> for function prototype Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  9:51   ` Marc Zyngier
  2023-09-20  5:21 ` [PATCH 10/16] xtensa: smp: add headers for missing function prototypes Randy Dunlap
                   ` (7 subsequent siblings)
  16 siblings, 1 reply; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Chris Zankel, Max Filippov, Thomas Gleixner,
	Marc Zyngier

Add <linux/irqchips/xtensa-mx.h> to provide the function prototype to
prevent a build warning:

drivers/irqchip/irq-xtensa-mx.c:166:12: warning: no previous prototype for 'xtensa_mx_init_legacy' [-Wmissing-prototypes]
  166 | int __init xtensa_mx_init_legacy(struct device_node *interrupt_parent)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Marc Zyngier <maz@kernel.org>
---
 drivers/irqchip/irq-xtensa-mx.c |    1 +
 1 file changed, 1 insertion(+)

diff -- a/drivers/irqchip/irq-xtensa-mx.c b/drivers/irqchip/irq-xtensa-mx.c
--- a/drivers/irqchip/irq-xtensa-mx.c
+++ b/drivers/irqchip/irq-xtensa-mx.c
@@ -12,6 +12,7 @@
 #include <linux/irqdomain.h>
 #include <linux/irq.h>
 #include <linux/irqchip.h>
+#include <linux/irqchip/xtensa-mx.h>
 #include <linux/of.h>
 
 #include <asm/mxregs.h>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 10/16] xtensa: smp: add headers for missing function prototypes
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (8 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 09/16] irqchip: irq-xtensa-mx: include header for missing prototype Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  5:21 ` [PATCH 11/16] xtensa: hw_breakpoint: include header for missing prototype Randy Dunlap
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Use <asm/smp.h> to provide the prototype for secondary_start_kernel().
Use <linux/profile.h> to provide the prototype for
setup_profiling_timer().

arch/xtensa/kernel/smp.c:119:6: warning: no previous prototype for 'secondary_start_kernel' [-Wmissing-prototypes]
  119 | void secondary_start_kernel(void)
arch/xtensa/kernel/smp.c:461:5: warning: no previous prototype for 'setup_profiling_timer' [-Wmissing-prototypes]
  461 | int setup_profiling_timer(unsigned int multiplier)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/include/asm/smp.h |    1 +
 arch/xtensa/kernel/smp.c      |    1 +
 2 files changed, 2 insertions(+)

diff -- a/arch/xtensa/include/asm/smp.h b/arch/xtensa/include/asm/smp.h
--- a/arch/xtensa/include/asm/smp.h
+++ b/arch/xtensa/include/asm/smp.h
@@ -23,6 +23,7 @@ struct cpumask;
 void arch_send_call_function_ipi_mask(const struct cpumask *mask);
 void arch_send_call_function_single_ipi(int cpu);
 
+void secondary_start_kernel(void);
 void smp_init_cpus(void);
 void secondary_init_irq(void);
 void ipi_init(void);
diff -- a/arch/xtensa/kernel/smp.c b/arch/xtensa/kernel/smp.c
--- a/arch/xtensa/kernel/smp.c
+++ b/arch/xtensa/kernel/smp.c
@@ -21,6 +21,7 @@
 #include <linux/irq.h>
 #include <linux/kdebug.h>
 #include <linux/module.h>
+#include <linux/profile.h>
 #include <linux/sched/mm.h>
 #include <linux/sched/hotplug.h>
 #include <linux/sched/task_stack.h>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 11/16] xtensa: hw_breakpoint: include header for missing prototype
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (9 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 10/16] xtensa: smp: add headers for missing function prototypes Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  5:21 ` [PATCH 12/16] xtensa: tlb: include <asm/tlb.h> " Randy Dunlap
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Add the prototype for restore_dbreak() to <asm/hw_breakpoint.h> and use
that header in hw_breakpoint.c to prevent a build warning:

arch/xtensa/kernel/hw_breakpoint.c:263:6: warning: no previous prototype for 'restore_dbreak' [-Wmissing-prototypes]
  263 | void restore_dbreak(void)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/include/asm/hw_breakpoint.h |    1 +
 arch/xtensa/kernel/hw_breakpoint.c      |    1 +
 2 files changed, 2 insertions(+)

diff -- a/arch/xtensa/include/asm/hw_breakpoint.h b/arch/xtensa/include/asm/hw_breakpoint.h
--- a/arch/xtensa/include/asm/hw_breakpoint.h
+++ b/arch/xtensa/include/asm/hw_breakpoint.h
@@ -48,6 +48,7 @@ void arch_uninstall_hw_breakpoint(struct
 void hw_breakpoint_pmu_read(struct perf_event *bp);
 int check_hw_breakpoint(struct pt_regs *regs);
 void clear_ptrace_hw_breakpoint(struct task_struct *tsk);
+void restore_dbreak(void);
 
 #else
 
diff -- a/arch/xtensa/kernel/hw_breakpoint.c b/arch/xtensa/kernel/hw_breakpoint.c
--- a/arch/xtensa/kernel/hw_breakpoint.c
+++ b/arch/xtensa/kernel/hw_breakpoint.c
@@ -13,6 +13,7 @@
 #include <linux/percpu.h>
 #include <linux/perf_event.h>
 #include <asm/core.h>
+#include <asm/hw_breakpoint.h>
 
 /* Breakpoint currently in use for each IBREAKA. */
 static DEFINE_PER_CPU(struct perf_event *, bp_on_reg[XCHAL_NUM_IBREAK]);

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 12/16] xtensa: tlb: include <asm/tlb.h> for missing prototype
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (10 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 11/16] xtensa: hw_breakpoint: include header for missing prototype Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  5:21 ` [PATCH 13/16] xtensa: iss/network: make functions static Randy Dunlap
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Add the prototype for check_tlb_sanity() to <asm/tlb.h> and use that
header to prevent a build warning:

arch/xtensa/mm/tlb.c:273:6: warning: no previous prototype for 'check_tlb_sanity' [-Wmissing-prototypes]
  273 | void check_tlb_sanity(void)

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/include/asm/tlb.h |    2 ++
 arch/xtensa/mm/tlb.c          |    1 +
 2 files changed, 3 insertions(+)

diff -- a/arch/xtensa/include/asm/tlb.h b/arch/xtensa/include/asm/tlb.h
--- a/arch/xtensa/include/asm/tlb.h
+++ b/arch/xtensa/include/asm/tlb.h
@@ -18,4 +18,6 @@
 
 #define __pte_free_tlb(tlb, pte, address)	pte_free((tlb)->mm, pte)
 
+void check_tlb_sanity(void);
+
 #endif	/* _XTENSA_TLB_H */
diff -- a/arch/xtensa/mm/tlb.c b/arch/xtensa/mm/tlb.c
--- a/arch/xtensa/mm/tlb.c
+++ b/arch/xtensa/mm/tlb.c
@@ -17,6 +17,7 @@
 #include <linux/mm.h>
 #include <asm/processor.h>
 #include <asm/mmu_context.h>
+#include <asm/tlb.h>
 #include <asm/tlbflush.h>
 #include <asm/cacheflush.h>
 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 13/16] xtensa: iss/network: make functions static
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (11 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 12/16] xtensa: tlb: include <asm/tlb.h> " Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  5:21 ` [PATCH 14/16] xtensa: boot: don't add include-dirs Randy Dunlap
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Make 2 functions static to prevent build warnings:

arch/xtensa/platforms/iss/network.c:204:16: warning: no previous prototype for 'tuntap_protocol' [-Wmissing-prototypes]
  204 | unsigned short tuntap_protocol(struct sk_buff *skb)
arch/xtensa/platforms/iss/network.c:444:6: warning: no previous prototype for 'iss_net_user_timer_expire' [-Wmissing-prototypes]
  444 | void iss_net_user_timer_expire(struct timer_list *unused)

Fixes: 7282bee78798 ("xtensa: Architecture support for Tensilica Xtensa Part 8")
Fixes: d8479a21a98b ("xtensa: Convert timers to use timer_setup()")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/platforms/iss/network.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -- a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c
--- a/arch/xtensa/platforms/iss/network.c
+++ b/arch/xtensa/platforms/iss/network.c
@@ -201,7 +201,7 @@ static int tuntap_write(struct iss_net_p
 	return simc_write(lp->tp.info.tuntap.fd, (*skb)->data, (*skb)->len);
 }
 
-unsigned short tuntap_protocol(struct sk_buff *skb)
+static unsigned short tuntap_protocol(struct sk_buff *skb)
 {
 	return eth_type_trans(skb, skb->dev);
 }
@@ -441,7 +441,7 @@ static int iss_net_change_mtu(struct net
 	return -EINVAL;
 }
 
-void iss_net_user_timer_expire(struct timer_list *unused)
+static void iss_net_user_timer_expire(struct timer_list *unused)
 {
 }
 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 14/16] xtensa: boot: don't add include-dirs
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (12 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 13/16] xtensa: iss/network: make functions static Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  5:21 ` [PATCH 15/16] xtensa: umulsidi3: fix conditional expression Randy Dunlap
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Drop the -I<include-dir> options to prevent build warnings since there
is not boot/include directory:

cc1: warning: arch/xtensa/boot/include: No such file or directory [-Wmissing-include-dirs]

Fixes: 437374e9a950 ("restore arch/{ppc/xtensa}/boot cflags")
Fixes: 4bedea945451 ("xtensa: Architecture support for Tensilica Xtensa Part 2")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/boot/Makefile |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff -- a/arch/xtensa/boot/Makefile b/arch/xtensa/boot/Makefile
--- a/arch/xtensa/boot/Makefile
+++ b/arch/xtensa/boot/Makefile
@@ -9,8 +9,7 @@
 
 
 # KBUILD_CFLAGS used when building rest of boot (takes effect recursively)
-KBUILD_CFLAGS	+= -fno-builtin -Iarch/$(ARCH)/boot/include
-HOSTFLAGS	+= -Iarch/$(ARCH)/boot/include
+KBUILD_CFLAGS	+= -fno-builtin
 
 subdir-y	:= lib
 targets		+= vmlinux.bin vmlinux.bin.gz

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 15/16] xtensa: umulsidi3: fix conditional expression
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (13 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 14/16] xtensa: boot: don't add include-dirs Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20  5:21 ` [PATCH 16/16] xtensa: boot/lib: add missing prototypes for functions Randy Dunlap
  2023-09-20 12:11 ` [PATCH 00/16] xtensa: fix W=1 build warnings Max Filippov
  16 siblings, 0 replies; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Even when a variant has one or more of these defines set to 1, the
multiplier code paths are not used. Change the expression so that the
correct code paths are used.

arch/xtensa/lib/umulsidi3.S:44:38: warning: "XCHAL_NO_MUL" is not defined, evaluates to 0 [-Wundef]
   44 | #if defined(__XTENSA_CALL0_ABI__) && XCHAL_NO_MUL
arch/xtensa/lib/umulsidi3.S:145:38: warning: "XCHAL_NO_MUL" is not defined, evaluates to 0 [-Wundef]
  145 | #if defined(__XTENSA_CALL0_ABI__) && XCHAL_NO_MUL
arch/xtensa/lib/umulsidi3.S:159:5: warning: "XCHAL_NO_MUL" is not defined, evaluates to 0 [-Wundef]
  159 | #if XCHAL_NO_MUL

Fixes: 8939c58d68f9 ("xtensa: add __umulsidi3 helper")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/lib/umulsidi3.S |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff -- a/arch/xtensa/lib/umulsidi3.S b/arch/xtensa/lib/umulsidi3.S
--- a/arch/xtensa/lib/umulsidi3.S
+++ b/arch/xtensa/lib/umulsidi3.S
@@ -3,7 +3,9 @@
 #include <asm/asmmacro.h>
 #include <asm/core.h>
 
-#if !XCHAL_HAVE_MUL16 && !XCHAL_HAVE_MUL32 && !XCHAL_HAVE_MAC16
+#if XCHAL_HAVE_MUL16 || XCHAL_HAVE_MUL32 || XCHAL_HAVE_MAC16
+#define XCHAL_NO_MUL 0
+#else
 #define XCHAL_NO_MUL 1
 #endif
 

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 16/16] xtensa: boot/lib: add missing prototypes for functions
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (14 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 15/16] xtensa: umulsidi3: fix conditional expression Randy Dunlap
@ 2023-09-20  5:21 ` Randy Dunlap
  2023-09-20 11:54   ` Max Filippov
  2023-09-20 12:11 ` [PATCH 00/16] xtensa: fix W=1 build warnings Max Filippov
  16 siblings, 1 reply; 22+ messages in thread
From: Randy Dunlap @ 2023-09-20  5:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Chris Zankel, Max Filippov

Add function prototypes for exit(), zalloc(), and gunzip() to the
boot library code.

arch/xtensa/boot/lib/zmem.c:8:6: warning: no previous prototype for 'exit' [-Wmissing-prototypes]
    8 | void exit (void)
arch/xtensa/boot/lib/zmem.c:13:7: warning: no previous prototype for 'zalloc' [-Wmissing-prototypes]
   13 | void *zalloc(unsigned size)
arch/xtensa/boot/lib/zmem.c:35:6: warning: no previous prototype for 'gunzip' [-Wmissing-prototypes]
   35 | void gunzip (void *dst, int dstlen, unsigned char *src, int *lenp)

Fixes: 4bedea945451 ("xtensa: Architecture support for Tensilica Xtensa Part 2")
Fixes: e7d163f76665 ("xtensa: Removed local copy of zlib and fixed O= support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
---
 arch/xtensa/boot/lib/zmem.c |    4 ++++
 1 file changed, 4 insertions(+)

diff -- a/arch/xtensa/boot/lib/zmem.c b/arch/xtensa/boot/lib/zmem.c
--- a/arch/xtensa/boot/lib/zmem.c
+++ b/arch/xtensa/boot/lib/zmem.c
@@ -5,6 +5,10 @@
 
 extern void *avail_ram, *end_avail;
 
+void exit (void);
+void *zalloc(unsigned size);
+void gunzip (void *dst, int dstlen, unsigned char *src, int *lenp);
+
 void exit (void)
 {
   for (;;);

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 09/16] irqchip: irq-xtensa-mx: include header for missing prototype
  2023-09-20  5:21 ` [PATCH 09/16] irqchip: irq-xtensa-mx: include header for missing prototype Randy Dunlap
@ 2023-09-20  9:51   ` Marc Zyngier
  2023-09-20 10:53     ` Max Filippov
  0 siblings, 1 reply; 22+ messages in thread
From: Marc Zyngier @ 2023-09-20  9:51 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel, Chris Zankel, Max Filippov, Thomas Gleixner

On Wed, 20 Sep 2023 06:21:32 +0100,
Randy Dunlap <rdunlap@infradead.org> wrote:
> 
> Add <linux/irqchips/xtensa-mx.h> to provide the function prototype to
> prevent a build warning:
> 
> drivers/irqchip/irq-xtensa-mx.c:166:12: warning: no previous prototype for 'xtensa_mx_init_legacy' [-Wmissing-prototypes]
>   166 | int __init xtensa_mx_init_legacy(struct device_node *interrupt_parent)
> 
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Chris Zankel <chris@zankel.net>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Marc Zyngier <maz@kernel.org>
> ---
>  drivers/irqchip/irq-xtensa-mx.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff -- a/drivers/irqchip/irq-xtensa-mx.c b/drivers/irqchip/irq-xtensa-mx.c
> --- a/drivers/irqchip/irq-xtensa-mx.c
> +++ b/drivers/irqchip/irq-xtensa-mx.c
> @@ -12,6 +12,7 @@
>  #include <linux/irqdomain.h>
>  #include <linux/irq.h>
>  #include <linux/irqchip.h>
> +#include <linux/irqchip/xtensa-mx.h>
>  #include <linux/of.h>
>  
>  #include <asm/mxregs.h>
> 

Acked-by: Marc Zyngier <maz@kernel.org>

It also begs the question of the continuing support for non-DT driven
systems.

Max, Chris: are we any closer to being DT-only on the xtensa front?

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 09/16] irqchip: irq-xtensa-mx: include header for missing prototype
  2023-09-20  9:51   ` Marc Zyngier
@ 2023-09-20 10:53     ` Max Filippov
  0 siblings, 0 replies; 22+ messages in thread
From: Max Filippov @ 2023-09-20 10:53 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Randy Dunlap, linux-kernel, Chris Zankel, Thomas Gleixner

On Wed, Sep 20, 2023 at 2:51 AM Marc Zyngier <maz@kernel.org> wrote:
> It also begs the question of the continuing support for non-DT driven
> systems.
>
> Max, Chris: are we any closer to being DT-only on the xtensa front?

I have never seen it as a goal. Let's see: iss doesn't have devices at all,
virt based on it is DT-only, xtfpga with DT loses USB host support, but
it hasn't really been all that useful. xt2000 is the only xtensa platform that
does not support device trees now. I can convert the code, but I don't have
the hardware to test it. I also know that it hasn't been in use in Cadence.
Maybe Chris has it? If not then I guess we can drop it.

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 01/16] xtensa: FSF: define XCHAL_HAVE_DIV32
  2023-09-20  5:21 ` [PATCH 01/16] xtensa: FSF: define XCHAL_HAVE_DIV32 Randy Dunlap
@ 2023-09-20 11:53   ` Max Filippov
  0 siblings, 0 replies; 22+ messages in thread
From: Max Filippov @ 2023-09-20 11:53 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel, kernel test robot, Chris Zankel

On Tue, Sep 19, 2023 at 10:21 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> When variant FSF is set, XCHAL_HAVE_DIV32 is not defined,
> so add the define for FSF to prevent build warnings:
>
> arch/xtensa/lib/divsi3.S:9:5: warning: "XCHAL_HAVE_DIV32" is not defined, evaluates to 0 [-Wundef]
>     9 | #if XCHAL_HAVE_DIV32
> arch/xtensa/lib/modsi3.S:9:5: warning: "XCHAL_HAVE_DIV32" is not defined, evaluates to 0 [-Wundef]
>     9 | #if XCHAL_HAVE_DIV32
>
> Fixes: 173d6681380a ("xtensa: remove extra header files")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: lore.kernel.org/r/202309150556.t0yCdv3g-lkp@intel.com
> Cc: Chris Zankel <chris@zankel.net>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> ---
>  arch/xtensa/variants/fsf/include/variant/core.h |    1 +
>  1 file changed, 1 insertion(+)

If this configuration overlay doesn't define that macro then other
configurations
from that era may have similar issue. I've posted a different fix that
adds a default
definition for XCHAL_HAVE_DIV32 to asm/core.h instead.

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 16/16] xtensa: boot/lib: add missing prototypes for functions
  2023-09-20  5:21 ` [PATCH 16/16] xtensa: boot/lib: add missing prototypes for functions Randy Dunlap
@ 2023-09-20 11:54   ` Max Filippov
  0 siblings, 0 replies; 22+ messages in thread
From: Max Filippov @ 2023-09-20 11:54 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel, Chris Zankel

On Tue, Sep 19, 2023 at 10:21 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> Add function prototypes for exit(), zalloc(), and gunzip() to the
> boot library code.

exit() and zalloc() don't need to be public. I've posted a different fix that
makes these two functions static.


> arch/xtensa/boot/lib/zmem.c:8:6: warning: no previous prototype for 'exit' [-Wmissing-prototypes]
>     8 | void exit (void)
> arch/xtensa/boot/lib/zmem.c:13:7: warning: no previous prototype for 'zalloc' [-Wmissing-prototypes]
>    13 | void *zalloc(unsigned size)
> arch/xtensa/boot/lib/zmem.c:35:6: warning: no previous prototype for 'gunzip' [-Wmissing-prototypes]
>    35 | void gunzip (void *dst, int dstlen, unsigned char *src, int *lenp)
>
> Fixes: 4bedea945451 ("xtensa: Architecture support for Tensilica Xtensa Part 2")
> Fixes: e7d163f76665 ("xtensa: Removed local copy of zlib and fixed O= support")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Chris Zankel <chris@zankel.net>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> ---
>  arch/xtensa/boot/lib/zmem.c |    4 ++++
>  1 file changed, 4 insertions(+)

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 00/16] xtensa: fix W=1 build warnings
  2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
                   ` (15 preceding siblings ...)
  2023-09-20  5:21 ` [PATCH 16/16] xtensa: boot/lib: add missing prototypes for functions Randy Dunlap
@ 2023-09-20 12:11 ` Max Filippov
  16 siblings, 0 replies; 22+ messages in thread
From: Max Filippov @ 2023-09-20 12:11 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel, Chris Zankel, Thomas Gleixner, Marc Zyngier

Hi Randy,

On Tue, Sep 19, 2023 at 10:21 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> This series fixes all xtensa W=1 build warnings that I have seen
> with the exception of some in arch/xtensa/boot/. [1]
>
> These have been through defconfig, allnoconfig, tinyconfig, allyesconfig,
> allmodconfig, and many randconfig builds.
>
>  [PATCH 01/16] xtensa: FSF: define XCHAL_HAVE_DIV32
>  [PATCH 02/16] xtensa: fault: include <asm/traps.h>
>  [PATCH 03/16] xtensa: irq: include <asm/traps.h>
>  [PATCH 04/16] xtensa: ptrace: add prototypes to <asm/ptrace.h>
>  [PATCH 05/16] xtensa: processor.h: add init_arch() prototype
>  [PATCH 06/16] xtensa: signal: include headers for function prototypes
>  [PATCH 07/16] xtensa: stacktrace: include <asm/ftrace.h> for prototype
>  [PATCH 08/16] xtensa: traps: add <linux/cpu.h> for function prototype
>  [PATCH 09/16] irqchip: irq-xtensa-mx: include header for missing prototype
>  [PATCH 10/16] xtensa: smp: add headers for missing function prototypes
>  [PATCH 11/16] xtensa: hw_breakpoing: include header for missing prototype
>  [PATCH 12/16] xtensa: tlb: include <asm/tlb.h> for missing prototype
>  [PATCH 13/16] xtensa: iss/network: make functions static
>  [PATCH 14/16] xtensa: boot: don't add include-dirs
>  [PATCH 15/16] xtensa: umulsidi3: fix conditional expression
>  [PATCH 16/16] xtensa: boot/lib: add missing prototypes for functions
>
> 1:
> arch/xtensa/boot/boot-elf/bootstrap.S:68: Warning: value 0x1a0003000 truncated to 0xa0003000
>
>  arch/xtensa/boot/Makefile                       |    3 +--
>  arch/xtensa/boot/lib/zmem.c                     |    4 ++++
>  arch/xtensa/include/asm/hw_breakpoint.h         |    1 +
>  arch/xtensa/include/asm/processor.h             |    5 +++++
>  arch/xtensa/include/asm/ptrace.h                |    3 +++
>  arch/xtensa/include/asm/smp.h                   |    1 +
>  arch/xtensa/include/asm/tlb.h                   |    2 ++
>  arch/xtensa/kernel/hw_breakpoint.c              |    1 +
>  arch/xtensa/kernel/irq.c                        |    1 +
>  arch/xtensa/kernel/ptrace.c                     |    1 -
>  arch/xtensa/kernel/signal.c                     |    2 ++
>  arch/xtensa/kernel/smp.c                        |    1 +
>  arch/xtensa/kernel/stacktrace.c                 |    1 +
>  arch/xtensa/kernel/traps.c                      |    1 +
>  arch/xtensa/lib/umulsidi3.S                     |    4 +++-
>  arch/xtensa/mm/fault.c                          |    1 +
>  arch/xtensa/mm/tlb.c                            |    1 +
>  arch/xtensa/platforms/iss/network.c             |    4 ++--
>  arch/xtensa/variants/fsf/include/variant/core.h |    1 +
>  drivers/irqchip/irq-xtensa-mx.c                 |    1 +
>  20 files changed, 33 insertions(+), 6 deletions(-)
>
> Cc: Chris Zankel <chris@zankel.net>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Marc Zyngier <maz@kernel.org>

Thank you for this nice cleanup. Applied the whole series (except
the first and the last patches, which I replaced with different fixes)
to my xtensa tree.

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2023-09-20 12:11 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-20  5:21 [PATCH 00/16] xtensa: fix W=1 build warnings Randy Dunlap
2023-09-20  5:21 ` [PATCH 01/16] xtensa: FSF: define XCHAL_HAVE_DIV32 Randy Dunlap
2023-09-20 11:53   ` Max Filippov
2023-09-20  5:21 ` [PATCH 02/16] xtensa: fault: include <asm/traps.h> Randy Dunlap
2023-09-20  5:21 ` [PATCH 03/16] xtensa: irq: " Randy Dunlap
2023-09-20  5:21 ` [PATCH 04/16] xtensa: ptrace: add prototypes to <asm/ptrace.h> Randy Dunlap
2023-09-20  5:21 ` [PATCH 05/16] xtensa: processor.h: add init_arch() prototype Randy Dunlap
2023-09-20  5:21 ` [PATCH 06/16] xtensa: signal: include headers for function prototypes Randy Dunlap
2023-09-20  5:21 ` [PATCH 07/16] xtensa: stacktrace: include <asm/ftrace.h> for prototype Randy Dunlap
2023-09-20  5:21 ` [PATCH 08/16] xtensa: traps: add <linux/cpu.h> for function prototype Randy Dunlap
2023-09-20  5:21 ` [PATCH 09/16] irqchip: irq-xtensa-mx: include header for missing prototype Randy Dunlap
2023-09-20  9:51   ` Marc Zyngier
2023-09-20 10:53     ` Max Filippov
2023-09-20  5:21 ` [PATCH 10/16] xtensa: smp: add headers for missing function prototypes Randy Dunlap
2023-09-20  5:21 ` [PATCH 11/16] xtensa: hw_breakpoint: include header for missing prototype Randy Dunlap
2023-09-20  5:21 ` [PATCH 12/16] xtensa: tlb: include <asm/tlb.h> " Randy Dunlap
2023-09-20  5:21 ` [PATCH 13/16] xtensa: iss/network: make functions static Randy Dunlap
2023-09-20  5:21 ` [PATCH 14/16] xtensa: boot: don't add include-dirs Randy Dunlap
2023-09-20  5:21 ` [PATCH 15/16] xtensa: umulsidi3: fix conditional expression Randy Dunlap
2023-09-20  5:21 ` [PATCH 16/16] xtensa: boot/lib: add missing prototypes for functions Randy Dunlap
2023-09-20 11:54   ` Max Filippov
2023-09-20 12:11 ` [PATCH 00/16] xtensa: fix W=1 build warnings Max Filippov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox