[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 1/1] register: Remove unnecessary NULL check
From: |
Eduardo Habkost |
Subject: |
Re: [PATCH v1 1/1] register: Remove unnecessary NULL check |
Date: |
Fri, 2 Oct 2020 11:55:53 -0400 |
On Fri, Oct 02, 2020 at 08:33:40AM -0700, Alistair Francis wrote:
> This patch fixes CID 1432800 by removing an unnecessary check.
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> hw/core/register.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/core/register.c b/hw/core/register.c
> index 31038bd7cc..9ac9bc6bfe 100644
> --- a/hw/core/register.c
> +++ b/hw/core/register.c
> @@ -258,7 +258,7 @@ static RegisterInfoArray *register_init_block(DeviceState
> *owner,
> int index = rae[i].addr / data_size;
> RegisterInfo *r = &ri[index];
>
> - if (data + data_size * index == 0 || !&rae[i]) {
> + if (!&rae[i]) {
I thought you were going to remove both checks.
rae can't be NULL, so &rae[i] will never be NULL.
> continue;
> }
>
> --
> 2.28.0
>
--
Eduardo