Commit 805a3eb
riscv: mm: init: try best to remove #ifdef CONFIG_XIP_KERNEL usage
Currently, the #ifdef CONFIG_XIP_KERNEL usage can be divided into the
following three types:
The first one is for functions/declarations only used in XIP case.
The second one is for XIP_FIXUP case. Something as below:
|foo_type foo;
|#ifdef CONFIG_XIP_KERNEL
|#define foo (*(foo_type *)XIP_FIXUP(&foo))
|#endif
Usually, it's better to let the foo macro sit with the foo var
together. But if various foos are defined adjacently, we can
save some #ifdef CONFIG_XIP_KERNEL usage by grouping them together.
The third one is for different implementations for XIP, usually, this
is a #ifdef...#else...#endif case.
This patch moves the pt_ops macro to adjacent #ifdef CONFIG_XIP_KERNEL
and group first type usage cases into one.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Alexandre Ghiti <alex@ghiti.fr>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>1 parent fe036db commit 805a3eb
1 file changed
Lines changed: 3 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 43 | | |
48 | 44 | | |
49 | 45 | | |
| |||
227 | 223 | | |
228 | 224 | | |
229 | 225 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | 226 | | |
235 | 227 | | |
236 | 228 | | |
| |||
242 | 234 | | |
243 | 235 | | |
244 | 236 | | |
| 237 | + | |
245 | 238 | | |
246 | 239 | | |
247 | 240 | | |
| |||
446 | 439 | | |
447 | 440 | | |
448 | 441 | | |
| 442 | + | |
| 443 | + | |
449 | 444 | | |
450 | 445 | | |
451 | 446 | | |
| |||
0 commit comments