From nobody Mon Feb 9 09:16:26 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1597943045; cv=none; d=zohomail.com; s=zohoarc; b=Qp7KI1MryjhcbFCUDnifMU4q6ABYQIx7yKTko2vlqBIK9BLQvKniNKfxUWYsuXWCcvP/YYtZcWBkzdq3Ff67AinP4MTD/ONLlAjssdpjUDDKvuintearTqMFD9nFBqqOoLxqDFL6ly4lis7wrDsBxn73ow/iCJpLcPKKpEsaui8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597943045; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NKc50BIrrP5rch9WHJ6NJlXLamMISYumaOhjTxgnFao=; b=WHDrTihkZ1rFX4aj/gnFzEfEQNf2Ptjf5jprsGb9TVkGTIF05WlndgZ/QtU6DtbtI8fLLOQTLUkVgpL2eOGHnFQjbuq1LilQ6RGH9RPt/1RVOqlTvMHZhq10j9rbf/0GuBTUlx/M5+wXwnZNPGXhonO6QRuI5qWJjO1TmGNpThw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159794304541349.93818620504214; Thu, 20 Aug 2020 10:04:05 -0700 (PDT) Received: from localhost ([::1]:35314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k8nyu-0001wi-5l for importer@patchew.org; Thu, 20 Aug 2020 13:04:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35768) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k8nuj-0003tv-St for qemu-devel@nongnu.org; Thu, 20 Aug 2020 12:59:45 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:20941 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k8nui-0006E9-2w for qemu-devel@nongnu.org; Thu, 20 Aug 2020 12:59:45 -0400 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-257-RZyDiQK8NkaeNqIOfiVgKQ-1; Thu, 20 Aug 2020 12:59:41 -0400 Received: by mail-wm1-f71.google.com with SMTP id b73so1010205wmb.0 for ; Thu, 20 Aug 2020 09:59:41 -0700 (PDT) Received: from x1w.redhat.com (121.red-81-40-121.staticip.rima-tde.net. [81.40.121.121]) by smtp.gmail.com with ESMTPSA id w64sm5977018wmb.26.2020.08.20.09.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2020 09:59:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597942783; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NKc50BIrrP5rch9WHJ6NJlXLamMISYumaOhjTxgnFao=; b=iHQLRbw6LiAkf4dxUbr2marWfHumGg450DMysK1KDhWIbA43rwQGGMX7sh9aDc39LT4p8n YqPp5RNzuv6tyl+8BONnIWvjJ8NfrW8OgAV3dGkOv1skXPPzQtvW1MOaYgmBWtFebLaKDI TV057vdp1tHe1mCxJspB5AchNVY814k= X-MC-Unique: RZyDiQK8NkaeNqIOfiVgKQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NKc50BIrrP5rch9WHJ6NJlXLamMISYumaOhjTxgnFao=; b=OpUvPLwsF4LU/hxn2RLC5opwUzkOCmbRW5wSFMvhnRej9b537Rb9Jvr8SCwK/f+c0H sKg4h3ehQ3LX3DmSUy1MQK/VxhDJELJkSlm50kMJbK1ObozfyaRwyJytCQOZQYaCgmg2 DI4Y08bc0UUHMOKwwr9pg2f9NKGqoShOVRp5XZthn+hr4qY2vGLXnX8mSpFseikaNdSD ulT/PP+8UsrPMfo3saWAxySYvvFbwtyLfx96o1xz6+vQVZrJazNaAuocS1cUe6wTfFTC fpR9fUpTXhWfhhAn7KbV4jdlCMswUGkb+88IUdki9ih7e6iBlTgsdfsCp9wKR+KeNRNO Nmmg== X-Gm-Message-State: AOAM532CSePRTDe8ZDIfjv3AFgcbQzrq7NTnXNzXhEU6cyAabNrtWEKs ed7Mxl33gSG6RXzIv0a2VoHAAhH+XYqbJnvrR8GcvQmCvIOWDGcaNYLM7aCchGsFsHZH7JwCela W9d6ld8BnCqddrNU= X-Received: by 2002:a7b:c3d2:: with SMTP id t18mr4343876wmj.92.1597942780265; Thu, 20 Aug 2020 09:59:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFonyEwhB0zxrU2YR0L4qmUUhyhI1V4G1yP632cW+r7rqLl5uZMvjeDbImfXO5ymJnV1F2Pg== X-Received: by 2002:a7b:c3d2:: with SMTP id t18mr4343862wmj.92.1597942780103; Thu, 20 Aug 2020 09:59:40 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v5 07/15] block/nvme: Rename local variable Date: Thu, 20 Aug 2020 18:58:53 +0200 Message-Id: <20200820165901.1139109-8-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200820165901.1139109-1-philmd@redhat.com> References: <20200820165901.1139109-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/19 20:12:44 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Kevin Wolf , qemu-block@nongnu.org, Max Reitz , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We are going to modify the code in the next commit. Renaming the 'resp' variable to 'id' first makes the next commit easier to review. No logical changes. Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefano Garzarella --- block/nvme.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 3101f1ad55d..99822d9fd36 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -510,8 +510,8 @@ static void nvme_identify(BlockDriverState *bs, int nam= espace, Error **errp) BDRVNVMeState *s =3D bs->opaque; NvmeIdCtrl *idctrl; NvmeIdNs *idns; + uint8_t *id; NvmeLBAF *lbaf; - uint8_t *resp; uint16_t oncs; int r; uint64_t iova; @@ -520,14 +520,14 @@ static void nvme_identify(BlockDriverState *bs, int n= amespace, Error **errp) .cdw10 =3D cpu_to_le32(0x1), }; =20 - resp =3D qemu_try_blockalign0(bs, sizeof(NvmeIdCtrl)); - if (!resp) { + id =3D qemu_try_blockalign0(bs, sizeof(NvmeIdCtrl)); + if (!id) { error_setg(errp, "Cannot allocate buffer for identify response"); goto out; } - idctrl =3D (NvmeIdCtrl *)resp; - idns =3D (NvmeIdNs *)resp; - r =3D qemu_vfio_dma_map(s->vfio, resp, sizeof(NvmeIdCtrl), true, &iova= ); + idctrl =3D (NvmeIdCtrl *)id; + idns =3D (NvmeIdNs *)id; + r =3D qemu_vfio_dma_map(s->vfio, id, sizeof(NvmeIdCtrl), true, &iova); if (r) { error_setg(errp, "Cannot map buffer for DMA"); goto out; @@ -554,8 +554,7 @@ static void nvme_identify(BlockDriverState *bs, int nam= espace, Error **errp) s->supports_write_zeroes =3D !!(oncs & NVME_ONCS_WRITE_ZEROS); s->supports_discard =3D !!(oncs & NVME_ONCS_DSM); =20 - memset(resp, 0, 4096); - + memset(id, 0, 4096); cmd.cdw10 =3D 0; cmd.nsid =3D cpu_to_le32(namespace); if (nvme_cmd_sync(bs, s->queues[INDEX_ADMIN], &cmd)) { @@ -587,8 +586,8 @@ static void nvme_identify(BlockDriverState *bs, int nam= espace, Error **errp) =20 s->blkshift =3D lbaf->ds; out: - qemu_vfio_dma_unmap(s->vfio, resp); - qemu_vfree(resp); + qemu_vfio_dma_unmap(s->vfio, id); + qemu_vfree(id); } =20 static bool nvme_poll_queues(BDRVNVMeState *s) --=20 2.26.2