[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 09/14] exec: Drop redundant #ifdeffery
From: |
Richard Henderson |
Subject: |
Re: [PATCH 09/14] exec: Drop redundant #ifdeffery |
Date: |
Sun, 15 Mar 2020 13:39:58 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 |
On 3/13/20 11:36 AM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> exec.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/exec.c b/exec.c
> index 7bc9828c5b..f258502966 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -185,10 +185,6 @@ struct DirtyBitmapSnapshot {
> unsigned long dirty[];
> };
>
> -#endif
> -
> -#if !defined(CONFIG_USER_ONLY)
> -
> static void phys_map_node_reserve(PhysPageMap *map, unsigned nodes)
> {
> static unsigned alloc_hint = 16;
>
There's even more than that. Looking further down,
> 745 #endif
> 746
> 747 #if !defined(CONFIG_USER_ONLY)
This is the #endif that paired with the one at 190.
Later,
> 988 #if defined(CONFIG_USER_ONLY)
...
> 1000 #else
...
> 1031 #endif
> 1032
> 1033 #ifndef CONFIG_USER_ONLY
So those three lines are redundant.
Later,
> 1252 #if !defined(CONFIG_USER_ONLY)
...
> 1438 #endif /* defined(CONFIG_USER_ONLY) */
> 1439
> 1440 #if !defined(CONFIG_USER_ONLY)
Clearly these ifdefs are very hard to follow. I would thus welcome a split of
this file.
Possibly into exec-common.c (with functions present in both softmmu and
user-only, with ifdefs *inside* functions only), and exec-system.c (with no
/#if.*CONFIG_USER_ONLY/).
But exec.c is over 4000 lines, so if there's another logical split into even
more files, that would be even better.
r~
- Re: [PATCH 05/14] stubs/Makefile: Reduce the user-mode object list, (continued)
- [PATCH 06/14] util/Makefile: Reduce the user-mode object list, Philippe Mathieu-Daudé, 2020/03/13
- [PATCH 07/14] target/riscv/cpu: Restrict CPU migration to system-mode, Philippe Mathieu-Daudé, 2020/03/13
- [PATCH 08/14] exec: Assert CPU migration is not used on user-only build, Philippe Mathieu-Daudé, 2020/03/13
- [PATCH 09/14] exec: Drop redundant #ifdeffery, Philippe Mathieu-Daudé, 2020/03/13
- [PATCH 10/14] arch_init: Remove unused 'qapi-commands-misc.h' include, Philippe Mathieu-Daudé, 2020/03/13
- [PATCH 11/14] target: Restrict write_elfXX_note() handlers to system-mode, Philippe Mathieu-Daudé, 2020/03/13
- [PATCH 12/14] target/i386: Restrict CpuClass::get_crash_info() to system-mode, Philippe Mathieu-Daudé, 2020/03/13
- [PATCH 13/14] target/s390x: Restrict CpuClass::get_crash_info() to system-mode, Philippe Mathieu-Daudé, 2020/03/13