Fengguang Wu reports that building ARM with !MMU results in the following build error: arch/arm/kernel/built-in.o: In function `__soft_restart': >> :(.text+0x1624): undefined reference to `arch_virt_to_idmap' Fix this by adding an appropriate IS_ENABLED(CONFIG_MMU) into the __virt_to_idmap() inline function.
Unified · Split
| @@ -286,7 +286,7 @@ extern phys_addr_t (*arch_virt_to_idmap)(unsigned long x); · 285 unmodified lines | ||
| 286 | 286 | */ |
| 287 | 287 | static inline phys_addr_t __virt_to_idmap(unsigned long x) |
| 288 | 288 | { |
| 289 | − if (arch_virt_to_idmap) | |
| 289 | + if (IS_ENABLED(CONFIG_MMU) && arch_virt_to_idmap) | |
| 290 | 290 | return arch_virt_to_idmap(x); |
| 291 | 291 | else |
| 292 | 292 | return __virt_to_phys(x); |