Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+78 -180
-1
arch/sh/Kconfig
··· 56 56 select HAVE_STACKPROTECTOR 57 57 select HAVE_SYSCALL_TRACEPOINTS 58 58 select IRQ_FORCED_THREADING 59 - select MAY_HAVE_SPARSE_IRQ 60 59 select MODULES_USE_ELF_RELA 61 60 select NEED_SG_DMA_LENGTH 62 61 select NO_DMA if !MMU && !DMA_COHERENT
+1
arch/sh/Kconfig.debug
··· 54 54 55 55 config DWARF_UNWINDER 56 56 bool "Enable the DWARF unwinder for stacktraces" 57 + depends on DEBUG_KERNEL 57 58 select FRAME_POINTER 58 59 default n 59 60 help
+2 -2
arch/sh/boards/mach-landisk/irq.c
··· 26 26 PCI_INTD, /* PCI int D */ 27 27 ATA, /* ATA */ 28 28 FATA, /* CF */ 29 - POWER, /* Power swtich */ 30 - BUTTON, /* Button swtich */ 29 + POWER, /* Power switch */ 30 + BUTTON, /* Button switch */ 31 31 }; 32 32 33 33 /* Vectors for LANDISK */
+2 -2
arch/sh/boot/Makefile
··· 27 27 suffix-$(CONFIG_KERNEL_LZO) := lzo 28 28 29 29 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 \ 32 32 vmlinux.bin.xz vmlinux.bin.lzo 33 33 subdir- := compressed romimage 34 34
-5
arch/sh/boot/compressed/.gitignore
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - ashiftrt.S 3 - ashldi3.c 4 - ashlsi3.S 5 - ashrsi3.S 6 - lshrsi3.S 7 2 vmlinux.bin.*
+13 -19
arch/sh/boot/compressed/Makefile
··· 5 5 # create a compressed vmlinux image from the original vmlinux 6 6 # 7 7 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 12 10 13 - OBJECTS = $(obj)/head_32.o $(obj)/misc.o $(obj)/cache.o 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 17 + 18 + targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \ 19 + vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo $(OBJECTS) 14 20 15 21 GCOV_PROFILE := n 16 22 ··· 39 33 LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \ 40 34 -T $(obj)/../../kernel/vmlinux.lds 41 35 42 - # 43 - # Pull in the necessary libgcc bits from the in-kernel implementation. 44 - # 45 - lib1funcs-y := ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S lshrsi3.S 46 - lib1funcs-obj := \ 47 - $(addsuffix .o, $(basename $(addprefix $(obj)/, $(lib1funcs-y)))) 36 + KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING 48 37 49 - lib1funcs-dir := $(srctree)/arch/$(SRCARCH)/lib 50 - 51 - KBUILD_CFLAGS += -I$(lib1funcs-dir) -DDISABLE_BRANCH_PROFILING 52 - 53 - $(addprefix $(obj)/,$(lib1funcs-y)): $(obj)/%: $(lib1funcs-dir)/% FORCE 54 - $(call cmd,shipped) 55 - 56 - $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(lib1funcs-obj) FORCE 38 + $(obj)/vmlinux: $(addprefix $(obj)/, $(OBJECTS)) FORCE 57 39 $(call if_changed,ld) 58 40 59 41 $(obj)/vmlinux.bin: vmlinux FORCE
+2
arch/sh/boot/compressed/ashiftrt.S
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + #include "../../lib/ashiftrt.S"
+2
arch/sh/boot/compressed/ashldi3.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + #include "../../lib/ashldi3.c"
+2
arch/sh/boot/compressed/ashlsi3.S
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + #include "../../lib/ashlsi3.S"
+2
arch/sh/boot/compressed/ashrsi3.S
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + #include "../../lib/ashrsi3.S"
+2
arch/sh/boot/compressed/lshrsi3.S
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + #include "../../lib/lshrsi3.S"
+3 -2
arch/sh/include/asm/checksum_32.h
··· 84 84 */ 85 85 static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) 86 86 { 87 - unsigned int sum, __dummy0, __dummy1; 87 + __wsum sum; 88 + unsigned int __dummy0, __dummy1; 88 89 89 90 __asm__ __volatile__( 90 91 "mov.l @%1+, %0\n\t" ··· 198 197 { 199 198 if (!access_ok(dst, len)) 200 199 return 0; 201 - return csum_partial_copy_generic((__force const void *)src, dst, len); 200 + return csum_partial_copy_generic(src, (__force void *)dst, len); 202 201 } 203 202 #endif /* __ASM_SH_CHECKSUM_H */
-11
arch/sh/include/asm/irq.h
··· 6 6 #include <asm/machvec.h> 7 7 8 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 - 19 - /* 20 9 * This is a special IRQ number for indicating that no IRQ has been 21 10 * triggered and to simply ignore the IRQ dispatch. This is a special 22 11 * case that can happen with IRQ auto-distribution when multiple CPUs
+8
arch/sh/include/asm/sfp-machine.h
··· 13 13 #ifndef _SFP_MACHINE_H 14 14 #define _SFP_MACHINE_H 15 15 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 + 16 24 #define _FP_W_TYPE_SIZE 32 17 25 #define _FP_W_TYPE unsigned long 18 26 #define _FP_WS_TYPE signed long
+2 -2
arch/sh/include/asm/uaccess.h
··· 68 68 ({ \ 69 69 long __gu_err = -EFAULT; \ 70 70 unsigned long __gu_val = 0; \ 71 - const __typeof__(*(ptr)) *__gu_addr = (ptr); \ 71 + const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ 72 72 if (likely(access_ok(__gu_addr, (size)))) \ 73 73 __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \ 74 74 (x) = (__force __typeof__(*(ptr)))__gu_val; \ ··· 124 124 * Clear the area and return remaining number of bytes 125 125 * (on failure. Usually it's 0.) 126 126 */ 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); 128 128 129 129 #define clear_user(addr,n) \ 130 130 ({ \
+3 -2
arch/sh/kernel/cpu/sh4a/smp-shx3.c
··· 73 73 BUILD_BUG_ON(SMP_MSG_NR >= 8); 74 74 75 75 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); 78 79 79 80 for (i = 0; i < max_cpus; i++) 80 81 set_cpu_present(i, true);
+2 -2
arch/sh/kernel/crash_dump.c
··· 26 26 ssize_t copy_oldmem_page(unsigned long pfn, char *buf, 27 27 size_t csize, unsigned long offset, int userbuf) 28 28 { 29 - void *vaddr; 29 + void __iomem *vaddr; 30 30 31 31 if (!csize) 32 32 return 0; ··· 34 34 vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE); 35 35 36 36 if (userbuf) { 37 - if (copy_to_user(buf, (vaddr + offset), csize)) { 37 + if (copy_to_user((void __user *)buf, (vaddr + offset), csize)) { 38 38 iounmap(vaddr); 39 39 return -EFAULT; 40 40 }
+4 -4
arch/sh/kernel/traps_32.c
··· 490 490 inc_unaligned_user_access(); 491 491 492 492 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), 494 494 sizeof(instruction))) { 495 495 force_uaccess_end(oldfs); 496 496 goto uspace_segv; ··· 614 614 unsigned short inst = 0; 615 615 int err; 616 616 617 - get_user(inst, (unsigned short*)regs->pc); 617 + get_user(inst, (unsigned short __user *)regs->pc); 618 618 619 619 err = do_fpu_inst(inst, regs); 620 620 if (!err) { ··· 699 699 return; 700 700 701 701 #ifdef CONFIG_SH_FPU_EMU 702 - get_user(inst, (unsigned short *)regs->pc + 1); 702 + get_user(inst, (unsigned short __user *)regs->pc + 1); 703 703 if (!do_fpu_inst(inst, regs)) { 704 - get_user(inst, (unsigned short *)regs->pc); 704 + get_user(inst, (unsigned short __user *)regs->pc); 705 705 if (!emulate_branch(inst, regs)) 706 706 return; 707 707 /* fault in branch.*/
+22 -125
arch/sh/math-emu/math.c
··· 51 51 #define Rn (regs->regs[n]) 52 52 #define Rm (regs->regs[m]) 53 53 54 - #define WRITE(d,a) ({if(put_user(d, (typeof (d)*)a)) return -EFAULT;}) 55 - #define READ(d,a) ({if(get_user(d, (typeof (d)*)a)) return -EFAULT;}) 54 + #define MWRITE(d,a) ({if(put_user(d, (typeof (d) __user *)a)) return -EFAULT;}) 55 + #define MREAD(d,a) ({if(get_user(d, (typeof (d) __user *)a)) return -EFAULT;}) 56 56 57 57 #define PACK_S(r,f) FP_PACK_SP(&r,f) 58 58 #define UNPACK_S(f,r) FP_UNPACK_SP(f,&r) ··· 157 157 { 158 158 if (FPSCR_SZ) { 159 159 FMOV_EXT(n); 160 - READ(FRn, Rm + R0 + 4); 160 + MREAD(FRn, Rm + R0 + 4); 161 161 n++; 162 - READ(FRn, Rm + R0); 162 + MREAD(FRn, Rm + R0); 163 163 } else { 164 - READ(FRn, Rm + R0); 164 + MREAD(FRn, Rm + R0); 165 165 } 166 166 167 167 return 0; ··· 173 173 { 174 174 if (FPSCR_SZ) { 175 175 FMOV_EXT(n); 176 - READ(FRn, Rm + 4); 176 + MREAD(FRn, Rm + 4); 177 177 n++; 178 - READ(FRn, Rm); 178 + MREAD(FRn, Rm); 179 179 } else { 180 - READ(FRn, Rm); 180 + MREAD(FRn, Rm); 181 181 } 182 182 183 183 return 0; ··· 189 189 { 190 190 if (FPSCR_SZ) { 191 191 FMOV_EXT(n); 192 - READ(FRn, Rm + 4); 192 + MREAD(FRn, Rm + 4); 193 193 n++; 194 - READ(FRn, Rm); 194 + MREAD(FRn, Rm); 195 195 Rm += 8; 196 196 } else { 197 - READ(FRn, Rm); 197 + MREAD(FRn, Rm); 198 198 Rm += 4; 199 199 } 200 200 ··· 207 207 { 208 208 if (FPSCR_SZ) { 209 209 FMOV_EXT(m); 210 - WRITE(FRm, Rn + R0 + 4); 210 + MWRITE(FRm, Rn + R0 + 4); 211 211 m++; 212 - WRITE(FRm, Rn + R0); 212 + MWRITE(FRm, Rn + R0); 213 213 } else { 214 - WRITE(FRm, Rn + R0); 214 + MWRITE(FRm, Rn + R0); 215 215 } 216 216 217 217 return 0; ··· 223 223 { 224 224 if (FPSCR_SZ) { 225 225 FMOV_EXT(m); 226 - WRITE(FRm, Rn + 4); 226 + MWRITE(FRm, Rn + 4); 227 227 m++; 228 - WRITE(FRm, Rn); 228 + MWRITE(FRm, Rn); 229 229 } else { 230 - WRITE(FRm, Rn); 230 + MWRITE(FRm, Rn); 231 231 } 232 232 233 233 return 0; ··· 240 240 if (FPSCR_SZ) { 241 241 FMOV_EXT(m); 242 242 Rn -= 8; 243 - WRITE(FRm, Rn + 4); 243 + MWRITE(FRm, Rn + 4); 244 244 m++; 245 - WRITE(FRm, Rn); 245 + MWRITE(FRm, Rn); 246 246 } else { 247 247 Rn -= 4; 248 - WRITE(FRm, Rn); 248 + MWRITE(FRm, Rn); 249 249 } 250 250 251 251 return 0; ··· 445 445 case 0x4052: 446 446 case 0x4062: 447 447 Rn -= 4; 448 - WRITE(*reg, Rn); 448 + MWRITE(*reg, Rn); 449 449 break; 450 450 case 0x4056: 451 451 case 0x4066: 452 - READ(*reg, Rn); 452 + MREAD(*reg, Rn); 453 453 Rn += 4; 454 454 break; 455 455 default: ··· 465 465 return id_fnmx(fregs, regs, code); 466 466 else 467 467 return id_sys(fregs, regs, code); 468 - } 469 - 470 - /** 471 - * denormal_to_double - Given denormalized float number, 472 - * store double float 473 - * 474 - * @fpu: Pointer to sh_fpu_soft structure 475 - * @n: Index to FP register 476 - */ 477 - static void denormal_to_double(struct sh_fpu_soft_struct *fpu, int n) 478 - { 479 - unsigned long du, dl; 480 - unsigned long x = fpu->fpul; 481 - int exp = 1023 - 126; 482 - 483 - if (x != 0 && (x & 0x7f800000) == 0) { 484 - du = (x & 0x80000000); 485 - while ((x & 0x00800000) == 0) { 486 - x <<= 1; 487 - exp--; 488 - } 489 - x &= 0x007fffff; 490 - du |= (exp << 20) | (x >> 3); 491 - dl = x << 29; 492 - 493 - fpu->fp_regs[n] = du; 494 - fpu->fp_regs[n+1] = dl; 495 - } 496 - } 497 - 498 - /** 499 - * ieee_fpe_handler - Handle denormalized number exception 500 - * 501 - * @regs: Pointer to register structure 502 - * 503 - * Returns 1 when it's handled (should not cause exception). 504 - */ 505 - static int ieee_fpe_handler(struct pt_regs *regs) 506 - { 507 - unsigned short insn = *(unsigned short *)regs->pc; 508 - unsigned short finsn; 509 - unsigned long nextpc; 510 - int nib[4] = { 511 - (insn >> 12) & 0xf, 512 - (insn >> 8) & 0xf, 513 - (insn >> 4) & 0xf, 514 - insn & 0xf}; 515 - 516 - if (nib[0] == 0xb || 517 - (nib[0] == 0x4 && nib[2] == 0x0 && nib[3] == 0xb)) /* bsr & jsr */ 518 - regs->pr = regs->pc + 4; 519 - 520 - if (nib[0] == 0xa || nib[0] == 0xb) { /* bra & bsr */ 521 - nextpc = regs->pc + 4 + ((short) ((insn & 0xfff) << 4) >> 3); 522 - finsn = *(unsigned short *) (regs->pc + 2); 523 - } else if (nib[0] == 0x8 && nib[1] == 0xd) { /* bt/s */ 524 - if (regs->sr & 1) 525 - nextpc = regs->pc + 4 + ((char) (insn & 0xff) << 1); 526 - else 527 - nextpc = regs->pc + 4; 528 - finsn = *(unsigned short *) (regs->pc + 2); 529 - } else if (nib[0] == 0x8 && nib[1] == 0xf) { /* bf/s */ 530 - if (regs->sr & 1) 531 - nextpc = regs->pc + 4; 532 - else 533 - nextpc = regs->pc + 4 + ((char) (insn & 0xff) << 1); 534 - finsn = *(unsigned short *) (regs->pc + 2); 535 - } else if (nib[0] == 0x4 && nib[3] == 0xb && 536 - (nib[2] == 0x0 || nib[2] == 0x2)) { /* jmp & jsr */ 537 - nextpc = regs->regs[nib[1]]; 538 - finsn = *(unsigned short *) (regs->pc + 2); 539 - } else if (nib[0] == 0x0 && nib[3] == 0x3 && 540 - (nib[2] == 0x0 || nib[2] == 0x2)) { /* braf & bsrf */ 541 - nextpc = regs->pc + 4 + regs->regs[nib[1]]; 542 - finsn = *(unsigned short *) (regs->pc + 2); 543 - } else if (insn == 0x000b) { /* rts */ 544 - nextpc = regs->pr; 545 - finsn = *(unsigned short *) (regs->pc + 2); 546 - } else { 547 - nextpc = regs->pc + 2; 548 - finsn = insn; 549 - } 550 - 551 - if ((finsn & 0xf1ff) == 0xf0ad) { /* fcnvsd */ 552 - struct task_struct *tsk = current; 553 - 554 - if ((tsk->thread.xstate->softfpu.fpscr & (1 << 17))) { 555 - /* FPU error */ 556 - denormal_to_double (&tsk->thread.xstate->softfpu, 557 - (finsn >> 8) & 0xf); 558 - tsk->thread.xstate->softfpu.fpscr &= 559 - ~(FPSCR_CAUSE_MASK | FPSCR_FLAG_MASK); 560 - task_thread_info(tsk)->status |= TS_USEDFPU; 561 - } else { 562 - force_sig_fault(SIGFPE, FPE_FLTINV, 563 - (void __user *)regs->pc); 564 - } 565 - 566 - regs->pc = nextpc; 567 - return 1; 568 - } 569 - 570 - return 0; 571 468 } 572 469 573 470 /**
+2 -2
arch/sh/mm/nommu.c
··· 28 28 return 0; 29 29 } 30 30 31 - __kernel_size_t __clear_user(void *to, __kernel_size_t n) 31 + __kernel_size_t __clear_user(void __user *to, __kernel_size_t n) 32 32 { 33 - memset(to, 0, n); 33 + memset((__force void *)to, 0, n); 34 34 return 0; 35 35 } 36 36
+4 -1
drivers/sh/maple/maple.c
··· 834 834 835 835 maple_queue_cache = KMEM_CACHE(maple_buffer, SLAB_HWCACHE_ALIGN); 836 836 837 - if (!maple_queue_cache) 837 + if (!maple_queue_cache) { 838 + retval = -ENOMEM; 838 839 goto cleanup_bothirqs; 840 + } 839 841 840 842 INIT_LIST_HEAD(&maple_waitq); 841 843 INIT_LIST_HEAD(&maple_sentq); ··· 850 848 if (!mdev[i]) { 851 849 while (i-- > 0) 852 850 maple_free_dev(mdev[i]); 851 + retval = -ENOMEM; 853 852 goto cleanup_cache; 854 853 } 855 854 baseunits[i] = mdev[i];