Skip to content

Commit

Permalink
Merge tag 'sh-for-5.16' of git://git.libc.org/linux-sh
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Torvalds committed Nov 14, 2021
2 parents 6ea45c5 + 8518e69 commit 24318ae
Show file tree
Hide file tree
Showing 21 changed files with 78 additions and 180 deletions.
1 change: 0 additions & 1 deletion arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ config SUPERH
select HAVE_STACKPROTECTOR
select HAVE_SYSCALL_TRACEPOINTS
select IRQ_FORCED_THREADING
select MAY_HAVE_SPARSE_IRQ
select MODULES_USE_ELF_RELA
select NEED_SG_DMA_LENGTH
select NO_DMA if !MMU && !DMA_COHERENT
Expand Down
1 change: 1 addition & 0 deletions arch/sh/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ config DUMP_CODE

config DWARF_UNWINDER
bool "Enable the DWARF unwinder for stacktraces"
depends on DEBUG_KERNEL
select FRAME_POINTER
default n
help
Expand Down
4 changes: 2 additions & 2 deletions arch/sh/boards/mach-landisk/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ enum {
PCI_INTD, /* PCI int D */
ATA, /* ATA */
FATA, /* CF */
POWER, /* Power swtich */
BUTTON, /* Button swtich */
POWER, /* Power switch */
BUTTON, /* Button switch */
};

/* Vectors for LANDISK */
Expand Down
4 changes: 2 additions & 2 deletions arch/sh/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ suffix-$(CONFIG_KERNEL_XZ) := xz
suffix-$(CONFIG_KERNEL_LZO) := lzo

targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \
uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin
extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin \
vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
vmlinux.bin.xz vmlinux.bin.lzo
subdir- := compressed romimage

Expand Down
5 changes: 0 additions & 5 deletions arch/sh/boot/compressed/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
# SPDX-License-Identifier: GPL-2.0-only
ashiftrt.S
ashldi3.c
ashlsi3.S
ashrsi3.S
lshrsi3.S
vmlinux.bin.*
32 changes: 13 additions & 19 deletions arch/sh/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
# create a compressed vmlinux image from the original vmlinux
#

targets := vmlinux vmlinux.bin vmlinux.bin.gz \
vmlinux.bin.bz2 vmlinux.bin.lzma \
vmlinux.bin.xz vmlinux.bin.lzo \
head_32.o misc.o piggy.o
OBJECTS := head_32.o misc.o cache.o piggy.o \
ashiftrt.o ashldi3.o ashrsi3.o ashlsi3.o lshrsi3.o

# These were previously generated files. When you are building the kernel
# with O=, make sure to remove the stale files in the output tree. Otherwise,
# the build system wrongly compiles the stale ones.
ifdef building_out_of_srctree
$(shell rm -f $(addprefix $(obj)/, ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S lshrsi3.S))
endif

OBJECTS = $(obj)/head_32.o $(obj)/misc.o $(obj)/cache.o
targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo $(OBJECTS)

GCOV_PROFILE := n

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

#
# Pull in the necessary libgcc bits from the in-kernel implementation.
#
lib1funcs-y := ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S lshrsi3.S
lib1funcs-obj := \
$(addsuffix .o, $(basename $(addprefix $(obj)/, $(lib1funcs-y))))

lib1funcs-dir := $(srctree)/arch/$(SRCARCH)/lib

KBUILD_CFLAGS += -I$(lib1funcs-dir) -DDISABLE_BRANCH_PROFILING

$(addprefix $(obj)/,$(lib1funcs-y)): $(obj)/%: $(lib1funcs-dir)/% FORCE
$(call cmd,shipped)
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING

$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(lib1funcs-obj) FORCE
$(obj)/vmlinux: $(addprefix $(obj)/, $(OBJECTS)) FORCE
$(call if_changed,ld)

$(obj)/vmlinux.bin: vmlinux FORCE
Expand Down
2 changes: 2 additions & 0 deletions arch/sh/boot/compressed/ashiftrt.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include "../../lib/ashiftrt.S"
2 changes: 2 additions & 0 deletions arch/sh/boot/compressed/ashldi3.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "../../lib/ashldi3.c"
2 changes: 2 additions & 0 deletions arch/sh/boot/compressed/ashlsi3.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include "../../lib/ashlsi3.S"
2 changes: 2 additions & 0 deletions arch/sh/boot/compressed/ashrsi3.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include "../../lib/ashrsi3.S"
2 changes: 2 additions & 0 deletions arch/sh/boot/compressed/lshrsi3.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include "../../lib/lshrsi3.S"
5 changes: 3 additions & 2 deletions arch/sh/include/asm/checksum_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ static inline __sum16 csum_fold(__wsum sum)
*/
static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
{
unsigned int sum, __dummy0, __dummy1;
__wsum sum;
unsigned int __dummy0, __dummy1;

__asm__ __volatile__(
"mov.l @%1+, %0\n\t"
Expand Down Expand Up @@ -197,6 +198,6 @@ static inline __wsum csum_and_copy_to_user(const void *src,
{
if (!access_ok(dst, len))
return 0;
return csum_partial_copy_generic((__force const void *)src, dst, len);
return csum_partial_copy_generic(src, (__force void *)dst, len);
}
#endif /* __ASM_SH_CHECKSUM_H */
11 changes: 0 additions & 11 deletions arch/sh/include/asm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@
#include <linux/cpumask.h>
#include <asm/machvec.h>

/*
* Only legacy non-sparseirq platforms have to set a reasonably sane
* value here. sparseirq platforms allocate their irq_descs on the fly,
* so will expand automatically based on the number of registered IRQs.
*/
#ifdef CONFIG_SPARSE_IRQ
# define NR_IRQS 8
#else
# define NR_IRQS 512
#endif

/*
* This is a special IRQ number for indicating that no IRQ has been
* triggered and to simply ignore the IRQ dispatch. This is a special
Expand Down
8 changes: 8 additions & 0 deletions arch/sh/include/asm/sfp-machine.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
#ifndef _SFP_MACHINE_H
#define _SFP_MACHINE_H

#ifdef __BIG_ENDIAN__
#define __BYTE_ORDER __BIG_ENDIAN
#define __LITTLE_ENDIAN 0
#else
#define __BYTE_ORDER __LITTLE_ENDIAN
#define __BIG_ENDIAN 0
#endif

#define _FP_W_TYPE_SIZE 32
#define _FP_W_TYPE unsigned long
#define _FP_WS_TYPE signed long
Expand Down
4 changes: 2 additions & 2 deletions arch/sh/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct __large_struct { unsigned long buf[100]; };
({ \
long __gu_err = -EFAULT; \
unsigned long __gu_val = 0; \
const __typeof__(*(ptr)) *__gu_addr = (ptr); \
const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
if (likely(access_ok(__gu_addr, (size)))) \
__get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
(x) = (__force __typeof__(*(ptr)))__gu_val; \
Expand Down Expand Up @@ -124,7 +124,7 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
* Clear the area and return remaining number of bytes
* (on failure. Usually it's 0.)
*/
__kernel_size_t __clear_user(void *addr, __kernel_size_t size);
__kernel_size_t __clear_user(void __user *addr, __kernel_size_t size);

#define clear_user(addr,n) \
({ \
Expand Down
5 changes: 3 additions & 2 deletions arch/sh/kernel/cpu/sh4a/smp-shx3.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ static void shx3_prepare_cpus(unsigned int max_cpus)
BUILD_BUG_ON(SMP_MSG_NR >= 8);

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

for (i = 0; i < max_cpus; i++)
set_cpu_present(i, true);
Expand Down
4 changes: 2 additions & 2 deletions arch/sh/kernel/crash_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@
ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
size_t csize, unsigned long offset, int userbuf)
{
void *vaddr;
void __iomem *vaddr;

if (!csize)
return 0;

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

if (userbuf) {
if (copy_to_user(buf, (vaddr + offset), csize)) {
if (copy_to_user((void __user *)buf, (vaddr + offset), csize)) {
iounmap(vaddr);
return -EFAULT;
}
Expand Down
8 changes: 4 additions & 4 deletions arch/sh/kernel/traps_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ asmlinkage void do_address_error(struct pt_regs *regs,
inc_unaligned_user_access();

oldfs = force_uaccess_begin();
if (copy_from_user(&instruction, (insn_size_t *)(regs->pc & ~1),
if (copy_from_user(&instruction, (insn_size_t __user *)(regs->pc & ~1),
sizeof(instruction))) {
force_uaccess_end(oldfs);
goto uspace_segv;
Expand Down Expand Up @@ -614,7 +614,7 @@ asmlinkage void do_reserved_inst(void)
unsigned short inst = 0;
int err;

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

err = do_fpu_inst(inst, regs);
if (!err) {
Expand Down Expand Up @@ -699,9 +699,9 @@ asmlinkage void do_illegal_slot_inst(void)
return;

#ifdef CONFIG_SH_FPU_EMU
get_user(inst, (unsigned short *)regs->pc + 1);
get_user(inst, (unsigned short __user *)regs->pc + 1);
if (!do_fpu_inst(inst, regs)) {
get_user(inst, (unsigned short *)regs->pc);
get_user(inst, (unsigned short __user *)regs->pc);
if (!emulate_branch(inst, regs))
return;
/* fault in branch.*/
Expand Down
Loading

0 comments on commit 24318ae

Please sign in to comment.