From nobody Fri May 3 18:44:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1497884507883824.9159110726955; Mon, 19 Jun 2017 08:01:47 -0700 (PDT) Received: from localhost ([::1]:43050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMyBV-000277-Jl for importer@patchew.org; Mon, 19 Jun 2017 11:01:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dMyAL-0001C2-Dm for qemu-devel@nongnu.org; Mon, 19 Jun 2017 11:00:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dMyAH-0003qD-Gy for qemu-devel@nongnu.org; Mon, 19 Jun 2017 11:00:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35460) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dMyA7-0003j9-8L; Mon, 19 Jun 2017 11:00:19 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2A86D80F7C; Mon, 19 Jun 2017 15:00:18 +0000 (UTC) Received: from localhost (unknown [10.36.118.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E69483645; Mon, 19 Jun 2017 15:00:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2A86D80F7C Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=stefanha@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2A86D80F7C From: Stefan Hajnoczi To: Date: Mon, 19 Jun 2017 16:00:02 +0100 Message-Id: <20170619150002.3033-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 19 Jun 2017 15:00:18 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] qemu-img: don't shadow opts variable in img_dd() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Reda Sallahi , Stefan Hajnoczi , qemu-block@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" It's confusing when two different variables have the same name in one function. Cc: Reda Sallahi Signed-off-by: Stefan Hajnoczi --- qemu-img.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 0ad698d..c285c2f 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -4249,15 +4249,12 @@ static int img_dd(int argc, char **argv) case 'U': force_share =3D true; break; - case OPTION_OBJECT: { - QemuOpts *opts; - opts =3D qemu_opts_parse_noisily(&qemu_object_opts, - optarg, true); - if (!opts) { + case OPTION_OBJECT: + if (!qemu_opts_parse_noisily(&qemu_object_opts, optarg, true))= { ret =3D -1; goto out; } - } break; + break; case OPTION_IMAGE_OPTS: image_opts =3D true; break; --=20 2.9.4