Merge tag 'mips-fixes_6.1_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux

Pull MIPS fixes from Thomas Bogendoerfer:

- fix jump label branch range check

- check kmalloc failures in Loongson64 kexec

- fix builds with clang-14

- fix char/int handling in pic32

* tag 'mips-fixes_6.1_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
MIPS: pic32: treat port as signed integer
MIPS: jump_label: Fix compat branch range check
mips: alchemy: gpio: Include the right header
MIPS: Loongson64: Add WARN_ON on kexec related kmalloc failed
MIPS: fix duplicate definitions for exported symbols
mips: boot/compressed: use __NO_FORTIFY

+26 -21
+1 -1
arch/mips/alchemy/common/gpiolib.c
··· 31 31 #include <linux/init.h> 32 32 #include <linux/kernel.h> 33 33 #include <linux/types.h> 34 - #include <linux/gpio.h> 34 + #include <linux/gpio/driver.h> 35 35 #include <asm/mach-au1x00/gpio-au1000.h> 36 36 #include <asm/mach-au1x00/gpio-au1300.h> 37 37
+1
arch/mips/boot/compressed/decompress.c
··· 9 9 10 10 #define DISABLE_BRANCH_PROFILING 11 11 12 + #define __NO_FORTIFY 12 13 #include <linux/types.h> 13 14 #include <linux/kernel.h> 14 15 #include <linux/string.h>
+1 -1
arch/mips/include/asm/fw/fw.h
··· 26 26 extern void fw_meminit(void); 27 27 extern char *fw_getenv(char *name); 28 28 extern unsigned long fw_getenvl(char *name); 29 - extern void fw_init_early_console(char port); 29 + extern void fw_init_early_console(void); 30 30 31 31 #endif /* __ASM_FW_H_ */
+1 -1
arch/mips/kernel/jump_label.c
··· 56 56 * The branch offset must fit in the instruction's 26 57 57 * bit field. 58 58 */ 59 - WARN_ON((offset >= BIT(25)) || 59 + WARN_ON((offset >= (long)BIT(25)) || 60 60 (offset < -(long)BIT(25))); 61 61 62 62 insn.j_format.opcode = bc6_op;
+5 -10
arch/mips/kernel/relocate_kernel.S
··· 145 145 * kexec_args[0..3] are used to prepare register values. 146 146 */ 147 147 148 - kexec_args: 149 - EXPORT(kexec_args) 148 + EXPORT(kexec_args) 150 149 arg0: PTR_WD 0x0 151 150 arg1: PTR_WD 0x0 152 151 arg2: PTR_WD 0x0 ··· 158 159 * their registers a0-a3. secondary_kexec_args[0..3] are used 159 160 * to prepare register values. 160 161 */ 161 - secondary_kexec_args: 162 - EXPORT(secondary_kexec_args) 162 + EXPORT(secondary_kexec_args) 163 163 s_arg0: PTR_WD 0x0 164 164 s_arg1: PTR_WD 0x0 165 165 s_arg2: PTR_WD 0x0 ··· 169 171 170 172 #endif 171 173 172 - kexec_start_address: 173 - EXPORT(kexec_start_address) 174 + EXPORT(kexec_start_address) 174 175 PTR_WD 0x0 175 176 .size kexec_start_address, PTRSIZE 176 177 177 - kexec_indirection_page: 178 - EXPORT(kexec_indirection_page) 178 + EXPORT(kexec_indirection_page) 179 179 PTR_WD 0 180 180 .size kexec_indirection_page, PTRSIZE 181 181 182 182 relocate_new_kernel_end: 183 183 184 - relocate_new_kernel_size: 185 - EXPORT(relocate_new_kernel_size) 184 + EXPORT(relocate_new_kernel_size) 186 185 PTR_WD relocate_new_kernel_end - relocate_new_kernel 187 186 .size relocate_new_kernel_size, PTRSIZE
+10
arch/mips/loongson64/reset.c
··· 16 16 #include <asm/bootinfo.h> 17 17 #include <asm/idle.h> 18 18 #include <asm/reboot.h> 19 + #include <asm/bug.h> 19 20 20 21 #include <loongson.h> 21 22 #include <boot_param.h> ··· 160 159 161 160 #ifdef CONFIG_KEXEC 162 161 kexec_argv = kmalloc(KEXEC_ARGV_SIZE, GFP_KERNEL); 162 + if (WARN_ON(!kexec_argv)) 163 + return -ENOMEM; 164 + 163 165 kdump_argv = kmalloc(KEXEC_ARGV_SIZE, GFP_KERNEL); 166 + if (WARN_ON(!kdump_argv)) 167 + return -ENOMEM; 168 + 164 169 kexec_envp = kmalloc(KEXEC_ENVP_SIZE, GFP_KERNEL); 170 + if (WARN_ON(!kexec_envp)) 171 + return -ENOMEM; 172 + 165 173 fw_arg1 = KEXEC_ARGV_ADDR; 166 174 memcpy(kexec_envp, (void *)fw_arg2, KEXEC_ENVP_SIZE); 167 175
+6 -7
arch/mips/pic32/pic32mzda/early_console.c
··· 27 27 #define U_BRG(x) (UART_BASE(x) + 0x40) 28 28 29 29 static void __iomem *uart_base; 30 - static char console_port = -1; 30 + static int console_port = -1; 31 31 32 32 static int __init configure_uart_pins(int port) 33 33 { ··· 47 47 return 0; 48 48 } 49 49 50 - static void __init configure_uart(char port, int baud) 50 + static void __init configure_uart(int port, int baud) 51 51 { 52 52 u32 pbclk; 53 53 ··· 60 60 uart_base + PIC32_SET(U_STA(port))); 61 61 } 62 62 63 - static void __init setup_early_console(char port, int baud) 63 + static void __init setup_early_console(int port, int baud) 64 64 { 65 65 if (configure_uart_pins(port)) 66 66 return; ··· 130 130 return baud; 131 131 } 132 132 133 - void __init fw_init_early_console(char port) 133 + void __init fw_init_early_console(void) 134 134 { 135 135 char *arch_cmdline = pic32_getcmdline(); 136 - int baud = -1; 136 + int baud, port; 137 137 138 138 uart_base = ioremap(PIC32_BASE_UART, 0xc00); 139 139 140 140 baud = get_baud_from_cmdline(arch_cmdline); 141 - if (port == -1) 142 - port = get_port_from_cmdline(arch_cmdline); 141 + port = get_port_from_cmdline(arch_cmdline); 143 142 144 143 if (port == -1) 145 144 port = EARLY_CONSOLE_PORT;
+1 -1
arch/mips/pic32/pic32mzda/init.c
··· 47 47 strscpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE); 48 48 49 49 #ifdef CONFIG_EARLY_PRINTK 50 - fw_init_early_console(-1); 50 + fw_init_early_console(); 51 51 #endif 52 52 pic32_config_init(); 53 53 }