[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 01/14] gdbstub: make GDBState static and have common init
From: |
Richard Henderson |
Subject: |
Re: [PATCH v2 01/14] gdbstub: make GDBState static and have common init function |
Date: |
Sun, 1 Dec 2019 18:14:10 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 |
On 11/30/19 8:45 AM, Alex Bennée wrote:
> -static GDBState *gdbserver_state;
> +static GDBState gdbserver_state;
> +
> +static void init_gdbserver_state(void)
> +{
> + g_assert(!gdbserver_state.init);
> + memset(&gdbserver_state, 0, sizeof(GDBState));
> + gdbserver_state.init = true;
> +}
At no point does init transition from true to false, afaict. Therefore the
memset is unnecessary, as the effect is had from the default
zero-initialization of the static variable.
Otherwise,
Reviewed-by: Richard Henderson <address@hidden>
r~
- Re: [PATCH v2 01/14] gdbstub: make GDBState static and have common init function,
Richard Henderson <=