qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] block: Remove redundant assertion


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] block: Remove redundant assertion
Date: Tue, 27 Aug 2013 18:07:02 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130803 Thunderbird/17.0.8

Am 27.08.2013 17:56, schrieb Kevin Wolf:
> The failing condition is checked immediately before the assertion, so
> keeping the assertion is kind of redundant.

Are you sure that it is not the check which is redundant?
Is file == NULL allowed in this 'else' branch?

Regards,
Stefan

>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  block.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/block.c b/block.c
> index a387c1a..26639e8 100644
> --- a/block.c
> +++ b/block.c
> @@ -743,7 +743,6 @@ static int bdrv_open_common(BlockDriverState *bs, 
> BlockDriverState *file,
>              ret = -EINVAL;
>              goto free_and_fail;
>          }
> -        assert(file != NULL);
>          bs->file = file;
>          ret = drv->bdrv_open(bs, options, open_flags);
>      }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]