Skip to content

Commit 24318ae

Browse files
committed
Merge tag 'sh-for-5.16' of git://git.libc.org/linux-sh
Pull arch/sh updates from Rich Felker. * tag 'sh-for-5.16' of git://git.libc.org/linux-sh: sh: pgtable-3level: Fix cast to pointer from integer of different size sh: fix READ/WRITE redefinition warnings sh: define __BIG_ENDIAN for math-emu sh: math-emu: drop unused functions sh: fix kconfig unmet dependency warning for FRAME_POINTER sh: Cleanup about SPARSE_IRQ sh: kdump: add some attribute to function maple: fix wrong return value of maple_bus_init(). sh: boot: avoid unneeded rebuilds under arch/sh/boot/compressed/ sh: boot: add intermediate vmlinux.bin* to targets instead of extra-y sh: boards: Fix the cacography in irq.c sh: check return code of request_irq sh: fix trivial misannotations
2 parents 6ea45c5 + 8518e69 commit 24318ae

File tree

21 files changed

+78
-180
lines changed

21 files changed

+78
-180
lines changed

arch/sh/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ config SUPERH
5656
select HAVE_STACKPROTECTOR
5757
select HAVE_SYSCALL_TRACEPOINTS
5858
select IRQ_FORCED_THREADING
59-
select MAY_HAVE_SPARSE_IRQ
6059
select MODULES_USE_ELF_RELA
6160
select NEED_SG_DMA_LENGTH
6261
select NO_DMA if !MMU && !DMA_COHERENT

arch/sh/Kconfig.debug

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ config DUMP_CODE
5454

5555
config DWARF_UNWINDER
5656
bool "Enable the DWARF unwinder for stacktraces"
57+
depends on DEBUG_KERNEL
5758
select FRAME_POINTER
5859
default n
5960
help

arch/sh/boards/mach-landisk/irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ enum {
2626
PCI_INTD, /* PCI int D */
2727
ATA, /* ATA */
2828
FATA, /* CF */
29-
POWER, /* Power swtich */
30-
BUTTON, /* Button swtich */
29+
POWER, /* Power switch */
30+
BUTTON, /* Button switch */
3131
};
3232

3333
/* Vectors for LANDISK */

arch/sh/boot/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ suffix-$(CONFIG_KERNEL_XZ) := xz
2727
suffix-$(CONFIG_KERNEL_LZO) := lzo
2828

2929
targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \
30-
uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin
31-
extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
30+
uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin \
31+
vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
3232
vmlinux.bin.xz vmlinux.bin.lzo
3333
subdir- := compressed romimage
3434

arch/sh/boot/compressed/.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
# SPDX-License-Identifier: GPL-2.0-only
2-
ashiftrt.S
3-
ashldi3.c
4-
ashlsi3.S
5-
ashrsi3.S
6-
lshrsi3.S
72
vmlinux.bin.*

arch/sh/boot/compressed/Makefile

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@
55
# create a compressed vmlinux image from the original vmlinux
66
#
77

8-
targets := vmlinux vmlinux.bin vmlinux.bin.gz \
9-
vmlinux.bin.bz2 vmlinux.bin.lzma \
10-
vmlinux.bin.xz vmlinux.bin.lzo \
11-
head_32.o misc.o piggy.o
8+
OBJECTS := head_32.o misc.o cache.o piggy.o \
9+
ashiftrt.o ashldi3.o ashrsi3.o ashlsi3.o lshrsi3.o
10+
11+
# These were previously generated files. When you are building the kernel
12+
# with O=, make sure to remove the stale files in the output tree. Otherwise,
13+
# the build system wrongly compiles the stale ones.
14+
ifdef building_out_of_srctree
15+
$(shell rm -f $(addprefix $(obj)/, ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S lshrsi3.S))
16+
endif
1217

13-
OBJECTS = $(obj)/head_32.o $(obj)/misc.o $(obj)/cache.o
18+
targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
19+
vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo $(OBJECTS)
1420

1521
GCOV_PROFILE := n
1622

@@ -33,21 +39,9 @@ ccflags-remove-$(CONFIG_MCOUNT) += -pg
3339
LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
3440
-T $(obj)/../../kernel/vmlinux.lds
3541

36-
#
37-
# Pull in the necessary libgcc bits from the in-kernel implementation.
38-
#
39-
lib1funcs-y := ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S lshrsi3.S
40-
lib1funcs-obj := \
41-
$(addsuffix .o, $(basename $(addprefix $(obj)/, $(lib1funcs-y))))
42-
43-
lib1funcs-dir := $(srctree)/arch/$(SRCARCH)/lib
44-
45-
KBUILD_CFLAGS += -I$(lib1funcs-dir) -DDISABLE_BRANCH_PROFILING
46-
47-
$(addprefix $(obj)/,$(lib1funcs-y)): $(obj)/%: $(lib1funcs-dir)/% FORCE
48-
$(call cmd,shipped)
42+
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
4943

50-
$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(lib1funcs-obj) FORCE
44+
$(obj)/vmlinux: $(addprefix $(obj)/, $(OBJECTS)) FORCE
5145
$(call if_changed,ld)
5246

5347
$(obj)/vmlinux.bin: vmlinux FORCE

arch/sh/boot/compressed/ashiftrt.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
#include "../../lib/ashiftrt.S"

arch/sh/boot/compressed/ashldi3.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
#include "../../lib/ashldi3.c"

arch/sh/boot/compressed/ashlsi3.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
#include "../../lib/ashlsi3.S"

arch/sh/boot/compressed/ashrsi3.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
#include "../../lib/ashrsi3.S"

arch/sh/boot/compressed/lshrsi3.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
#include "../../lib/lshrsi3.S"

arch/sh/include/asm/checksum_32.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ static inline __sum16 csum_fold(__wsum sum)
8484
*/
8585
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
8686
{
87-
unsigned int sum, __dummy0, __dummy1;
87+
__wsum sum;
88+
unsigned int __dummy0, __dummy1;
8889

8990
__asm__ __volatile__(
9091
"mov.l @%1+, %0\n\t"
@@ -197,6 +198,6 @@ static inline __wsum csum_and_copy_to_user(const void *src,
197198
{
198199
if (!access_ok(dst, len))
199200
return 0;
200-
return csum_partial_copy_generic((__force const void *)src, dst, len);
201+
return csum_partial_copy_generic(src, (__force void *)dst, len);
201202
}
202203
#endif /* __ASM_SH_CHECKSUM_H */

arch/sh/include/asm/irq.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@
55
#include <linux/cpumask.h>
66
#include <asm/machvec.h>
77

8-
/*
9-
* Only legacy non-sparseirq platforms have to set a reasonably sane
10-
* value here. sparseirq platforms allocate their irq_descs on the fly,
11-
* so will expand automatically based on the number of registered IRQs.
12-
*/
13-
#ifdef CONFIG_SPARSE_IRQ
14-
# define NR_IRQS 8
15-
#else
16-
# define NR_IRQS 512
17-
#endif
18-
198
/*
209
* This is a special IRQ number for indicating that no IRQ has been
2110
* triggered and to simply ignore the IRQ dispatch. This is a special

arch/sh/include/asm/sfp-machine.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@
1313
#ifndef _SFP_MACHINE_H
1414
#define _SFP_MACHINE_H
1515

16+
#ifdef __BIG_ENDIAN__
17+
#define __BYTE_ORDER __BIG_ENDIAN
18+
#define __LITTLE_ENDIAN 0
19+
#else
20+
#define __BYTE_ORDER __LITTLE_ENDIAN
21+
#define __BIG_ENDIAN 0
22+
#endif
23+
1624
#define _FP_W_TYPE_SIZE 32
1725
#define _FP_W_TYPE unsigned long
1826
#define _FP_WS_TYPE signed long

arch/sh/include/asm/uaccess.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct __large_struct { unsigned long buf[100]; };
6868
({ \
6969
long __gu_err = -EFAULT; \
7070
unsigned long __gu_val = 0; \
71-
const __typeof__(*(ptr)) *__gu_addr = (ptr); \
71+
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
7272
if (likely(access_ok(__gu_addr, (size)))) \
7373
__get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
7474
(x) = (__force __typeof__(*(ptr)))__gu_val; \
@@ -124,7 +124,7 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
124124
* Clear the area and return remaining number of bytes
125125
* (on failure. Usually it's 0.)
126126
*/
127-
__kernel_size_t __clear_user(void *addr, __kernel_size_t size);
127+
__kernel_size_t __clear_user(void __user *addr, __kernel_size_t size);
128128

129129
#define clear_user(addr,n) \
130130
({ \

arch/sh/kernel/cpu/sh4a/smp-shx3.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ static void shx3_prepare_cpus(unsigned int max_cpus)
7373
BUILD_BUG_ON(SMP_MSG_NR >= 8);
7474

7575
for (i = 0; i < SMP_MSG_NR; i++)
76-
request_irq(104 + i, ipi_interrupt_handler,
77-
IRQF_PERCPU, "IPI", (void *)(long)i);
76+
if (request_irq(104 + i, ipi_interrupt_handler,
77+
IRQF_PERCPU, "IPI", (void *)(long)i))
78+
pr_err("Failed to request irq %d\n", i);
7879

7980
for (i = 0; i < max_cpus; i++)
8081
set_cpu_present(i, true);

arch/sh/kernel/crash_dump.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626
ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
2727
size_t csize, unsigned long offset, int userbuf)
2828
{
29-
void *vaddr;
29+
void __iomem *vaddr;
3030

3131
if (!csize)
3232
return 0;
3333

3434
vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
3535

3636
if (userbuf) {
37-
if (copy_to_user(buf, (vaddr + offset), csize)) {
37+
if (copy_to_user((void __user *)buf, (vaddr + offset), csize)) {
3838
iounmap(vaddr);
3939
return -EFAULT;
4040
}

arch/sh/kernel/traps_32.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ asmlinkage void do_address_error(struct pt_regs *regs,
490490
inc_unaligned_user_access();
491491

492492
oldfs = force_uaccess_begin();
493-
if (copy_from_user(&instruction, (insn_size_t *)(regs->pc & ~1),
493+
if (copy_from_user(&instruction, (insn_size_t __user *)(regs->pc & ~1),
494494
sizeof(instruction))) {
495495
force_uaccess_end(oldfs);
496496
goto uspace_segv;
@@ -614,7 +614,7 @@ asmlinkage void do_reserved_inst(void)
614614
unsigned short inst = 0;
615615
int err;
616616

617-
get_user(inst, (unsigned short*)regs->pc);
617+
get_user(inst, (unsigned short __user *)regs->pc);
618618

619619
err = do_fpu_inst(inst, regs);
620620
if (!err) {
@@ -699,9 +699,9 @@ asmlinkage void do_illegal_slot_inst(void)
699699
return;
700700

701701
#ifdef CONFIG_SH_FPU_EMU
702-
get_user(inst, (unsigned short *)regs->pc + 1);
702+
get_user(inst, (unsigned short __user *)regs->pc + 1);
703703
if (!do_fpu_inst(inst, regs)) {
704-
get_user(inst, (unsigned short *)regs->pc);
704+
get_user(inst, (unsigned short __user *)regs->pc);
705705
if (!emulate_branch(inst, regs))
706706
return;
707707
/* fault in branch.*/

0 commit comments

Comments
 (0)