linux-hexagon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes
@ 2023-11-30 22:58 Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 01/19] hexagon: uaccess: Remove clear_user_hexagon() Nathan Chancellor
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Hi all,

This series fixes all the instances of -Wmissing-prototypes in
arch/hexagon, now that it is enabled globally in a default build. I hope
most of the patches will be uncontroversial but please let me know
otherwise. This survives ARCH=hexagon defconfig and allmodconfig with
LLVM 17.0.6.

This is based on Arnd's asm-generic-prototypes branch but it applies
cleanly to 6.7-rc3 as well, in case Andrew wants to take it (as far as
I remember, he has handled Hexagon patches for me in the past).

---
Nathan Chancellor (19):
      hexagon: uaccess: Remove clear_user_hexagon()
      hexagon: mm: Mark paging_init() as static
      hexagon: mm: Include asm/setup.h for setup_arch_memory()'s prototype
      hexagon: smp: Mark handle_ipi() and start_secondary() as static
      hexagon: vm_fault: Mark do_page_fault() as static
      hexagon: vm_fault: Include asm/vm_fault.h for prototypes
      hexagon: vm_tlb: Include asm/tlbflush.h for prototypes
      hexagon: time: Include asm/time.h for prototypes
      hexagon: time: Mark time_init_deferred() as static
      hexagon: time: Include asm/delay.h for prototypes
      hexagon: signal: Switch to SYSCALL_DEFINE0 for sys_rt_sigreturn()
      hexagon: reset: Include linux/reboot.h for prototypes
      hexagon: process: Include linux/cpu.h for arch_cpu_idle() prototype
      hexagon: process: Add internal prototype for do_work_pending()
      hexagon: vdso: Include asm/elf.h for arch_setup_additional_pages() prototype
      hexagon: vm_events: Remove unused dummy_handler()
      hexagon: irq: Add prototype for arch_do_IRQ()
      hexagon: traps: Remove sys_syscall()
      hexagon: traps: Add internal prototypes for functions only called from asm

 arch/hexagon/include/asm/irq.h  |  3 +++
 arch/hexagon/kernel/process.c   |  2 ++
 arch/hexagon/kernel/reset.c     |  1 +
 arch/hexagon/kernel/signal.c    |  2 +-
 arch/hexagon/kernel/smp.c       |  4 ++--
 arch/hexagon/kernel/time.c      |  4 +++-
 arch/hexagon/kernel/traps.c     | 11 ++++-------
 arch/hexagon/kernel/vdso.c      |  1 +
 arch/hexagon/kernel/vm_events.c |  7 -------
 arch/hexagon/mm/init.c          |  3 ++-
 arch/hexagon/mm/uaccess.c       |  8 --------
 arch/hexagon/mm/vm_fault.c      |  3 ++-
 arch/hexagon/mm/vm_tlb.c        |  1 +
 13 files changed, 22 insertions(+), 28 deletions(-)
---
base-commit: 6479f0df0b7b7e977357e524bdd2eb3aeb4fd085
change-id: 20231130-hexagon-missing-prototypes-6e05144769e7

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


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

* [PATCH 01/19] hexagon: uaccess: Remove clear_user_hexagon()
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 02/19] hexagon: mm: Mark paging_init() as static Nathan Chancellor
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/mm/uaccess.c:39:15: warning: no previous prototype for function 'clear_user_hexagon' [-Wmissing-prototypes]
     39 | unsigned long clear_user_hexagon(void __user *dest, unsigned long count)
        |               ^
  arch/hexagon/mm/uaccess.c:39:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     39 | unsigned long clear_user_hexagon(void __user *dest, unsigned long count)
        | ^
        | static
  1 warning generated.

This function appears to have been unused since it was introduced in
commit 7567746e1c0d ("Hexagon: Add user access functions"), so remove
it.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/mm/uaccess.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/arch/hexagon/mm/uaccess.c b/arch/hexagon/mm/uaccess.c
index 650bca92f0b7..3204e9ba6d6f 100644
--- a/arch/hexagon/mm/uaccess.c
+++ b/arch/hexagon/mm/uaccess.c
@@ -35,11 +35,3 @@ __kernel_size_t __clear_user_hexagon(void __user *dest, unsigned long count)
 
 	return count;
 }
-
-unsigned long clear_user_hexagon(void __user *dest, unsigned long count)
-{
-	if (!access_ok(dest, count))
-		return count;
-	else
-		return __clear_user_hexagon(dest, count);
-}

-- 
2.43.0


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

* [PATCH 02/19] hexagon: mm: Mark paging_init() as static
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 01/19] hexagon: uaccess: Remove clear_user_hexagon() Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 03/19] hexagon: mm: Include asm/setup.h for setup_arch_memory()'s prototype Nathan Chancellor
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/mm/init.c:89:13: warning: no previous prototype for function 'paging_init' [-Wmissing-prototypes]
     89 | void __init paging_init(void)
        |             ^
  arch/hexagon/mm/init.c:89:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     89 | void __init paging_init(void)
        | ^
        | static

This function is only used within this translation unit, so mark it
static as suggested.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/hexagon/mm/init.c b/arch/hexagon/mm/init.c
index 146115c9de61..f164b377b93b 100644
--- a/arch/hexagon/mm/init.c
+++ b/arch/hexagon/mm/init.c
@@ -86,7 +86,7 @@ void sync_icache_dcache(pte_t pte)
  * In this mode, we only have one pg_data_t
  * structure: contig_mem_data.
  */
-void __init paging_init(void)
+static void __init paging_init(void)
 {
 	unsigned long max_zone_pfn[MAX_NR_ZONES] = {0, };
 

-- 
2.43.0


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

* [PATCH 03/19] hexagon: mm: Include asm/setup.h for setup_arch_memory()'s prototype
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 01/19] hexagon: uaccess: Remove clear_user_hexagon() Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 02/19] hexagon: mm: Mark paging_init() as static Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 04/19] hexagon: smp: Mark handle_ipi() and start_secondary() as static Nathan Chancellor
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/mm/init.c:138:13: warning: no previous prototype for function 'setup_arch_memory' [-Wmissing-prototypes]
    138 | void __init setup_arch_memory(void)
        |             ^
  arch/hexagon/mm/init.c:138:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    138 | void __init setup_arch_memory(void)
        | ^
        | static

The prototype is in asm/setup.h, include it to clear up the warning.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/mm/init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/hexagon/mm/init.c b/arch/hexagon/mm/init.c
index f164b377b93b..3458f39ca2ac 100644
--- a/arch/hexagon/mm/init.c
+++ b/arch/hexagon/mm/init.c
@@ -12,6 +12,7 @@
 #include <linux/highmem.h>
 #include <asm/tlb.h>
 #include <asm/sections.h>
+#include <asm/setup.h>
 #include <asm/vm_mmu.h>
 
 /*

-- 
2.43.0


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

* [PATCH 04/19] hexagon: smp: Mark handle_ipi() and start_secondary() as static
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (2 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 03/19] hexagon: mm: Include asm/setup.h for setup_arch_memory()'s prototype Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 05/19] hexagon: vm_fault: Mark do_page_fault() " Nathan Chancellor
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/kernel/smp.c:82:13: warning: no previous prototype for function 'handle_ipi' [-Wmissing-prototypes]
     82 | irqreturn_t handle_ipi(int irq, void *desc)
        |             ^
  arch/hexagon/kernel/smp.c:82:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     82 | irqreturn_t handle_ipi(int irq, void *desc)
        | ^
        | static
  arch/hexagon/kernel/smp.c:127:6: warning: no previous prototype for function 'start_secondary' [-Wmissing-prototypes]
    127 | void start_secondary(void)
        |      ^
  arch/hexagon/kernel/smp.c:127:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    127 | void start_secondary(void)
        | ^
        | static
  2 warnings generated.

These functions are not used outside of this translation unit, so mark
them as static.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/smp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/hexagon/kernel/smp.c b/arch/hexagon/kernel/smp.c
index 4e8bee25b8c6..608884bc3396 100644
--- a/arch/hexagon/kernel/smp.c
+++ b/arch/hexagon/kernel/smp.c
@@ -79,7 +79,7 @@ void smp_vm_unmask_irq(void *info)
  * Specifically, first arg is irq, second is the irq_desc.
  */
 
-irqreturn_t handle_ipi(int irq, void *desc)
+static irqreturn_t handle_ipi(int irq, void *desc)
 {
 	int cpu = smp_processor_id();
 	struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
@@ -124,7 +124,7 @@ void __init smp_prepare_boot_cpu(void)
  * to point to current thread info
  */
 
-void start_secondary(void)
+static void start_secondary(void)
 {
 	unsigned long thread_ptr;
 	unsigned int cpu, irq;

-- 
2.43.0


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

* [PATCH 05/19] hexagon: vm_fault: Mark do_page_fault() as static
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (3 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 04/19] hexagon: smp: Mark handle_ipi() and start_secondary() as static Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 06/19] hexagon: vm_fault: Include asm/vm_fault.h for prototypes Nathan Chancellor
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/mm/vm_fault.c:36:6: warning: no previous prototype for function 'do_page_fault' [-Wmissing-prototypes]
     36 | void do_page_fault(unsigned long address, long cause, struct pt_regs *regs)
        |      ^
  arch/hexagon/mm/vm_fault.c:36:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     36 | void do_page_fault(unsigned long address, long cause, struct pt_regs *regs)
        | ^
        | static

This function is not used outside of this translation unit, so mark it
as static.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/mm/vm_fault.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/hexagon/mm/vm_fault.c b/arch/hexagon/mm/vm_fault.c
index 7295ea3f8cc8..ab0f0a791e00 100644
--- a/arch/hexagon/mm/vm_fault.c
+++ b/arch/hexagon/mm/vm_fault.c
@@ -33,7 +33,7 @@
 /*
  * Canonical page fault handler
  */
-void do_page_fault(unsigned long address, long cause, struct pt_regs *regs)
+static void do_page_fault(unsigned long address, long cause, struct pt_regs *regs)
 {
 	struct vm_area_struct *vma;
 	struct mm_struct *mm = current->mm;

-- 
2.43.0


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

* [PATCH 06/19] hexagon: vm_fault: Include asm/vm_fault.h for prototypes
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (4 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 05/19] hexagon: vm_fault: Mark do_page_fault() " Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 07/19] hexagon: vm_tlb: Include asm/tlbflush.h " Nathan Chancellor
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/mm/vm_fault.c:157:6: warning: no previous prototype for function 'read_protection_fault' [-Wmissing-prototypes]
    157 | void read_protection_fault(struct pt_regs *regs)
        |      ^
  arch/hexagon/mm/vm_fault.c:157:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    157 | void read_protection_fault(struct pt_regs *regs)
        | ^
        | static
  arch/hexagon/mm/vm_fault.c:164:6: warning: no previous prototype for function 'write_protection_fault' [-Wmissing-prototypes]
    164 | void write_protection_fault(struct pt_regs *regs)
        |      ^
  arch/hexagon/mm/vm_fault.c:164:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    164 | void write_protection_fault(struct pt_regs *regs)
        | ^
        | static
  arch/hexagon/mm/vm_fault.c:171:6: warning: no previous prototype for function 'execute_protection_fault' [-Wmissing-prototypes]
    171 | void execute_protection_fault(struct pt_regs *regs)
        |      ^
  arch/hexagon/mm/vm_fault.c:171:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    171 | void execute_protection_fault(struct pt_regs *regs)
        | ^
        | static

The prototypes for these functions are defined in asm/vm_fault.h, so
include it to pick them up and silence the warnings.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/mm/vm_fault.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/hexagon/mm/vm_fault.c b/arch/hexagon/mm/vm_fault.c
index ab0f0a791e00..3771fb453898 100644
--- a/arch/hexagon/mm/vm_fault.c
+++ b/arch/hexagon/mm/vm_fault.c
@@ -12,6 +12,7 @@
  */
 
 #include <asm/traps.h>
+#include <asm/vm_fault.h>
 #include <linux/uaccess.h>
 #include <linux/mm.h>
 #include <linux/sched/signal.h>

-- 
2.43.0


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

* [PATCH 07/19] hexagon: vm_tlb: Include asm/tlbflush.h for prototypes
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (5 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 06/19] hexagon: vm_fault: Include asm/vm_fault.h for prototypes Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 08/19] hexagon: time: Include asm/time.h " Nathan Chancellor
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns about several missing prototypes that are declared in this
header:

  arch/hexagon/mm/vm_tlb.c:25:6: warning: no previous prototype for function 'flush_tlb_range' [-Wmissing-prototypes]
     25 | void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
        |      ^
  arch/hexagon/mm/vm_tlb.c:25:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     25 | void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
        | ^
        | static
  arch/hexagon/mm/vm_tlb.c:37:6: warning: no previous prototype for function 'flush_tlb_one' [-Wmissing-prototypes]
     37 | void flush_tlb_one(unsigned long vaddr)
        |      ^
  arch/hexagon/mm/vm_tlb.c:37:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     37 | void flush_tlb_one(unsigned long vaddr)
        | ^
        | static
  arch/hexagon/mm/vm_tlb.c:47:6: warning: no previous prototype for function 'tlb_flush_all' [-Wmissing-prototypes]
     47 | void tlb_flush_all(void)
        |      ^
  arch/hexagon/mm/vm_tlb.c:47:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     47 | void tlb_flush_all(void)
        | ^
        | static
  arch/hexagon/mm/vm_tlb.c:56:6: warning: no previous prototype for function 'flush_tlb_mm' [-Wmissing-prototypes]
     56 | void flush_tlb_mm(struct mm_struct *mm)
        |      ^
  arch/hexagon/mm/vm_tlb.c:56:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     56 | void flush_tlb_mm(struct mm_struct *mm)
        | ^
        | static
  arch/hexagon/mm/vm_tlb.c:66:6: warning: no previous prototype for function 'flush_tlb_page' [-Wmissing-prototypes]
     66 | void flush_tlb_page(struct vm_area_struct *vma, unsigned long vaddr)
        |      ^
  arch/hexagon/mm/vm_tlb.c:66:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     66 | void flush_tlb_page(struct vm_area_struct *vma, unsigned long vaddr)
        | ^
        | static
  arch/hexagon/mm/vm_tlb.c:78:6: warning: no previous prototype for function 'flush_tlb_kernel_range' [-Wmissing-prototypes]
     78 | void flush_tlb_kernel_range(unsigned long start, unsigned long end)
        |      ^
  arch/hexagon/mm/vm_tlb.c:78:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     78 | void flush_tlb_kernel_range(unsigned long start, unsigned long end)
        | ^
        | static
  6 warnings generated.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/mm/vm_tlb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/hexagon/mm/vm_tlb.c b/arch/hexagon/mm/vm_tlb.c
index 53482f2a9ff9..8b6405e2234b 100644
--- a/arch/hexagon/mm/vm_tlb.c
+++ b/arch/hexagon/mm/vm_tlb.c
@@ -14,6 +14,7 @@
 #include <linux/sched.h>
 #include <asm/page.h>
 #include <asm/hexagon_vm.h>
+#include <asm/tlbflush.h>
 
 /*
  * Initial VM implementation has only one map active at a time, with

-- 
2.43.0


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

* [PATCH 08/19] hexagon: time: Include asm/time.h for prototypes
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (6 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 07/19] hexagon: vm_tlb: Include asm/tlbflush.h " Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 09/19] hexagon: time: Mark time_init_deferred() as static Nathan Chancellor
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns about missing prototypes that are declared in this header:

  arch/hexagon/kernel/time.c:118:6: warning: no previous prototype for function 'setup_percpu_clockdev' [-Wmissing-prototypes]
    118 | void setup_percpu_clockdev(void)
        |      ^
  arch/hexagon/kernel/time.c:118:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    118 | void setup_percpu_clockdev(void)
        | ^
        | static
  arch/hexagon/kernel/time.c:135:6: warning: no previous prototype for function 'ipi_timer' [-Wmissing-prototypes]
    135 | void ipi_timer(void)
        |      ^
  arch/hexagon/kernel/time.c:135:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    135 | void ipi_timer(void)
        | ^
        | static

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/time.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c
index febc95714d75..59f00bf54fe9 100644
--- a/arch/hexagon/kernel/time.c
+++ b/arch/hexagon/kernel/time.c
@@ -18,6 +18,7 @@
 #include <linux/module.h>
 
 #include <asm/hexagon_vm.h>
+#include <asm/time.h>
 
 #define TIMER_ENABLE		BIT(0)
 

-- 
2.43.0


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

* [PATCH 09/19] hexagon: time: Mark time_init_deferred() as static
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (7 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 08/19] hexagon: time: Include asm/time.h " Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 10/19] hexagon: time: Include asm/delay.h for prototypes Nathan Chancellor
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/kernel/time.c:163:13: warning: no previous prototype for function 'time_init_deferred' [-Wmissing-prototypes]
    163 | void __init time_init_deferred(void)
        |             ^
  arch/hexagon/kernel/time.c:163:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    163 | void __init time_init_deferred(void)
        | ^
        | static

This function is not used outside of this translation unit so mark it as
static to resolve the warning.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c
index 59f00bf54fe9..f04dbe4f8a4c 100644
--- a/arch/hexagon/kernel/time.c
+++ b/arch/hexagon/kernel/time.c
@@ -161,7 +161,7 @@ static irqreturn_t timer_interrupt(int irq, void *devid)
  * This runs just before the delay loop is calibrated, and
  * is used for delay calibration.
  */
-void __init time_init_deferred(void)
+static void __init time_init_deferred(void)
 {
 	struct resource *resource = NULL;
 	struct clock_event_device *ce_dev = &hexagon_clockevent_dev;

-- 
2.43.0


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

* [PATCH 10/19] hexagon: time: Include asm/delay.h for prototypes
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (8 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 09/19] hexagon: time: Mark time_init_deferred() as static Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 11/19] hexagon: signal: Switch to SYSCALL_DEFINE0 for sys_rt_sigreturn() Nathan Chancellor
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns about missing prototypes that are declared in this header:

  arch/hexagon/kernel/time.c:209:6: warning: no previous prototype for function '__delay' [-Wmissing-prototypes]
    209 | void __delay(unsigned long cycles)
        |      ^
  arch/hexagon/kernel/time.c:209:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    209 | void __delay(unsigned long cycles)
        | ^
        | static
  arch/hexagon/kernel/time.c:224:6: warning: no previous prototype for function '__udelay' [-Wmissing-prototypes]
    224 | void __udelay(unsigned long usecs)
        |      ^
  arch/hexagon/kernel/time.c:224:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    224 | void __udelay(unsigned long usecs)
        | ^
        | static

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/time.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c
index f04dbe4f8a4c..f0f207e2a694 100644
--- a/arch/hexagon/kernel/time.c
+++ b/arch/hexagon/kernel/time.c
@@ -17,6 +17,7 @@
 #include <linux/of_irq.h>
 #include <linux/module.h>
 
+#include <asm/delay.h>
 #include <asm/hexagon_vm.h>
 #include <asm/time.h>
 

-- 
2.43.0


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

* [PATCH 11/19] hexagon: signal: Switch to SYSCALL_DEFINE0 for sys_rt_sigreturn()
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (9 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 10/19] hexagon: time: Include asm/delay.h for prototypes Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 12/19] hexagon: reset: Include linux/reboot.h for prototypes Nathan Chancellor
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/kernel/signal.c:223:16: warning: no previous prototype for function 'sys_rt_sigreturn' [-Wmissing-prototypes]
    223 | asmlinkage int sys_rt_sigreturn(void)
        |                ^
  arch/hexagon/kernel/signal.c:223:12: note: declare 'static' if the function is not intended to be used outside of this translation unit
    223 | asmlinkage int sys_rt_sigreturn(void)
        |            ^
        |            static
  1 warning generated.

Switch to the SYSCALL_DEFINE0() macro, which automatically declares a
prototype.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/hexagon/kernel/signal.c b/arch/hexagon/kernel/signal.c
index bcba31e9e0ae..d301f4621553 100644
--- a/arch/hexagon/kernel/signal.c
+++ b/arch/hexagon/kernel/signal.c
@@ -220,7 +220,7 @@ void do_signal(struct pt_regs *regs)
  * Architecture-specific wrappers for signal-related system calls
  */
 
-asmlinkage int sys_rt_sigreturn(void)
+SYSCALL_DEFINE0(rt_sigreturn)
 {
 	struct pt_regs *regs = current_pt_regs();
 	struct rt_sigframe __user *frame;

-- 
2.43.0


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

* [PATCH 12/19] hexagon: reset: Include linux/reboot.h for prototypes
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (10 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 11/19] hexagon: signal: Switch to SYSCALL_DEFINE0 for sys_rt_sigreturn() Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 13/19] hexagon: process: Include linux/cpu.h for arch_cpu_idle() prototype Nathan Chancellor
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns about missing prototypes that are declared in this header:

  arch/hexagon/kernel/reset.c:9:6: warning: no previous prototype for function 'machine_power_off' [-Wmissing-prototypes]
      9 | void machine_power_off(void)
        |      ^
  arch/hexagon/kernel/reset.c:9:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
      9 | void machine_power_off(void)
        | ^
        | static
  arch/hexagon/kernel/reset.c:15:6: warning: no previous prototype for function 'machine_halt' [-Wmissing-prototypes]
     15 | void machine_halt(void)
        |      ^
  arch/hexagon/kernel/reset.c:15:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     15 | void machine_halt(void)
        | ^
        | static
  arch/hexagon/kernel/reset.c:19:6: warning: no previous prototype for function 'machine_restart' [-Wmissing-prototypes]
     19 | void machine_restart(char *cmd)
        |      ^
  arch/hexagon/kernel/reset.c:19:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     19 | void machine_restart(char *cmd)
        | ^
        | static
  3 warnings generated.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/reset.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/hexagon/kernel/reset.c b/arch/hexagon/kernel/reset.c
index da36114d928f..efd70a8d2526 100644
--- a/arch/hexagon/kernel/reset.c
+++ b/arch/hexagon/kernel/reset.c
@@ -3,6 +3,7 @@
  * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  */
 
+#include <linux/reboot.h>
 #include <linux/smp.h>
 #include <asm/hexagon_vm.h>
 

-- 
2.43.0


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

* [PATCH 13/19] hexagon: process: Include linux/cpu.h for arch_cpu_idle() prototype
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (11 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 12/19] hexagon: reset: Include linux/reboot.h for prototypes Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 14/19] hexagon: process: Add internal prototype for do_work_pending() Nathan Chancellor
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/kernel/process.c:43:6: warning: no previous prototype for function 'arch_cpu_idle' [-Wmissing-prototypes]
     43 | void arch_cpu_idle(void)
        |      ^
  arch/hexagon/kernel/process.c:43:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     43 | void arch_cpu_idle(void)
        | ^
        | static

This prototype is declared in include/linux/cpu.h, include it in
process.c to clear up the warning.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/process.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/hexagon/kernel/process.c b/arch/hexagon/kernel/process.c
index dd7f74ea2c20..51e37fc92857 100644
--- a/arch/hexagon/kernel/process.c
+++ b/arch/hexagon/kernel/process.c
@@ -5,6 +5,7 @@
  * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
  */
 
+#include <linux/cpu.h>
 #include <linux/sched.h>
 #include <linux/sched/debug.h>
 #include <linux/sched/task.h>

-- 
2.43.0


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

* [PATCH 14/19] hexagon: process: Add internal prototype for do_work_pending()
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (12 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 13/19] hexagon: process: Include linux/cpu.h for arch_cpu_idle() prototype Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 15/19] hexagon: vdso: Include asm/elf.h for arch_setup_additional_pages() prototype Nathan Chancellor
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/kernel/process.c:155:5: warning: no previous prototype for function 'do_work_pending' [-Wmissing-prototypes]
    155 | int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
        |     ^
  arch/hexagon/kernel/process.c:155:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    155 | int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
        | ^
        | static

This function is only referenced from assembly, so it does not
technically need a prototype. Add one right above the definition anyways
to clear up the warning.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/process.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/hexagon/kernel/process.c b/arch/hexagon/kernel/process.c
index 51e37fc92857..2a77bfd75694 100644
--- a/arch/hexagon/kernel/process.c
+++ b/arch/hexagon/kernel/process.c
@@ -153,6 +153,7 @@ unsigned long __get_wchan(struct task_struct *p)
  * Returns 0 if there's no need to re-check for more work.
  */
 
+int do_work_pending(struct pt_regs *regs, u32 thread_info_flags);
 int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
 {
 	if (!(thread_info_flags & _TIF_WORK_MASK)) {

-- 
2.43.0


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

* [PATCH 15/19] hexagon: vdso: Include asm/elf.h for arch_setup_additional_pages() prototype
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (13 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 14/19] hexagon: process: Add internal prototype for do_work_pending() Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 16/19] hexagon: vm_events: Remove unused dummy_handler() Nathan Chancellor
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/kernel/vdso.c:49:5: warning: no previous prototype for function 'arch_setup_additional_pages' [-Wmissing-prototypes]
     49 | int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
        |     ^
  arch/hexagon/kernel/vdso.c:49:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     49 | int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
        | ^
        | static
  1 warning generated.

Include the header that declares the prototype to clear up the warning.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/vdso.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/hexagon/kernel/vdso.c b/arch/hexagon/kernel/vdso.c
index b70970ac809f..2e4872d62124 100644
--- a/arch/hexagon/kernel/vdso.c
+++ b/arch/hexagon/kernel/vdso.c
@@ -10,6 +10,7 @@
 #include <linux/vmalloc.h>
 #include <linux/binfmts.h>
 
+#include <asm/elf.h>
 #include <asm/vdso.h>
 
 static struct page *vdso_page;

-- 
2.43.0


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

* [PATCH 16/19] hexagon: vm_events: Remove unused dummy_handler()
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (14 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 15/19] hexagon: vdso: Include asm/elf.h for arch_setup_additional_pages() prototype Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 17/19] hexagon: irq: Add prototype for arch_do_IRQ() Nathan Chancellor
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/kernel/vm_events.c:76:6: warning: no previous prototype for function 'dummy_handler' [-Wmissing-prototypes]
     76 | void dummy_handler(struct pt_regs *regs)
        |      ^
  arch/hexagon/kernel/vm_events.c:76:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     76 | void dummy_handler(struct pt_regs *regs)
        | ^
        | static

This function appears to be entirely unused, so remove it.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/vm_events.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/arch/hexagon/kernel/vm_events.c b/arch/hexagon/kernel/vm_events.c
index 59ef72e4a4e5..2b881a89b206 100644
--- a/arch/hexagon/kernel/vm_events.c
+++ b/arch/hexagon/kernel/vm_events.c
@@ -73,13 +73,6 @@ void show_regs(struct pt_regs *regs)
 		pt_psp(regs), pt_badva(regs), ints_enabled(regs));
 }
 
-void dummy_handler(struct pt_regs *regs)
-{
-	unsigned int elr = pt_elr(regs);
-	printk(KERN_ERR "Unimplemented handler; ELR=0x%08x\n", elr);
-}
-
-
 void arch_do_IRQ(struct pt_regs *regs)
 {
 	int irq = pt_cause(regs);

-- 
2.43.0


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

* [PATCH 17/19] hexagon: irq: Add prototype for arch_do_IRQ()
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (15 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 16/19] hexagon: vm_events: Remove unused dummy_handler() Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 18/19] hexagon: traps: Remove sys_syscall() Nathan Chancellor
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/kernel/vm_events.c:83:6: warning: no previous prototype for function 'arch_do_IRQ' [-Wmissing-prototypes]
     83 | void arch_do_IRQ(struct pt_regs *regs)
        |      ^
  arch/hexagon/kernel/vm_events.c:83:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
     83 | void arch_do_IRQ(struct pt_regs *regs)
        | ^
        | static

This function is only called from assembly but the irq header is a
reasonable place to put a prototype to silence the warning.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/include/asm/irq.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/hexagon/include/asm/irq.h b/arch/hexagon/include/asm/irq.h
index 1f7f1292f701..a60d26754caa 100644
--- a/arch/hexagon/include/asm/irq.h
+++ b/arch/hexagon/include/asm/irq.h
@@ -20,4 +20,7 @@
 
 #include <asm-generic/irq.h>
 
+struct pt_regs;
+void arch_do_IRQ(struct pt_regs *);
+
 #endif

-- 
2.43.0


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

* [PATCH 18/19] hexagon: traps: Remove sys_syscall()
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (16 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 17/19] hexagon: irq: Add prototype for arch_do_IRQ() Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 22:58 ` [PATCH 19/19] hexagon: traps: Add internal prototypes for functions only called from asm Nathan Chancellor
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/kernel/traps.c:335:6: warning: no previous prototype for function 'sys_syscall' [-Wmissing-prototypes]
    335 | long sys_syscall(void)
        |      ^
  arch/hexagon/kernel/traps.c:335:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    335 | long sys_syscall(void)
        | ^
        | static

This function is not used anywhere, so remove it.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/traps.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/arch/hexagon/kernel/traps.c b/arch/hexagon/kernel/traps.c
index 6447763ce5a9..3f6ff43cb514 100644
--- a/arch/hexagon/kernel/traps.c
+++ b/arch/hexagon/kernel/traps.c
@@ -331,13 +331,6 @@ void do_genex(struct pt_regs *regs)
 	}
 }
 
-/* Indirect system call dispatch */
-long sys_syscall(void)
-{
-	printk(KERN_ERR "sys_syscall invoked!\n");
-	return -ENOSYS;
-}
-
 void do_trap0(struct pt_regs *regs)
 {
 	syscall_fn syscall;

-- 
2.43.0


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

* [PATCH 19/19] hexagon: traps: Add internal prototypes for functions only called from asm
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (17 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 18/19] hexagon: traps: Remove sys_syscall() Nathan Chancellor
@ 2023-11-30 22:58 ` Nathan Chancellor
  2023-11-30 23:38 ` [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Andrew Morton
  2023-12-01  7:12 ` Arnd Bergmann
  20 siblings, 0 replies; 22+ messages in thread
From: Nathan Chancellor @ 2023-11-30 22:58 UTC (permalink / raw)
  To: bcain, akpm, arnd; +Cc: linux-hexagon, llvm, patches, Nathan Chancellor

Clang warns:

  arch/hexagon/kernel/traps.c:284:6: warning: no previous prototype for function 'do_genex' [-Wmissing-prototypes]
    284 | void do_genex(struct pt_regs *regs)
        |      ^
  arch/hexagon/kernel/traps.c:284:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    284 | void do_genex(struct pt_regs *regs)
        | ^
        | static
  arch/hexagon/kernel/traps.c:341:6: warning: no previous prototype for function 'do_trap0' [-Wmissing-prototypes]
    341 | void do_trap0(struct pt_regs *regs)
        |      ^
  arch/hexagon/kernel/traps.c:341:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    341 | void do_trap0(struct pt_regs *regs)
        | ^
        | static
  arch/hexagon/kernel/traps.c:418:6: warning: no previous prototype for function 'do_machcheck' [-Wmissing-prototypes]
    418 | void do_machcheck(struct pt_regs *regs)
        |      ^
  arch/hexagon/kernel/traps.c:418:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    418 | void do_machcheck(struct pt_regs *regs)
        | ^
        | static
  arch/hexagon/kernel/traps.c:428:6: warning: no previous prototype for function 'do_debug_exception' [-Wmissing-prototypes]
    428 | void do_debug_exception(struct pt_regs *regs)
        |      ^
  arch/hexagon/kernel/traps.c:428:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
    428 | void do_debug_exception(struct pt_regs *regs)
        | ^
        | static

These functions are only called from assembly or this translation unit,
so just add prototypes right above the definitions to silence the
warnings.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/hexagon/kernel/traps.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/hexagon/kernel/traps.c b/arch/hexagon/kernel/traps.c
index 3f6ff43cb514..75e062722d28 100644
--- a/arch/hexagon/kernel/traps.c
+++ b/arch/hexagon/kernel/traps.c
@@ -281,6 +281,7 @@ static void cache_error(struct pt_regs *regs)
 /*
  * General exception handler
  */
+void do_genex(struct pt_regs *regs);
 void do_genex(struct pt_regs *regs)
 {
 	/*
@@ -331,6 +332,7 @@ void do_genex(struct pt_regs *regs)
 	}
 }
 
+void do_trap0(struct pt_regs *regs);
 void do_trap0(struct pt_regs *regs)
 {
 	syscall_fn syscall;
@@ -408,6 +410,7 @@ void do_trap0(struct pt_regs *regs)
 /*
  * Machine check exception handler
  */
+void do_machcheck(struct pt_regs *regs);
 void do_machcheck(struct pt_regs *regs)
 {
 	/* Halt and catch fire */
@@ -418,6 +421,7 @@ void do_machcheck(struct pt_regs *regs)
  * Treat this like the old 0xdb trap.
  */
 
+void do_debug_exception(struct pt_regs *regs);
 void do_debug_exception(struct pt_regs *regs)
 {
 	regs->hvmer.vmest &= ~HVM_VMEST_CAUSE_MSK;

-- 
2.43.0


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

* Re: [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (18 preceding siblings ...)
  2023-11-30 22:58 ` [PATCH 19/19] hexagon: traps: Add internal prototypes for functions only called from asm Nathan Chancellor
@ 2023-11-30 23:38 ` Andrew Morton
  2023-12-01  7:12 ` Arnd Bergmann
  20 siblings, 0 replies; 22+ messages in thread
From: Andrew Morton @ 2023-11-30 23:38 UTC (permalink / raw)
  To: Nathan Chancellor; +Cc: bcain, arnd, linux-hexagon, llvm, patches

On Thu, 30 Nov 2023 15:58:13 -0700 Nathan Chancellor <nathan@kernel.org> wrote:

> This series fixes all the instances of -Wmissing-prototypes in
> arch/hexagon, now that it is enabled globally in a default build. I hope
> most of the patches will be uncontroversial but please let me know
> otherwise. This survives ARCH=hexagon defconfig and allmodconfig with
> LLVM 17.0.6.
> 
> This is based on Arnd's asm-generic-prototypes branch but it applies
> cleanly to 6.7-rc3 as well, in case Andrew wants to take it (as far as
> I remember, he has handled Hexagon patches for me in the past).

Thanks.  I added this to mm.git's mm-nonmm-unstable branch.

It precedes Arnd's "Makefile.extrawarn: turn on missing-prototypes
globally" so everything lands nicely without bisection issues.

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

* Re: [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes
  2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
                   ` (19 preceding siblings ...)
  2023-11-30 23:38 ` [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Andrew Morton
@ 2023-12-01  7:12 ` Arnd Bergmann
  20 siblings, 0 replies; 22+ messages in thread
From: Arnd Bergmann @ 2023-12-01  7:12 UTC (permalink / raw)
  To: Nathan Chancellor, Brian Cain, Andrew Morton; +Cc: linux-hexagon, llvm, patches

On Thu, Nov 30, 2023, at 23:58, Nathan Chancellor wrote:
> Hi all,
>
> This series fixes all the instances of -Wmissing-prototypes in
> arch/hexagon, now that it is enabled globally in a default build. I hope
> most of the patches will be uncontroversial but please let me know
> otherwise. This survives ARCH=hexagon defconfig and allmodconfig with
> LLVM 17.0.6.
>
> This is based on Arnd's asm-generic-prototypes branch but it applies
> cleanly to 6.7-rc3 as well, in case Andrew wants to take it (as far as
> I remember, he has handled Hexagon patches for me in the past).

The patches all look fine to me. I usually prefer to put prototypes
in a header even if the only caller is in a .S file rather than
adding them in front of the definition, but your version does
the job.

      Arnd

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

end of thread, other threads:[~2023-12-01  7:13 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-30 22:58 [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Nathan Chancellor
2023-11-30 22:58 ` [PATCH 01/19] hexagon: uaccess: Remove clear_user_hexagon() Nathan Chancellor
2023-11-30 22:58 ` [PATCH 02/19] hexagon: mm: Mark paging_init() as static Nathan Chancellor
2023-11-30 22:58 ` [PATCH 03/19] hexagon: mm: Include asm/setup.h for setup_arch_memory()'s prototype Nathan Chancellor
2023-11-30 22:58 ` [PATCH 04/19] hexagon: smp: Mark handle_ipi() and start_secondary() as static Nathan Chancellor
2023-11-30 22:58 ` [PATCH 05/19] hexagon: vm_fault: Mark do_page_fault() " Nathan Chancellor
2023-11-30 22:58 ` [PATCH 06/19] hexagon: vm_fault: Include asm/vm_fault.h for prototypes Nathan Chancellor
2023-11-30 22:58 ` [PATCH 07/19] hexagon: vm_tlb: Include asm/tlbflush.h " Nathan Chancellor
2023-11-30 22:58 ` [PATCH 08/19] hexagon: time: Include asm/time.h " Nathan Chancellor
2023-11-30 22:58 ` [PATCH 09/19] hexagon: time: Mark time_init_deferred() as static Nathan Chancellor
2023-11-30 22:58 ` [PATCH 10/19] hexagon: time: Include asm/delay.h for prototypes Nathan Chancellor
2023-11-30 22:58 ` [PATCH 11/19] hexagon: signal: Switch to SYSCALL_DEFINE0 for sys_rt_sigreturn() Nathan Chancellor
2023-11-30 22:58 ` [PATCH 12/19] hexagon: reset: Include linux/reboot.h for prototypes Nathan Chancellor
2023-11-30 22:58 ` [PATCH 13/19] hexagon: process: Include linux/cpu.h for arch_cpu_idle() prototype Nathan Chancellor
2023-11-30 22:58 ` [PATCH 14/19] hexagon: process: Add internal prototype for do_work_pending() Nathan Chancellor
2023-11-30 22:58 ` [PATCH 15/19] hexagon: vdso: Include asm/elf.h for arch_setup_additional_pages() prototype Nathan Chancellor
2023-11-30 22:58 ` [PATCH 16/19] hexagon: vm_events: Remove unused dummy_handler() Nathan Chancellor
2023-11-30 22:58 ` [PATCH 17/19] hexagon: irq: Add prototype for arch_do_IRQ() Nathan Chancellor
2023-11-30 22:58 ` [PATCH 18/19] hexagon: traps: Remove sys_syscall() Nathan Chancellor
2023-11-30 22:58 ` [PATCH 19/19] hexagon: traps: Add internal prototypes for functions only called from asm Nathan Chancellor
2023-11-30 23:38 ` [PATCH 00/19] hexagon: Fix up instances of -Wmissing-prototypes Andrew Morton
2023-12-01  7:12 ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).