[PATCH 1/6] powerpc/85xx: Fix no previous prototype warning for mpc85xx_setup_pmc()
Subsystems:
linux for powerpc (32-bit and 64-bit) , linux for powerpc embedded ppc85xx , the rest
STALE1729d
LANDED
Landed in mainline as 4ea9e321c27f on 2021-11-29.
7 messages,
2 authors,
2021-12-07 · open the first message on its own page
Fixes the following W=1 warning:
arch/powerpc/platforms/85xx/mpc85xx_pm_ops.c:89:12: warning: no previous prototype for 'mpc85xx_setup_pmc'
Reported-by: kernel test robot <redacted>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/platforms/85xx/mpc85xx_pm_ops.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_pm_ops.c b/arch/powerpc/platforms/85xx/mpc85xx_pm_ops.c
index 4a8af80011a6..f7ac92a8ae97 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_pm_ops.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_pm_ops.c @@ -15,6 +15,8 @@
#include <asm/io.h>
#include <asm/fsl_pm.h>
+ #include "smp.h"
+
static struct ccsr_guts __iomem * guts ;
#ifdef CONFIG_FSL_PMC --
2.31.1
To fix the W=1 warning:
arch/powerpc/platforms/85xx/smp.c:369:6: error: no previous prototype for ‘mpc85xx_smp_kexec_cpu_down’
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/platforms/85xx/smp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index 83f4a6389a28..0abc1da2c14f 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c @@ -366,7 +366,7 @@ struct smp_ops_t smp_85xx_ops = {
#ifdef CONFIG_PPC32
atomic_t kexec_down_cpus = ATOMIC_INIT ( 0 );
- void mpc85xx_smp_kexec_cpu_down ( int crash_shutdown , int secondary )
+ static void mpc85xx_smp_kexec_cpu_down ( int crash_shutdown , int secondary )
{
local_irq_disable ();
@@ -384,7 +384,7 @@ static void mpc85xx_smp_kexec_down(void *arg)
ppc_md . kexec_cpu_down ( 0 , 1 );
}
#else
- void mpc85xx_smp_kexec_cpu_down ( int crash_shutdown , int secondary )
+ static void mpc85xx_smp_kexec_cpu_down ( int crash_shutdown , int secondary )
{
int cpu = smp_processor_id ();
int sibling = cpu_last_thread_sibling ( cpu ); --
2.31.1
To fix the W=1 warning:
linux/arch/powerpc/platforms/85xx/c293pcie.c:22:13: error: no previous prototype for ‘c293_pcie_pic_init’
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/platforms/85xx/c293pcie.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/85xx/c293pcie.c b/arch/powerpc/platforms/85xx/c293pcie.c
index 8d9a2503dd0f..58a398c89e97 100644
--- a/arch/powerpc/platforms/85xx/c293pcie.c
+++ b/arch/powerpc/platforms/85xx/c293pcie.c @@ -19,7 +19,7 @@
#include "mpc85xx.h"
- void __init c293_pcie_pic_init ( void )
+ static void __init c293_pcie_pic_init ( void )
{
struct mpic * mpic = mpic_alloc ( NULL , 0 , MPIC_BIG_ENDIAN |
MPIC_SINGLE_DEST_CPU , 0 , 256 , " OpenPIC " ); --
2.31.1
Building with W=1 we see a warning:
linux/arch/powerpc/mm/nohash/fsl_book3e.c:63:15: error: no previous prototype for ‘tlbcam_sz’
tlbcam_sz() is not used outside this file, so we can make it static.
However it's only used inside #ifdef CONFIG_PPC32, so move it within
that ifdef, otherwise we would get a defined but not used error.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/mm/nohash/fsl_book3e.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/mm/nohash/fsl_book3e.c b/arch/powerpc/mm/nohash/fsl_book3e.c
index b231a54f540c..7f71bc3bf85f 100644
--- a/arch/powerpc/mm/nohash/fsl_book3e.c
+++ b/arch/powerpc/mm/nohash/fsl_book3e.c @@ -60,11 +60,6 @@ struct tlbcamrange {
phys_addr_t phys ;
} tlbcam_addrs [ NUM_TLBCAMS ];
- unsigned long tlbcam_sz ( int idx )
- {
- return tlbcam_addrs [ idx ]. limit - tlbcam_addrs [ idx ]. start + 1 ;
- }
-
#ifdef CONFIG_FSL_BOOKE
/*
* Return PA for this VA if it is mapped by a CAM , or 0 @@ -264,6 +259,11 @@ void __init MMU_init_hw(void)
flush_instruction_cache ();
}
+ static unsigned long tlbcam_sz ( int idx )
+ {
+ return tlbcam_addrs [ idx ]. limit - tlbcam_addrs [ idx ]. start + 1 ;
+ }
+
void __init adjust_total_lowmem ( void )
{
unsigned long ram ; --
2.31.1
setup_profiling_timer() is only needed when CONFIG_PROFILING is enabled.
Fixes the following W=1 warning when CONFIG_PROFILING=n:
linux/arch/powerpc/kernel/smp.c:1638:5: error: no previous prototype for ‘setup_profiling_timer’
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/kernel/smp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index c23ee842c4c3..aee3a7119f97 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c @@ -1635,10 +1635,12 @@ void start_secondary(void *unused)
BUG ();
}
+ #ifdef CONFIG_PROFILING
int setup_profiling_timer ( unsigned int multiplier )
{
return 0 ;
}
+ #endif
static void fixup_topology ( void )
{ --
2.31.1
Prior to commit b1923caa6e64 ("powerpc: Merge 32-bit and 64-bit
setup_arch()") probe_machine() was called from setup_32/64.c and lived
in setup-common.c. But now it's only called from setup-common.c so it
can be static and __init, and we don't need the declaration in
machdep.h either.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/include/asm/machdep.h | 2 --
arch/powerpc/kernel/setup-common.c | 2 +-
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h
index 9c3c9f04129f..e821037f74f0 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h @@ -235,8 +235,6 @@ extern struct machdep_calls *machine_id;
machine_id == & mach_ ## name ; \
})
- extern void probe_machine ( void );
-
#ifdef CONFIG_PPC_PMAC
/*
* Power macintoshes have either a CUDA , PMU or SMU controlling diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 4f1322b65760..f8da937df918 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c @@ -582,7 +582,7 @@ static __init int add_pcspkr(void)
device_initcall ( add_pcspkr );
#endif /* CONFIG_PCSPKR_PLATFORM */
- void probe_machine ( void )
+ static __init void probe_machine ( void )
{
extern struct machdep_calls __machine_desc_start ;
extern struct machdep_calls __machine_desc_end ; --
2.31.1
On Wed, 24 Nov 2021 20:32:49 +1100, Michael Ellerman wrote: Fixes the following W=1 warning:
arch/powerpc/platforms/85xx/mpc85xx_pm_ops.c:89:12: warning: no previous prototype for 'mpc85xx_setup_pmc'
Applied to powerpc/next.
[1/6] powerpc/85xx: Fix no previous prototype warning for mpc85xx_setup_pmc()
https://git.kernel.org/powerpc/c/4ea9e321c27fd531a8dfe0fa1d1b2ee15fc3444e
[2/6] powerpc/85xx: Make mpc85xx_smp_kexec_cpu_down() static
https://git.kernel.org/powerpc/c/84a61fb43fdfc528a3a7ff00e0b14ba91f5eb745
[3/6] powerpc/85xx: Make c293_pcie_pic_init() static
https://git.kernel.org/powerpc/c/d9150d5bb5586dc20b6c424e59d5ea29fe1b3030
[4/6] powerpc/mm: Move tlbcam_sz() and make it static
https://git.kernel.org/powerpc/c/ff47a95d1a67477e9bc2049a840d93b68508e079
[5/6] powerpc/smp: Move setup_profiling_timer() under CONFIG_PROFILING
https://git.kernel.org/powerpc/c/a4ac0d249a5db80e79d573db9e4ad29354b643a8
[6/6] powerpc: Mark probe_machine() __init and static
https://git.kernel.org/powerpc/c/ab85a273957eadfcf7906bcd8a0adf5909d802ee
cheers