* [PATCH 1/7] m68knommu: coldfire: add and use "vectors.h"
2023-09-13 13:44 [PATCH 0/7] m68knommu: W=1 fixes Greg Ungerer
@ 2023-09-13 13:44 ` Greg Ungerer
2023-09-13 13:44 ` [PATCH 2/7] m68knommu: coldfire: ensure gpio prototypes visible Greg Ungerer
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Greg Ungerer @ 2023-09-13 13:44 UTC (permalink / raw)
To: linux-m68k; +Cc: geert, Greg Ungerer
When building with W=1:
arch/m68k/coldfire/vectors.c:43:13: warning: no previous prototype for ‘trap_init’ [-Wmissing-prototypes]
void __init trap_init(void)
^~~~~~~~~
Fix this by introducing a new header file "vectors.h" for holding the
prototypes of functions implemented in arch/m68k/coldfire/vectors.c.
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
arch/m68k/coldfire/vectors.c | 2 ++
arch/m68k/coldfire/vectors.h | 3 +++
2 files changed, 5 insertions(+)
create mode 100644 arch/m68k/coldfire/vectors.h
diff --git a/arch/m68k/coldfire/vectors.c b/arch/m68k/coldfire/vectors.c
index 3bf0d69eec9e..c26c255b530d 100644
--- a/arch/m68k/coldfire/vectors.c
+++ b/arch/m68k/coldfire/vectors.c
@@ -18,6 +18,8 @@
#include <asm/mcfsim.h>
#include <asm/mcfwdebug.h>
+#include "vectors.h"
+
/***************************************************************************/
#ifdef TRAP_DBG_INTERRUPT
diff --git a/arch/m68k/coldfire/vectors.h b/arch/m68k/coldfire/vectors.h
new file mode 100644
index 000000000000..0b01450a4353
--- /dev/null
+++ b/arch/m68k/coldfire/vectors.h
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+void trap_init(void);
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 2/7] m68knommu: coldfire: ensure gpio prototypes visible
2023-09-13 13:44 [PATCH 0/7] m68knommu: W=1 fixes Greg Ungerer
2023-09-13 13:44 ` [PATCH 1/7] m68knommu: coldfire: add and use "vectors.h" Greg Ungerer
@ 2023-09-13 13:44 ` Greg Ungerer
2023-09-13 13:44 ` [PATCH 3/7] m68knommu: coldfire: make mcf_maskimr() static Greg Ungerer
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Greg Ungerer @ 2023-09-13 13:44 UTC (permalink / raw)
To: linux-m68k; +Cc: geert, Greg Ungerer
When building with W=1:
CC arch/m68k/coldfire/gpio.o
arch/m68k/coldfire/gpio.c:19:5: warning: no previous prototype for ‘__mcfgpio_get_value’ [-Wmissing-prototypes]
int __mcfgpio_get_value(unsigned gpio)
^~~~~~~~~~~~~~~~~~~
arch/m68k/coldfire/gpio.c:25:6: warning: no previous prototype for ‘__mcfgpio_set_value’ [-Wmissing-prototypes]
void __mcfgpio_set_value(unsigned gpio, int value)
^~~~~~~~~~~~~~~~~~~
arch/m68k/coldfire/gpio.c:50:5: warning: no previous prototype for ‘__mcfgpio_direction_input’ [-Wmissing-prototypes]
int __mcfgpio_direction_input(unsigned gpio)
^~~~~~~~~~~~~~~~~~~~~~~~~
arch/m68k/coldfire/gpio.c:65:5: warning: no previous prototype for ‘__mcfgpio_direction_output’ [-Wmissing-prototypes]
int __mcfgpio_direction_output(unsigned gpio, int value)
^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/m68k/coldfire/gpio.c:96:5: warning: no previous prototype for ‘__mcfgpio_request’ [-Wmissing-prototypes]
int __mcfgpio_request(unsigned gpio)
^~~~~~~~~~~~~~~~~
arch/m68k/coldfire/gpio.c:102:6: warning: no previous prototype for ‘__mcfgpio_free’ [-Wmissing-prototypes]
void __mcfgpio_free(unsigned gpio)
^~~~~~~~~~~~~~
The local m68k asm version of gpio.h has prototypes for all of these,
but they are not always visible depending on the config options enabled.
Move the prototypes so they are always visible.
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
arch/m68k/include/asm/mcfgpio.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/m68k/include/asm/mcfgpio.h b/arch/m68k/include/asm/mcfgpio.h
index 7abd322c019f..019f24439546 100644
--- a/arch/m68k/include/asm/mcfgpio.h
+++ b/arch/m68k/include/asm/mcfgpio.h
@@ -8,10 +8,6 @@
#ifndef mcfgpio_h
#define mcfgpio_h
-#ifdef CONFIG_GPIOLIB
-#include <linux/gpio.h>
-#else
-
int __mcfgpio_get_value(unsigned gpio);
void __mcfgpio_set_value(unsigned gpio, int value);
int __mcfgpio_direction_input(unsigned gpio);
@@ -19,6 +15,10 @@ int __mcfgpio_direction_output(unsigned gpio, int value);
int __mcfgpio_request(unsigned gpio);
void __mcfgpio_free(unsigned gpio);
+#ifdef CONFIG_GPIOLIB
+#include <linux/gpio.h>
+#else
+
/* our alternate 'gpiolib' functions */
static inline int __gpio_get_value(unsigned gpio)
{
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 3/7] m68knommu: coldfire: make mcf_maskimr() static
2023-09-13 13:44 [PATCH 0/7] m68knommu: W=1 fixes Greg Ungerer
2023-09-13 13:44 ` [PATCH 1/7] m68knommu: coldfire: add and use "vectors.h" Greg Ungerer
2023-09-13 13:44 ` [PATCH 2/7] m68knommu: coldfire: ensure gpio prototypes visible Greg Ungerer
@ 2023-09-13 13:44 ` Greg Ungerer
2023-09-13 13:44 ` [PATCH 4/7] m68knommu: coldfire: fix warnings in uboot argument processing Greg Ungerer
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Greg Ungerer @ 2023-09-13 13:44 UTC (permalink / raw)
To: linux-m68k; +Cc: geert, Greg Ungerer
When building with W=1:
CC arch/m68k/coldfire/intc.o
arch/m68k/coldfire/intc.c:83:6: warning: no previous prototype for ‘mcf_maskimr’ [-Wmissing-prototypes]
void mcf_maskimr(unsigned int mask)
^~~~~~~~~~~
The mcf_maskimr() function is only used within this file, make it static
to reduce name space pollution and fix warning.
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
arch/m68k/coldfire/intc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/m68k/coldfire/intc.c b/arch/m68k/coldfire/intc.c
index 20c084e932c8..b434371e2b99 100644
--- a/arch/m68k/coldfire/intc.c
+++ b/arch/m68k/coldfire/intc.c
@@ -56,7 +56,7 @@ void mcf_clrimr(int index)
__raw_writew(imr & ~(0x1 << index), MCFSIM_IMR);
}
-void mcf_maskimr(unsigned int mask)
+static void mcf_maskimr(unsigned int mask)
{
u16 imr;
imr = __raw_readw(MCFSIM_IMR);
@@ -80,7 +80,7 @@ void mcf_clrimr(int index)
__raw_writel(imr & ~(0x1 << index), MCFSIM_IMR);
}
-void mcf_maskimr(unsigned int mask)
+static void mcf_maskimr(unsigned int mask)
{
u32 imr;
imr = __raw_readl(MCFSIM_IMR);
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 4/7] m68knommu: coldfire: fix warnings in uboot argument processing
2023-09-13 13:44 [PATCH 0/7] m68knommu: W=1 fixes Greg Ungerer
` (2 preceding siblings ...)
2023-09-13 13:44 ` [PATCH 3/7] m68knommu: coldfire: make mcf_maskimr() static Greg Ungerer
@ 2023-09-13 13:44 ` Greg Ungerer
2023-09-13 13:44 ` [PATCH 5/7] m68knommu: coldfire: remove unused variable in MMU code Greg Ungerer
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Greg Ungerer @ 2023-09-13 13:44 UTC (permalink / raw)
To: linux-m68k; +Cc: geert, Greg Ungerer
When building with W=1:
CC arch/m68k/kernel/uboot.o
arch/m68k/kernel/uboot.c: In function ‘parse_uboot_commandline’:
arch/m68k/kernel/uboot.c:68:36: warning: variable ‘uboot_initrd_end’ set but not used [-Wunused-but-set-variable]
unsigned long uboot_initrd_start, uboot_initrd_end;
^~~~~~~~~~~~~~~~
arch/m68k/kernel/uboot.c:68:16: warning: variable ‘uboot_initrd_start’ set but not used [-Wunused-but-set-variable]
unsigned long uboot_initrd_start, uboot_initrd_end;
^~~~~~~~~~~~~~~~~~
arch/m68k/kernel/uboot.c:66:16: warning: variable ‘uboot_kbd’ set but not used [-Wunused-but-set-variable]
unsigned long uboot_kbd;
^~~~~~~~~
arch/m68k/kernel/uboot.c: At top level:
arch/m68k/kernel/uboot.c:90:13: warning: no previous prototype for ‘process_uboot_commandline’ [-Wmissing-prototypes]
__init void process_uboot_commandline(char *commandp, int size)
^~~~~~~~~~~~~~~~~~~~~~~~~
A couple of issues here. Firstly we already have a bootinfo.h that has a
prototype for process_uboot_commandline(), we should include that.
Secondly uboot_kbd is not used at all and can be removed. Thirdly the
conditional code based on CONFIG_BLK_DEV_INITRD means that sometimes
uboot_initrd_start and uboot_initrd_end are not needed. Make their
declaration and assignment conditional on CONFIG_BLK_DEV_INITRD same as
the code that uses them.
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
arch/m68k/kernel/uboot.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/arch/m68k/kernel/uboot.c b/arch/m68k/kernel/uboot.c
index 928dbd33fc4a..8bb1cb3a7490 100644
--- a/arch/m68k/kernel/uboot.c
+++ b/arch/m68k/kernel/uboot.c
@@ -27,6 +27,7 @@
#include <asm/irq.h>
#include <asm/machdep.h>
#include <asm/sections.h>
+#include <asm/bootinfo.h>
/*
* parse_uboot_commandline
@@ -63,20 +64,22 @@ static void __init parse_uboot_commandline(char *commandp, int size)
{
extern unsigned long _init_sp;
unsigned long *sp;
- unsigned long uboot_kbd;
- unsigned long uboot_initrd_start, uboot_initrd_end;
unsigned long uboot_cmd_start, uboot_cmd_end;
+#if defined(CONFIG_BLK_DEV_INITRD)
+ unsigned long uboot_initrd_start, uboot_initrd_end;
+#endif /* if defined(CONFIG_BLK_DEV_INITRD) */
sp = (unsigned long *)_init_sp;
- uboot_kbd = sp[1];
- uboot_initrd_start = sp[2];
- uboot_initrd_end = sp[3];
uboot_cmd_start = sp[4];
uboot_cmd_end = sp[5];
if (uboot_cmd_start && uboot_cmd_end)
strncpy(commandp, (const char *)uboot_cmd_start, size);
+
#if defined(CONFIG_BLK_DEV_INITRD)
+ uboot_initrd_start = sp[2];
+ uboot_initrd_end = sp[3];
+
if (uboot_initrd_start && uboot_initrd_end &&
(uboot_initrd_end > uboot_initrd_start)) {
initrd_start = uboot_initrd_start;
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 5/7] m68knommu: coldfire: remove unused variable in MMU code
2023-09-13 13:44 [PATCH 0/7] m68knommu: W=1 fixes Greg Ungerer
` (3 preceding siblings ...)
2023-09-13 13:44 ` [PATCH 4/7] m68knommu: coldfire: fix warnings in uboot argument processing Greg Ungerer
@ 2023-09-13 13:44 ` Greg Ungerer
2023-09-13 13:44 ` [PATCH 6/7] m68knommu: 68000: fix warnings in 68000 interrupt handling Greg Ungerer
2023-09-13 13:44 ` [PATCH 7/7] m68knommu: 68000: fix warning in timer code Greg Ungerer
6 siblings, 0 replies; 8+ messages in thread
From: Greg Ungerer @ 2023-09-13 13:44 UTC (permalink / raw)
To: linux-m68k; +Cc: geert, Greg Ungerer
When building with W=1:
CC arch/m68k/mm/mcfmmu.o
arch/m68k/mm/mcfmmu.c: In function ‘paging_init’:
arch/m68k/mm/mcfmmu.c:41:30: warning: variable ‘bootmem_end’ set but not used [-Wunused-but-set-variable]
unsigned long next_pgtable, bootmem_end;
^~~~~~~~~~~
Remove variable bootmem_end and its unused setting.
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
arch/m68k/mm/mcfmmu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c
index a6efaa7cacde..9a6fa342e872 100644
--- a/arch/m68k/mm/mcfmmu.c
+++ b/arch/m68k/mm/mcfmmu.c
@@ -38,7 +38,7 @@ void __init paging_init(void)
pgd_t *pg_dir;
pte_t *pg_table;
unsigned long address, size;
- unsigned long next_pgtable, bootmem_end;
+ unsigned long next_pgtable;
unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 };
int i;
@@ -57,7 +57,6 @@ void __init paging_init(void)
panic("%s: Failed to allocate %lu bytes align=0x%lx\n",
__func__, size, PAGE_SIZE);
- bootmem_end = (next_pgtable + size + PAGE_SIZE) & PAGE_MASK;
pg_dir += PAGE_OFFSET >> PGDIR_SHIFT;
address = PAGE_OFFSET;
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 6/7] m68knommu: 68000: fix warnings in 68000 interrupt handling
2023-09-13 13:44 [PATCH 0/7] m68knommu: W=1 fixes Greg Ungerer
` (4 preceding siblings ...)
2023-09-13 13:44 ` [PATCH 5/7] m68knommu: coldfire: remove unused variable in MMU code Greg Ungerer
@ 2023-09-13 13:44 ` Greg Ungerer
2023-09-13 13:44 ` [PATCH 7/7] m68knommu: 68000: fix warning in timer code Greg Ungerer
6 siblings, 0 replies; 8+ messages in thread
From: Greg Ungerer @ 2023-09-13 13:44 UTC (permalink / raw)
To: linux-m68k; +Cc: geert, Greg Ungerer
When building with W=1:
CC arch/m68k/68000/ints.o
arch/m68k/68000/ints.c:77:6: warning: no previous prototype for ‘process_int’ [-Wmissing-prototypes]
void process_int(int vec, struct pt_regs *fp)
^~~~~~~~~~~
arch/m68k/68000/ints.c:153:13: warning: no previous prototype for ‘trap_init’ [-Wmissing-prototypes]
void __init trap_init(void)
^~~~~~~~~
Include linux/cpu.h to get the prototype for trap_init().
Create a local ints.h for prototype of process_int(). Also mark
process_int() as asmlinkage, since it is called from the first level
interrupt assembly handler.
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
arch/m68k/68000/ints.c | 5 ++++-
arch/m68k/68000/ints.h | 7 +++++++
2 files changed, 11 insertions(+), 1 deletion(-)
create mode 100644 arch/m68k/68000/ints.h
diff --git a/arch/m68k/68000/ints.c b/arch/m68k/68000/ints.c
index f9a5ec781408..2ba9926e91ae 100644
--- a/arch/m68k/68000/ints.c
+++ b/arch/m68k/68000/ints.c
@@ -14,6 +14,7 @@
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
+#include <linux/cpu.h>
#include <asm/traps.h>
#include <asm/io.h>
#include <asm/machdep.h>
@@ -26,6 +27,8 @@
#include <asm/MC68328.h>
#endif
+#include "ints.h"
+
/* assembler routines */
asmlinkage void system_call(void);
asmlinkage void buserr(void);
@@ -74,7 +77,7 @@ asmlinkage irqreturn_t inthandler7(void);
* into one vector and look in the blasted mask register...
* This code is designed to be fast, almost constant time, not clean!
*/
-void process_int(int vec, struct pt_regs *fp)
+asmlinkage void process_int(int vec, struct pt_regs *fp)
{
int irq;
int mask;
diff --git a/arch/m68k/68000/ints.h b/arch/m68k/68000/ints.h
new file mode 100644
index 000000000000..d9cfd0eb9ffe
--- /dev/null
+++ b/arch/m68k/68000/ints.h
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <linux/linkage.h>
+
+struct pt_regs;
+
+asmlinkage void process_int(int vec, struct pt_regs *fp);
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 7/7] m68knommu: 68000: fix warning in timer code
2023-09-13 13:44 [PATCH 0/7] m68knommu: W=1 fixes Greg Ungerer
` (5 preceding siblings ...)
2023-09-13 13:44 ` [PATCH 6/7] m68knommu: 68000: fix warnings in 68000 interrupt handling Greg Ungerer
@ 2023-09-13 13:44 ` Greg Ungerer
6 siblings, 0 replies; 8+ messages in thread
From: Greg Ungerer @ 2023-09-13 13:44 UTC (permalink / raw)
To: linux-m68k; +Cc: geert, Greg Ungerer
When building with W=1:
CC arch/m68k/68000/timers.o
arch/m68k/68000/timers.c:120:5: warning: no previous prototype for ‘m68328_hwclk’ [-Wmissing-prototypes]
int m68328_hwclk(int set, struct rtc_time *t)
^~~~~~~~~~~~
Include m68328.h to get prototype for m68328_hwclk().
Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
arch/m68k/68000/timers.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/m68k/68000/timers.c b/arch/m68k/68000/timers.c
index 0d0417cebc7f..00fb0dd12faa 100644
--- a/arch/m68k/68000/timers.c
+++ b/arch/m68k/68000/timers.c
@@ -25,6 +25,8 @@
#include <asm/machdep.h>
#include <asm/MC68VZ328.h>
+#include "m68328.h"
+
/***************************************************************************/
#if defined(CONFIG_DRAGEN2)
--
2.25.1
^ permalink raw reply related [flat|nested] 8+ messages in thread