From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57971) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VELng-00014a-Kr for qemu-devel@nongnu.org; Tue, 27 Aug 2013 12:07:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VELnY-0006sl-4A for qemu-devel@nongnu.org; Tue, 27 Aug 2013 12:07:24 -0400 Received: from [2a03:4000:1::4e2f:c7ac:d] (port=39524 helo=v220110690675601.yourvserver.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VELnX-0006sc-U3 for qemu-devel@nongnu.org; Tue, 27 Aug 2013 12:07:16 -0400 Message-ID: <521CCEA6.4070002@weilnetz.de> Date: Tue, 27 Aug 2013 18:07:02 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1377618961-30439-1-git-send-email-kwolf@redhat.com> In-Reply-To: <1377618961-30439-1-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] block: Remove redundant assertion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org 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 > --- > 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); > }