qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: "Marc-André Lureau" <marcandre.lureau@gmail.com>
Cc: qemu-devel@nongnu.org, qemu-s390x@nongnu.org, thuth@redhat.com,
	imbrenda@linux.ibm.com
Subject: Re: [PATCH 1/4] dump: Set dump info function pointers to NULL
Date: Wed, 8 Nov 2023 09:58:07 +0100	[thread overview]
Message-ID: <6fc86959-5fd5-4e54-954f-cfda8a374f34@linux.ibm.com> (raw)
In-Reply-To: <CAJ+F1CL2anS58w0bffJGzN_76To30ORafstQYT=REUYa42h+nQ@mail.gmail.com>

On 11/8/23 09:03, Marc-André Lureau wrote:
> Hi
> 
> On Tue, Nov 7, 2023 at 6:22 PM Janosch Frank <frankja@linux.ibm.com> wrote:
>>
>> Better to not rely on the struct zeroing since NULL is not necessarily
>> 0.
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>> ---
>>   dump/dump.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/dump/dump.c b/dump/dump.c
>> index d355ada62e..1d38274925 100644
>> --- a/dump/dump.c
>> +++ b/dump/dump.c
>> @@ -1706,6 +1706,9 @@ static void dump_state_prepare(DumpState *s)
>>   {
>>       /* zero the struct, setting status to active */
>>       *s = (DumpState) { .status = DUMP_STATUS_ACTIVE };
>> +    s->dump_info.arch_sections_add_fn = NULL;
>> +    s->dump_info.arch_sections_write_hdr_fn = NULL;
>> +    s->dump_info.arch_sections_write_fn = NULL;
>>   }
> 
> I think we would be in trouble if NULL is not 0. Do you have a better argument?
> 

I'm one of those people who likes to distinguish between pointers and 
non-pointers but I have no problem dropping this.


OT: On s390 0x0 is a valid address but the kernel maps & handles it in a 
way that it will result in a null pointer if read/written to.


  reply	other threads:[~2023-11-08  8:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07 14:20 [PATCH 0/4] dump: Arch info function pointer addition and cleanup Janosch Frank
2023-11-07 14:20 ` [PATCH 1/4] dump: Set dump info function pointers to NULL Janosch Frank
2023-11-08  8:03   ` Marc-André Lureau
2023-11-08  8:58     ` Janosch Frank [this message]
2023-11-07 14:20 ` [PATCH 2/4] target/s390x/dump: Remove unneeded dump info function pointer init Janosch Frank
2023-11-07 17:12   ` Claudio Imbrenda
2023-11-08  8:09   ` Marc-André Lureau
2023-11-07 14:20 ` [PATCH 3/4] dump: Add arch cleanup function Janosch Frank
2023-11-07 14:20 ` [PATCH 4/4] target/s390x/arch_dump: Add arch cleanup function for PV dumps Janosch Frank
2023-11-08  8:17   ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6fc86959-5fd5-4e54-954f-cfda8a374f34@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).