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

riscv: remove CONFIG_MMU ifdefs

The RISC-V port doesn't suport a nommu mode, so there is no reason
to provide some code only under a CONFIG_MMU ifdef.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>

authored by

Christoph Hellwig and committed by
Palmer Dabbelt
c163fb38 9e49a4ed

-24
-4
arch/riscv/include/asm/io.h
··· 21 21 22 22 #include <linux/types.h> 23 23 24 - #ifdef CONFIG_MMU 25 - 26 24 extern void __iomem *ioremap(phys_addr_t offset, unsigned long size); 27 25 28 26 /* ··· 33 35 #define ioremap_wt(addr, size) ioremap((addr), (size)) 34 36 35 37 extern void iounmap(volatile void __iomem *addr); 36 - 37 - #endif /* CONFIG_MMU */ 38 38 39 39 /* Generic IO read/write. These perform native-endian accesses. */ 40 40 #define __raw_writeb __raw_writeb
-4
arch/riscv/include/asm/pgtable.h
··· 20 20 21 21 #ifndef __ASSEMBLY__ 22 22 23 - #ifdef CONFIG_MMU 24 - 25 23 /* Page Upper Directory not used in RISC-V */ 26 24 #include <asm-generic/pgtable-nopud.h> 27 25 #include <asm/page.h> ··· 410 412 { 411 413 /* No page table caches to initialize */ 412 414 } 413 - 414 - #endif /* CONFIG_MMU */ 415 415 416 416 #define VMALLOC_SIZE (KERN_VIRT_SIZE >> 1) 417 417 #define VMALLOC_END (PAGE_OFFSET - 1)
-4
arch/riscv/include/asm/tlbflush.h
··· 15 15 #ifndef _ASM_RISCV_TLBFLUSH_H 16 16 #define _ASM_RISCV_TLBFLUSH_H 17 17 18 - #ifdef CONFIG_MMU 19 - 20 18 #include <linux/mm_types.h> 21 19 22 20 /* ··· 61 63 { 62 64 flush_tlb_all(); 63 65 } 64 - 65 - #endif /* CONFIG_MMU */ 66 66 67 67 #endif /* _ASM_RISCV_TLBFLUSH_H */
-12
arch/riscv/include/asm/uaccess.h
··· 127 127 * call. 128 128 */ 129 129 130 - #ifdef CONFIG_MMU 131 130 #define __get_user_asm(insn, x, ptr, err) \ 132 131 do { \ 133 132 uintptr_t __tmp; \ ··· 152 153 __disable_user_access(); \ 153 154 (x) = __x; \ 154 155 } while (0) 155 - #endif /* CONFIG_MMU */ 156 156 157 157 #ifdef CONFIG_64BIT 158 158 #define __get_user_8(x, ptr, err) \ 159 159 __get_user_asm("ld", x, ptr, err) 160 160 #else /* !CONFIG_64BIT */ 161 - #ifdef CONFIG_MMU 162 161 #define __get_user_8(x, ptr, err) \ 163 162 do { \ 164 163 u32 __user *__ptr = (u32 __user *)(ptr); \ ··· 190 193 (x) = (__typeof__(x))((__typeof__((x)-(x)))( \ 191 194 (((u64)__hi << 32) | __lo))); \ 192 195 } while (0) 193 - #endif /* CONFIG_MMU */ 194 196 #endif /* CONFIG_64BIT */ 195 197 196 198 ··· 263 267 ((x) = 0, -EFAULT); \ 264 268 }) 265 269 266 - 267 - #ifdef CONFIG_MMU 268 270 #define __put_user_asm(insn, x, ptr, err) \ 269 271 do { \ 270 272 uintptr_t __tmp; \ ··· 286 292 : "rJ" (__x), "i" (-EFAULT)); \ 287 293 __disable_user_access(); \ 288 294 } while (0) 289 - #endif /* CONFIG_MMU */ 290 - 291 295 292 296 #ifdef CONFIG_64BIT 293 297 #define __put_user_8(x, ptr, err) \ 294 298 __put_user_asm("sd", x, ptr, err) 295 299 #else /* !CONFIG_64BIT */ 296 - #ifdef CONFIG_MMU 297 300 #define __put_user_8(x, ptr, err) \ 298 301 do { \ 299 302 u32 __user *__ptr = (u32 __user *)(ptr); \ ··· 320 329 : "rJ" (__x), "rJ" (__x >> 32), "i" (-EFAULT)); \ 321 330 __disable_user_access(); \ 322 331 } while (0) 323 - #endif /* CONFIG_MMU */ 324 332 #endif /* CONFIG_64BIT */ 325 333 326 334 ··· 428 438 * will set "err" to -EFAULT, while successful accesses return the previous 429 439 * value. 430 440 */ 431 - #ifdef CONFIG_MMU 432 441 #define __cmpxchg_user(ptr, old, new, err, size, lrb, scb) \ 433 442 ({ \ 434 443 __typeof__(ptr) __ptr = (ptr); \ ··· 497 508 (err) = __err; \ 498 509 __ret; \ 499 510 }) 500 - #endif /* CONFIG_MMU */ 501 511 502 512 #endif /* _ASM_RISCV_UACCESS_H */