m68knommu: W=1 fixes
Subsystems (2)
Greg Ungerer
maintainercover m68knommu: W=1 fixes
As a follow up to Geet's "[PATCH 0/52] m68k: W=1 fixes" series,
https://lore.kernel.org/lkml/[email protected]/T/ , this series adds fixes specific to nommu and ColdFire configurations.
Mostly similar fixes to what Geert had to do, and not too many all up.
Regards
Greg
arch/m68k/68000/ints.c | 5 ++++- arch/m68k/68000/ints.h | 7 +++++++ arch/m68k/68000/timers.c | 2 ++ arch/m68k/coldfire/intc.c | 4 ++-- arch/m68k/coldfire/vectors.c | 2 ++ arch/m68k/coldfire/vectors.h | 3 +++ arch/m68k/include/asm/mcfgpio.h | 8 ++++---- arch/m68k/kernel/uboot.c | 13 ++++++++----- arch/m68k/mm/mcfmmu.c | 3 +-- 9 files changed, 33 insertions(+), 14 deletions(-)
Greg Ungerer
maintainerPATCH 1/7 m68knommu: coldfire: add and use "vectors.h"
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.
--- 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
arch/m68k/coldfire/vectors.c +2 -0
@@ -18,6 +18,8 @@#include <asm/mcfsim.h> #include <asm/mcfwdebug.h> +#include "vectors.h" +/***************************************************************************/ #ifdef TRAP_DBG_INTERRUPT
arch/m68k/coldfire/vectors.h new file +3 -0
@@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +void trap_init (void );
Signature · 1 line
2.25.1
Greg Ungerer
maintainerPATCH 2/7 m68knommu: coldfire: ensure gpio prototypes visible
In reply to Greg UngererWhen 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.
--- arch/m68k/include/asm/mcfgpio.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/m68k/include/asm/mcfgpio.h +4 -4
@@ -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) {
Signature · 1 line
2.25.1
Greg Ungerer
maintainerPATCH 3/7 m68knommu: coldfire: make mcf_maskimr() static
In reply to Greg UngererWhen 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.
--- arch/m68k/coldfire/intc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/m68k/coldfire/intc.c +2 -2
@@ -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 );
Signature · 1 line
2.25.1
Greg Ungerer
maintainerPATCH 4/7 m68knommu: coldfire: fix warnings in uboot argument processing
In reply to Greg UngererWhen 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.
--- arch/m68k/kernel/uboot.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
arch/m68k/kernel/uboot.c +8 -5
@@ -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;
Signature · 1 line
2.25.1
Greg Ungerer
maintainerPATCH 5/7 m68knommu: coldfire: remove unused variable in MMU code
In reply to Greg UngererWhen building with W=1:
CC arch/m68k/mm/mcfmmu.oarch/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.
--- arch/m68k/mm/mcfmmu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/m68k/mm/mcfmmu.c +1 -2
@@ -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 ;
Signature · 1 line
2.25.1
Greg Ungerer
maintainerPATCH 6/7 m68knommu: 68000: fix warnings in 68000 interrupt handling
In reply to Greg UngererWhen 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.
--- 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
arch/m68k/68000/ints.c +4 -1
@@ -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;
arch/m68k/68000/ints.h new file +7 -0
@@ -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);
Signature · 1 line
2.25.1
Greg Ungerer
maintainerPATCH 7/7 m68knommu: 68000: fix warning in timer code
In reply to Greg UngererWhen 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().
--- arch/m68k/68000/timers.c | 2 ++ 1 file changed, 2 insertions(+)
arch/m68k/68000/timers.c +2 -0
@@ -25,6 +25,8 @@#include <asm/machdep.h> #include <asm/MC68VZ328.h> +#include "m68328.h" +/***************************************************************************/ #if defined(CONFIG_DRAGEN2 )
Signature · 1 line
2.25.1