1. 11 Dec, 2023 40 commits
    • Li Zhe's avatar
      softlockup: serialized softlockup's log · 9d02330a
      Li Zhe authored
      If multiple CPUs trigger softlockup at the same time with
      'softlockup_all_cpu_backtrace=0', the softlockup's logs will appear
      staggeredly in dmesg, which will affect the viewing of the logs for
      developer.  Since the code path for outputting softlockup logs is not a
      kernel hotspot and the performance requirements for the code are not
      strict, locks are used to serialize the softlockup log output to improve
      the readability of the logs.
      
      Link: https://lkml.kernel.org/r/20231123084022.10302-1-lizhe.67@bytedance.comSigned-off-by: default avatarLi Zhe <lizhe.67@bytedance.com>
      Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      Cc: Lecopzer Chen <lecopzer.chen@mediatek.com>
      Cc: Pingfan Liu <kernelfans@gmail.com>
      Cc: Zefan Li <lizefan.x@bytedance.com>
      Cc: John Ogness <john.ogness@linutronix.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      9d02330a
    • Baoquan He's avatar
      kexec_file: load kernel at top of system RAM if required · b3ba2341
      Baoquan He authored
      Patch series "kexec_file: Load kernel at top of system RAM if required".
      
      Justification:
      ==============
      
      Kexec_load interface has been doing top down searching and loading
      kernel/initrd/purgtory etc to prepare for kexec reboot.  In that way, the
      benefits are that it avoids to consume and fragment limited low memory
      which satisfy DMA buffer allocation and big chunk of continuous memory
      during system init; and avoids to stir with BIOS/FW reserved or occupied
      areas, or corner case handling/work around/quirk occupied areas when doing
      system init.  By the way, the top-down searching and loading of kexec-ed
      kernel is done in user space utility code.
      
      For kexec_file loading, even if kexec_buf.top_down is 'true', it's simply
      ignored.  It calls walk_system_ram_res() directly to go through all
      resources of System RAM bottom up, to find an available memory region,
      then call locate_mem_hole_callback() to allocate memory in that found
      memory region from top to down.  This is not expected and inconsistent
      with kexec_load.
      
      Implementation
      ===============
      
      In patch 1, introduce a new function walk_system_ram_res_rev() which is a
      variant of walk_system_ram_res(), it walks through a list of all the
      resources of System RAM in reversed order, i.e., from higher to lower.
      
      In patch 2, check if kexec_buf.top_down is 'true' in
      kexec_walk_resources(), if yes, call walk_system_ram_res_rev() to find
      memory region of system RAM from top to down to load kernel/initrd etc.
      
      Background information: ======================= And I ever tried this in
      the past in a different way, please see below link.  In the post, I tried
      to adjust struct sibling linking code, replace the the singly linked list
      with list_head so that walk_system_ram_res_rev() can be implemented in a
      much easier way.  Finally I failed. 
      https://lore.kernel.org/all/20180718024944.577-4-bhe@redhat.com/
      
      This time, I picked up the patch from AKASHI Takahiro's old post and made
      some change to take as the current patch 1:
      https://lists.infradead.org/pipermail/linux-arm-kernel/2017-September/531456.html
      
      
      This patch (of 2):
      
      Kexec_load interface has been doing top down searching and loading
      kernel/initrd/purgtory etc to prepare for kexec reboot.  In that way, the
      benefits are that it avoids to consume and fragment limited low memory
      which satisfy DMA buffer allocation and big chunk of continuous memory
      during system init; and avoids to stir with BIOS/FW reserved or occupied
      areas, or corner case handling/work around/quirk occupied areas when doing
      system init.  By the way, the top-down searching and loading of kexec-ed
      kernel is done in user space utility code.
      
      For kexec_file loading, even if kexec_buf.top_down is 'true', it's simply
      ignored.  It calls walk_system_ram_res() directly to go through all
      resources of System RAM bottom up, to find an available memory region,
      then call locate_mem_hole_callback() to allocate memory in that found
      memory region from top to down.  This is not expected and inconsistent
      with kexec_load.
      
      Here check if kexec_buf.top_down is 'true' in kexec_walk_resources(), if
      yes, call the newly added walk_system_ram_res_rev() to find memory region
      of system RAM from top to down to load kernel/initrd etc.
      
      Link: https://lkml.kernel.org/r/20231114091658.228030-1-bhe@redhat.com
      Link: https://lkml.kernel.org/r/20231114091658.228030-3-bhe@redhat.comSigned-off-by: default avatarBaoquan He <bhe@redhat.com>
      Cc: AKASHI Takahiro <takahiro.akashi@linaro.org>
      Cc: Baoquan He <bhe@redhat.com>
      Cc: Eric Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      b3ba2341
    • Baoquan He's avatar
      resource: add walk_system_ram_res_rev() · 7acf164b
      Baoquan He authored
      This function, being a variant of walk_system_ram_res() introduced in
      commit 8c86e70a ("resource: provide new functions to walk through
      resources"), walks through a list of all the resources of System RAM in
      reversed order, i.e., from higher to lower.
      
      It will be used in kexec_file code to load kernel, initrd etc when
      preparing kexec reboot.
      
      Link: https://lkml.kernel.org/r/ZVTA6z/06cLnWKUz@MiWiFi-R3L-srvSigned-off-by: default avatarAKASHI Takahiro <takahiro.akashi@linaro.org>
      Signed-off-by: default avatarBaoquan He <bhe@redhat.com>
      Cc: Eric Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      7acf164b
    • Stephen Rothwell's avatar
      powerpc: pmd_move_must_withdraw() is only needed for CONFIG_TRANSPARENT_HUGEPAGE · bfc4372b
      Stephen Rothwell authored
      This is required for the later patch "Makefile.extrawarn: turn on
      missing-prototypes globally".
      
      Link: https://lkml.kernel.org/r/20231127132809.45c2b398@canb.auug.org.auSigned-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Acked-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      bfc4372b
    • Arnd Bergmann's avatar
      usb: fsl-mph-dr-of: mark fsl_usb2_mpc5121_init() static · 0025aa93
      Arnd Bergmann authored
      This function is only called locally and should always have been static:
      
      drivers/usb/host/fsl-mph-dr-of.c:291:5: error: no previous prototype for 'fsl_usb2_mpc5121_init' [-Werror=missing-prototypes]
      
      Link: https://lkml.kernel.org/r/20231123110506.707903-6-arnd@kernel.org
      Fixes: 230f7ede ("USB: add USB EHCI support for MPC5121 SoC")
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nicolas Schier <nicolas@fjasle.eu>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <richard.henderson@linaro.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Tudor Ambarus <tudor.ambarus@linaro.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Zhihao Cheng <chengzhihao1@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      0025aa93
    • Arnd Bergmann's avatar
      x86: sta2x11: include header for sta2x11_get_instance() prototype · 9fcba2e9
      Arnd Bergmann authored
      sta2x11_get_instance() is a global function declared in asm/sta2x11.h, but
      this header is not included before the definition, causing a warning:
      
      arch/x86/pci/sta2x11-fixup.c:95:26: error: no previous prototype for 'sta2x11_get_instance' [-Werror=missing-prototypes]
      
      Add the missing #include.
      
      Link: https://lkml.kernel.org/r/20231123110506.707903-5-arnd@kernel.org
      Fixes: 83125a3a ("x86, platform: Initial support for sta2x11 I/O hub")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nicolas Schier <nicolas@fjasle.eu>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <richard.henderson@linaro.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Tudor Ambarus <tudor.ambarus@linaro.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Zhihao Cheng <chengzhihao1@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      9fcba2e9
    • Arnd Bergmann's avatar
      sched: fair: move unused stub functions to header · b1c3efe0
      Arnd Bergmann authored
      These four functions have a normal definition for CONFIG_FAIR_GROUP_SCHED,
      and empty one that is only referenced when FAIR_GROUP_SCHED is disabled
      but CGROUP_SCHED is still enabled.  If both are turned off, the functions
      are still defined but the misisng prototype causes a W=1 warning:
      
      kernel/sched/fair.c:12544:6: error: no previous prototype for 'free_fair_sched_group'
      kernel/sched/fair.c:12546:5: error: no previous prototype for 'alloc_fair_sched_group'
      kernel/sched/fair.c:12553:6: error: no previous prototype for 'online_fair_sched_group'
      kernel/sched/fair.c:12555:6: error: no previous prototype for 'unregister_fair_sched_group'
      
      Move the alternatives into the header as static inline functions with the
      correct combination of #ifdef checks to avoid the warning without adding
      even more complexity.
      
      [A different patch with the same description got applied by accident
       and was later reverted, but the original patch is still missing]
      
      Link: https://lkml.kernel.org/r/20231123110506.707903-4-arnd@kernel.org
      Fixes: 7aa55f2a ("sched/fair: Move unused stub functions to header")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nicolas Schier <nicolas@fjasle.eu>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <richard.henderson@linaro.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Tudor Ambarus <tudor.ambarus@linaro.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Zhihao Cheng <chengzhihao1@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      b1c3efe0
    • Arnd Bergmann's avatar
      jffs2: mark __jffs2_dbg_superblock_counts() static · a9a6c365
      Arnd Bergmann authored
      This function is only called locally and does not need to be global. 
      Since there is no external prototype, gcc warns about the non-static
      definition:
      
      fs/jffs2/debug.c:160:6: error: no previous prototype for '__jffs2_dbg_superblock_counts' [-Werror=missing-prototypes]
      
      Link: https://lkml.kernel.org/r/20231123110506.707903-3-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarTudor Ambarus <tudor.ambarus@linaro.org>
      Reviewed-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nicolas Schier <nicolas@fjasle.eu>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <richard.henderson@linaro.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      a9a6c365
    • Arnd Bergmann's avatar
      ida: make 'ida_dump' static · fd6f52e3
      Arnd Bergmann authored
      Patch series "Treewide: enable -Wmissing-prototypes", v3.
      
      At this point, there are five architectures with a number of known
      regressions: alpha, nios2, mips, sh and sparc.  In the previous version of
      this patch, I had turned off the missing prototype warnings for the 15
      architectures that still had issues, but since there are only five left, I
      think we can leave the rest to the maintainers (Cc'd here) as well.
      
      The series is also likely to cause occasional build regressions on
      linux-next as developers add new code that misses prototypes.  Hopefully
      this should be resolved by the time the patches make it into a release and
      everyone gets the warnings right away.  
      
      
      This patch (of 6):
      
      There is no global declaration for ida_dump() and no other callers, so
      make it static to avoid this warning:
      
      lib/test_ida.c:16:6: error: no previous prototype for 'ida_dump'
      
      Link: https://lkml.kernel.org/r/20231123110506.707903-1-arnd@kernel.org
      Link: https://lkml.kernel.org/r/20231123110506.707903-2-arnd@kernel.org
      Fixes: 8ab8ba38 ("ida: Start new test_ida module")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Masahiro Yamada <masahiroy@kernel.org>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nicolas Schier <nicolas@fjasle.eu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Henderson <richard.henderson@linaro.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Tudor Ambarus <tudor.ambarus@linaro.org>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Zhihao Cheng <chengzhihao1@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      fd6f52e3
    • Arnd Bergmann's avatar
      mips: kexec: include linux/reboot.h · 430b6ac0
      Arnd Bergmann authored
      Two functions are provided for kexec, but the mips implementation is
      missing the corresponding #include statment:
      
      arch/mips/kernel/machine_kexec.c:136:1: error: no previous prototype for 'machine_shutdown' [-Werror=missing-prototypes]
      arch/mips/kernel/machine_kexec.c:152:1: error: no previous prototype for 'machine_crash_shutdown' [-Werror=missing-prototypes]
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-21-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      430b6ac0
    • Arnd Bergmann's avatar
      mips: smp: fix setup_profiling_timer() prototype · d1f4b2b8
      Arnd Bergmann authored
      The function is unconditionally defined in smp.c but is conditionally
      declared in a header that is not included here.
      
      arch/mips/kernel/smp.c:473:5: error: no previous prototype for 'setup_profiling_timer' [-Werror=missing-prototypes]
      
      Add the missing #include and #ifdef to match the declaration.
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-20-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      d1f4b2b8
    • Arnd Bergmann's avatar
      mips: hide conditionally unused functions · b4fc7a3c
      Arnd Bergmann authored
      A couple of functions are defined unconditionally but have a conditional
      declaration:
      
      arch/mips/mm/tlb-r4k.c:461:12: error: no previous prototype for 'add_temporary_entry' [-Werror=missing-prototypes]
      arch/mips/mm/pgtable-64.c:92:7: error: no previous prototype for 'mk_pmd' [-Werror=missing-prototypes]
      arch/mips/mm/pgtable-64.c:101:6: error: no previous prototype for 'set_pmd_at' [-Werror=missing-prototypes]
      
      Since there are no callers in these configurations, add the same #ifdef
      checks around the definitions.
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-19-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      b4fc7a3c
    • Arnd Bergmann's avatar
      mips: suspend: include linux/suspend.h as needed · a3075dcb
      Arnd Bergmann authored
      A couple of functions are defined by the architecture and declared in
      linux/suspend.h, but mips is lacking the corresponding #include statement
      before the definition:
      
      arch/mips/power/cpu.c:16:6: warning: no previous prototype for 'save_processor_state' [-Wmissing-prototypes]
      arch/mips/power/cpu.c:26:6: warning: no previous prototype for 'restore_processor_state' [-Wmissing-prototypes]
      arch/mips/power/cpu.c:36:5: warning: no previous prototype for 'pfn_is_nosave' [-Wmissing-prototypes]
      arch/mips/power/hibernate.c:6:5: warning: no previous prototype for 'swsusp_arch_resume' [-Wmissing-prototypes]
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-18-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      a3075dcb
    • Arnd Bergmann's avatar
      mips: mt: include asm/mips_mt.h · 4666cf01
      Arnd Bergmann authored
      These two functions have a global prototype but the header is not included
      before the function definitions:
      
      arch/mips/kernel/mips-mt.c:50:6: error: no previous prototype for 'mips_mt_regdump' [-Werror=missing-prototypes]
      arch/mips/kernel/mips-mt.c:159:6: error: no previous prototype for 'mips_mt_set_cpuoptions' [-Werror=missing-prototypes]
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-16-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      4666cf01
    • Arnd Bergmann's avatar
      mips: spram: fix missing prototype warning for spram_config · 858c638c
      Arnd Bergmann authored
      arch/mips/kernel/spram.c:194:6: error: no previous prototype for 'spram_config' [-Werror=missing-prototypes]
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-15-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      858c638c
    • Arnd Bergmann's avatar
      mips: add missing declarations · 7dc5b892
      Arnd Bergmann authored
      These are three more functions that are only called from assembler and
      only need a declaration to avoid the -Wmissing-prototypes warnings:
      
      arch/mips/kernel/signal.c:904:17: error: no previous prototype for 'do_notify_resume' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:370:6: error: no previous prototype for 'show_registers' [-Werror=missing-prototypes]
      arch/mips/kernel/smp.c:352:17: error: no previous prototype for 'start_secondary' [-Werror=missing-prototypes]
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-14-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      7dc5b892
    • Arnd Bergmann's avatar
      mips: move cache declarations into header · 66445677
      Arnd Bergmann authored
      Some of the cache functions are declared only for their callers, e.g.
      
      arch/mips/mm/c-r3k.c:28:15: error: no previous prototype for 'r3k_cache_size' [-Werror=missing-prototypes]
      arch/mips/mm/c-r3k.c:63:15: error: no previous prototype for 'r3k_cache_lsize' [-Werror=missing-prototypes]
      arch/mips/mm/c-r4k.c:1703:6: error: no previous prototype for 'r4k_cache_init' [-Werror=missing-prototypes]
      arch/mips/mm/sc-mips.c:255:5: error: no previous prototype for 'mips_sc_init' [-Werror=missing-prototypes]
      
      Move all the declarations to asm/cache.h and asm/r4kcache.h where they
      can be seen by the function definitions.
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-13-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      66445677
    • Arnd Bergmann's avatar
      mips: fix tlb_init() prototype · ec47b986
      Arnd Bergmann authored
      There are two definitions for tlb_init(), but no global declaration:
      
      arch/mips/mm/tlb-r4k.c:552:6: error: no previous prototype for 'tlb_init' [-Werror=missing-prototypes]
      arch/mips/mm/tlb-r3k.c:244:6: error: no previous prototype for 'tlb_init' [-Werror=missing-prototypes]
      
      Move the declaration to asm/setup.h and included it as needed.
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-12-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      ec47b986
    • Arnd Bergmann's avatar
      mips: fix setup_zero_pages() prototype · e021227a
      Arnd Bergmann authored
      setup_zero_pages() has a local declaration in a platform specific header,
      but that is not seen in the file it is defined in:
      
      arch/mips/mm/init.c:60:6: error: no previous prototype for 'setup_zero_pages' [-Werror=missing-prototypes]
      
      Move it to the corresponding global header and include that where needed.
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-11-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      e021227a
    • Arnd Bergmann's avatar
      mips: unhide uasm_in_compat_space_p() declaration · e9f98feb
      Arnd Bergmann authored
      uasm_in_compat_space_p() has a conditional declaration but is defined
      unconditionally because of another local user, which causes a warning:
      
      arch/mips/mm/uasm.c:421:5: error: no previous prototype for 'uasm_in_compat_space_p' [-Werror=missing-prototypes]
      
      Make the declaration unconditional to avoid this.
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-10-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      e9f98feb
    • Arnd Bergmann's avatar
      mips: move jump_label_apply_nops() declaration to header · ad6eb1ec
      Arnd Bergmann authored
      Instead of an extern declaration in the C file with the caller, move it to
      an appropriate header, avoiding
      
      arch/mips/kernel/jump_label.c:93:6: error: no previous prototype for 'jump_label_apply_nops' [-Werror=missing-prototypes]
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-9-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      ad6eb1ec
    • Arnd Bergmann's avatar
      mips: move build_tlb_refill_handler() prototype · 6fb04df9
      Arnd Bergmann authored
      Instead of having a declaration for each caller, have one that is shared
      with the function definition, which avoids a warning:
      
      arch/mips/mm/tlbex.c:2547:6: error: no previous prototype for 'build_tlb_refill_handler' [-Werror=missing-prototypes]
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-8-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      6fb04df9
    • Arnd Bergmann's avatar
      mips: mark local function static if possible · 9a203672
      Arnd Bergmann authored
      These two functions are global but have no extern prototypes or other
      callers, so it's best to mark them as static, avoiding these warnings:
      
      arch/mips/kernel/mips-cm.c:204:13: error: no previous prototype for '__mips_cm_l2sync_phys_base' [-Werror=missing-prototypes]
      arch/mips/mm/c-r4k.c:1827:12: error: no previous prototype for 'r4k_cache_init_pm' [-Werror=missing-prototypes]
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-7-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      9a203672
    • Arnd Bergmann's avatar
      mips: signal: move sigcontext declarations to header · 2894a8c4
      Arnd Bergmann authored
      Function declarations should be in a shared header to ensure the
      prototypes match the definition:
      
      arch/mips/kernel/signal.c:439:5: error: no previous prototype for 'setup_sigcontext' [-Werror=missing-prototypes]
      arch/mips/kernel/signal.c:516:5: error: no previous prototype for 'restore_sigcontext' [-Werror=missing-prototypes]
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-6-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      2894a8c4
    • Arnd Bergmann's avatar
      mips: rs870e: stop exporting local functions · 2657bc63
      Arnd Bergmann authored
      These four functions are exported, but don't have any users, and no
      prototypes, which now causes warnings:
      
      drivers/platform/mips/rs780e-acpi.c:35:6: error: no previous prototype for 'pm_iowrite' [-Werror=missing-prototypes]
      drivers/platform/mips/rs780e-acpi.c:41:4: error: no previous prototype for 'pm_ioread' [-Werror=missing-prototypes]
      drivers/platform/mips/rs780e-acpi.c:47:6: error: no previous prototype for 'pm2_iowrite' [-Werror=missing-prototypes]
      drivers/platform/mips/rs780e-acpi.c:53:4: error: no previous prototype for 'pm2_ioread' [-Werror=missing-prototypes]
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-5-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      2657bc63
    • Arnd Bergmann's avatar
      mips: add missing declarations for trap handlers · 09fc778e
      Arnd Bergmann authored
      These exception handlers are all called from assembly code, so they don't
      normally need a declaration, but without one we now get warnings:
      
      arch/mips/mm/fault.c:323:17: error: no previous prototype for 'do_page_fault' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:447:17: error: no previous prototype for 'do_be' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:752:17: error: no previous prototype for 'do_ov' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:874:17: error: no previous prototype for 'do_fpe' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1027:17: error: no previous prototype for 'do_bp' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1114:17: error: no previous prototype for 'do_tr' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1151:17: error: no previous prototype for 'do_ri' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1402:17: error: no previous prototype for 'do_cpu' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1507:17: error: no previous prototype for 'do_msa_fpe' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1527:17: error: no previous prototype for 'do_msa' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1548:17: error: no previous prototype for 'do_mdmx' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1560:17: error: no previous prototype for 'do_watch' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1587:17: error: no previous prototype for 'do_mcheck' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1612:17: error: no previous prototype for 'do_mt' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1648:17: error: no previous prototype for 'do_dsp' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1656:17: error: no previous prototype for 'do_reserved' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1832:17: error: no previous prototype for 'cache_parity_error' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1880:17: error: no previous prototype for 'do_ftlb' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1909:17: error: no previous prototype for 'do_gsexc' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1944:6: error: no previous prototype for 'ejtag_exception_handler' [-Werror=missing-prototypes]
      arch/mips/kernel/traps.c:1989:17: error: no previous prototype for 'nmi_exception_handler' [-Werror=missing-prototypes]
      arch/mips/kernel/unaligned.c:1516:17: error: no previous prototype for 'do_ade' [-Werror=missing-prototypes]
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-4-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      09fc778e
    • Arnd Bergmann's avatar
      mips: add asm/syscalls.h header · be018aaa
      Arnd Bergmann authored
      System call prototypes are generally in linux/syscalls.h, but there are a
      couple of mips specific entry points that are missing there:
      
      arch/mips/kernel/signal.c:636:17: error: no previous prototype for 'sys_sigreturn' [-Werror=missing-prototypes]
      arch/mips/kernel/signal.c:673:17: error: no previous prototype for 'sys_rt_sigreturn' [-Werror=missing-prototypes]
      arch/mips/kernel/syscall.c:51:16: error: no previous prototype for 'sysm_pipe' [-Werror=missing-prototypes]
      arch/mips/kernel/mips-mt-fpaff.c:65:17: error: no previous prototype for 'mipsmt_sys_sched_setaffinity' [-Werror=missing-prototypes]
      arch/mips/kernel/mips-mt-fpaff.c:157:17: error: no previous prototype for 'mipsmt_sys_sched_getaffinity' [-Werror=missing-prototypes]
      
      Add these to a new asm/syscalls.h as we have in other architectures.
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-3-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      be018aaa
    • Arnd Bergmann's avatar
      mips: decompress: fix add missing prototypes · 1b5e6f4e
      Arnd Bergmann authored
      Patch series "mips: address -Wmissing-prototypes warnings".
      
      Address the -Wmissing-prototypes warnings that showed up in mips as the
      last major architecture after my patch to enable the option everywhere.
      
      
      This patch (of 20):
      
      The mips decompressor has some string functions defined locally that are
      not declared in the right place:
      
      arch/mips/boot/compressed/dbg.c:12:13: error: no previous prototype for 'putc' [-Werror=missing-prototypes]
      arch/mips/boot/compressed/dbg.c:16:6: error: no previous prototype for 'puts' [-Werror=missing-prototypes]
      arch/mips/boot/compressed/dbg.c:26:6: error: no previous prototype for 'puthex' [-Werror=missing-prototypes]
      arch/mips/boot/compressed/string.c:11:7: error: no previous prototype for 'memcpy' [-Werror=missing-prototypes]
      arch/mips/boot/compressed/string.c:22:7: error: no previous prototype for 'memset' [-Werror=missing-prototypes]
      arch/mips/boot/compressed/string.c:32:15: error: no previous prototype for 'memmove' [-Werror=missing-prototypes]
      arch/mips/boot/compressed/decompress.c:43:6: error: no previous prototype for 'error' [-Werror=missing-prototypes]
      arch/mips/boot/compressed/decompress.c:91:6: error: no previous prototype for 'decompress_kernel' [-Werror=missing-prototypes]
      
      Include the string.h header where needed and add a decompress.h header to
      have shared prototypes for the rest.
      
      Link: https://lkml.kernel.org/r/20231204115710.2247097-1-arnd@kernel.org
      Link: https://lkml.kernel.org/r/20231204115710.2247097-2-arnd@kernel.orgSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Cc: Stephen Rothwell <sfr@rothwell.id.au>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      1b5e6f4e
    • Nathan Chancellor's avatar
      s390/traps: only define is_valid_bugaddr() under CONFIG_GENERIC_BUG · 78af7920
      Nathan Chancellor authored
      When building with -Wmissing-prototypes without CONFIG_GENERIC_BUG, there
      is a warning about a missing prototype for is_valid_bugaddr():
      
        arch/s390/kernel/traps.c:46:5: warning: no previous prototype for 'is_valid_bugaddr' [-Wmissing-prototypes]
           46 | int is_valid_bugaddr(unsigned long addr)
              |     ^~~~~~~~~~~~~~~~
      
      The prototype is only declared with CONFIG_GENERIC_BUG, so only define the
      function under the same condition to clear up the warning, which matches
      other architectures.
      
      Link: https://lkml.kernel.org/r/20231130-s390-missing-prototypes-v1-2-799d3cf07fb7@kernel.orgSigned-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Jan Höppner <hoeppner@linux.ibm.com>
      Cc: Stefan Haberland <sth@linux.ibm.com>
      Cc: Sven Schnelle <svens@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      78af7920
    • Nathan Chancellor's avatar
      s390/dasd: remove dasd_stats_generic_show() · c0706cfc
      Nathan Chancellor authored
      Patch series "s390: A couple of fixes for -Wmissing-prototypes".
      
      This series resolves a couple of -Wmissing-prototypes that I see in my
      builds of -next, even though the issues appear to be latent.  This
      addresses issues which will be exposed by the later patch
      "Makefile.extrawarn: turn on missing-prototypes globally".
      
      
      This patch (of 2):
      
      With CONFIG_DASD_PROFILE=n, there is a warning that
      dasd_stats_generic_show() is missing a prototype:
      
        drivers/s390/block/dasd.c:1109:5: warning: no previous prototype for 'dasd_stats_generic_show' [-Wmissing-prototypes]
         1109 | int dasd_stats_generic_show(struct seq_file *m, void *v)
              |     ^~~~~~~~~~~~~~~~~~~~~~~
      
      This function has been unused since its introduction in commit
      4fa52aa7 ("[S390] dasd: add enhanced DASD statistics interface"),
      remove it to clear up the warning.
      
      Link: https://lkml.kernel.org/r/20231130-s390-missing-prototypes-v1-0-799d3cf07fb7@kernel.org
      Link: https://lkml.kernel.org/r/20231130-s390-missing-prototypes-v1-1-799d3cf07fb7@kernel.orgSigned-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Alexander Gordeev <agordeev@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Jan Höppner <hoeppner@linux.ibm.com>
      Cc: Stefan Haberland <sth@linux.ibm.com>
      Cc: Sven Schnelle <svens@linux.ibm.com>
      Cc: Vasily Gorbik <gor@linux.ibm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      c0706cfc
    • Nathan Chancellor's avatar
      hexagon: traps: add internal prototypes for functions only called from asm · 2562a3ae
      Nathan Chancellor authored
      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.
      
      Link: https://lkml.kernel.org/r/20231130-hexagon-missing-prototypes-v1-19-5c34714afe9e@kernel.orgSigned-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Brian Cain <bcain@quicinc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      2562a3ae
    • Nathan Chancellor's avatar
      hexagon: traps: remove sys_syscall() · d6b0180e
      Nathan Chancellor authored
      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.
      
      Link: https://lkml.kernel.org/r/20231130-hexagon-missing-prototypes-v1-18-5c34714afe9e@kernel.orgSigned-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Brian Cain <bcain@quicinc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      d6b0180e
    • Nathan Chancellor's avatar
      hexagon: irq: add prototype for arch_do_IRQ() · 2212acda
      Nathan Chancellor authored
      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.
      
      Link: https://lkml.kernel.org/r/20231130-hexagon-missing-prototypes-v1-17-5c34714afe9e@kernel.orgSigned-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Brian Cain <bcain@quicinc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      2212acda
    • Nathan Chancellor's avatar
      hexagon: vm_events: remove unused dummy_handler() · d9f85d8b
      Nathan Chancellor authored
      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.
      
      Link: https://lkml.kernel.org/r/20231130-hexagon-missing-prototypes-v1-16-5c34714afe9e@kernel.orgSigned-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Brian Cain <bcain@quicinc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      d9f85d8b
    • Nathan Chancellor's avatar
      hexagon: vdso: include asm/elf.h for arch_setup_additional_pages() prototype · d75eb334
      Nathan Chancellor authored
      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.
      
      Link: https://lkml.kernel.org/r/20231130-hexagon-missing-prototypes-v1-15-5c34714afe9e@kernel.orgSigned-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Brian Cain <bcain@quicinc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      d75eb334
    • Nathan Chancellor's avatar
      hexagon: process: add internal prototype for do_work_pending() · 54ba0eab
      Nathan Chancellor authored
      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.
      
      Link: https://lkml.kernel.org/r/20231130-hexagon-missing-prototypes-v1-14-5c34714afe9e@kernel.orgSigned-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Brian Cain <bcain@quicinc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      54ba0eab
    • Nathan Chancellor's avatar
      hexagon: process: include linux/cpu.h for arch_cpu_idle() prototype · b0f73122
      Nathan Chancellor authored
      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.
      
      Link: https://lkml.kernel.org/r/20231130-hexagon-missing-prototypes-v1-13-5c34714afe9e@kernel.orgSigned-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Brian Cain <bcain@quicinc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      b0f73122
    • Nathan Chancellor's avatar
      hexagon: reset: include linux/reboot.h for prototypes · 9e063737
      Nathan Chancellor authored
      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.
      
      Link: https://lkml.kernel.org/r/20231130-hexagon-missing-prototypes-v1-12-5c34714afe9e@kernel.orgSigned-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Brian Cain <bcain@quicinc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      9e063737
    • Nathan Chancellor's avatar
      hexagon: signal: switch to SYSCALL_DEFINE0 for sys_rt_sigreturn() · cb0085b0
      Nathan Chancellor authored
      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.
      
      Link: https://lkml.kernel.org/r/20231130-hexagon-missing-prototypes-v1-11-5c34714afe9e@kernel.orgSigned-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Brian Cain <bcain@quicinc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      cb0085b0
    • Nathan Chancellor's avatar
      hexagon: time: include asm/delay.h for prototypes · d068b123
      Nathan Chancellor authored
      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
      
      Link: https://lkml.kernel.org/r/20231130-hexagon-missing-prototypes-v1-10-5c34714afe9e@kernel.orgSigned-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Brian Cain <bcain@quicinc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      d068b123