[PATCH v2 1/3] target/s390x/dump: Remove unneeded dump info function pointer init

Janosch Frank posted 3 patches 1 year ago
Maintainers: "Marc-André Lureau" <marcandre.lureau@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, David Hildenbrand <david@redhat.com>, Ilya Leoshkevich <iii@linux.ibm.com>, Thomas Huth <thuth@redhat.com>
[PATCH v2 1/3] target/s390x/dump: Remove unneeded dump info function pointer init
Posted by Janosch Frank 1 year ago
dump_state_prepare() now sets the function pointers to NULL so we only
need to touch them if we're going to use them.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 target/s390x/arch_dump.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c
index 51a2116515..bdb0bfa0e7 100644
--- a/target/s390x/arch_dump.c
+++ b/target/s390x/arch_dump.c
@@ -448,10 +448,6 @@ int cpu_get_dump_info(ArchDumpInfo *info,
         info->arch_sections_add_fn = *arch_sections_add;
         info->arch_sections_write_hdr_fn = *arch_sections_write_hdr;
         info->arch_sections_write_fn = *arch_sections_write;
-    } else {
-        info->arch_sections_add_fn = NULL;
-        info->arch_sections_write_hdr_fn = NULL;
-        info->arch_sections_write_fn = NULL;
     }
     return 0;
 }
-- 
2.34.1


Re: [PATCH v2 1/3] target/s390x/dump: Remove unneeded dump info function pointer init
Posted by Thomas Huth 1 year ago
On 09/11/2023 13.04, Janosch Frank wrote:
> dump_state_prepare() now sets the function pointers to NULL so we only
> need to touch them if we're going to use them.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   target/s390x/arch_dump.c | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c
> index 51a2116515..bdb0bfa0e7 100644
> --- a/target/s390x/arch_dump.c
> +++ b/target/s390x/arch_dump.c
> @@ -448,10 +448,6 @@ int cpu_get_dump_info(ArchDumpInfo *info,
>           info->arch_sections_add_fn = *arch_sections_add;
>           info->arch_sections_write_hdr_fn = *arch_sections_write_hdr;
>           info->arch_sections_write_fn = *arch_sections_write;
> -    } else {
> -        info->arch_sections_add_fn = NULL;
> -        info->arch_sections_write_hdr_fn = NULL;
> -        info->arch_sections_write_fn = NULL;
>       }
>       return 0;
>   }

Reviewed-by: Thomas Huth <thuth@redhat.com>