From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYu6Q-0003sp-4d for qemu-devel@nongnu.org; Fri, 29 Jun 2018 10:10:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYu6O-0003r9-Dx for qemu-devel@nongnu.org; Fri, 29 Jun 2018 10:10:21 -0400 From: Kevin Wolf Date: Fri, 29 Jun 2018 16:09:42 +0200 Message-Id: <20180629140959.6690-13-kwolf@redhat.com> In-Reply-To: <20180629140959.6690-1-kwolf@redhat.com> References: <20180629140959.6690-1-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 12/29] qcow2: Remove dead check on !ret List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org From: Fam Zheng In the beginning of the function, we initialize the local variable to 0, and in the body of the function, we check the assigned values and exit the loop immediately. So here it can never be non-zero. Reported-by: Kevin Wolf Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Kevin Wolf --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index 4a0d92860d..2d190aa00b 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1772,7 +1772,7 @@ static coroutine_fn int qcow2_handle_l2meta(BlockDr= iverState *bs, while (l2meta !=3D NULL) { QCowL2Meta *next; =20 - if (!ret && link_l2) { + if (link_l2) { ret =3D qcow2_alloc_cluster_link_l2(bs, l2meta); if (ret) { goto out; --=20 2.13.6