From nobody Tue Feb 10 07:21:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1614608532; cv=none; d=zohomail.com; s=zohoarc; b=OUMcE54CqpY1m9XOn4DyGVZZ6eBC7uyzbCMv924aJi9e0/J0tUsDt+yzaIuTyQKWpsERiWuj2/FymW4EJwSyOJxaIexdydS2N9abyTgSr6taE53BTuY+CJkwNZCbRofUaDgjaBUfLX8JTJQigbyKn4nVJbUXk4U8tgDO1QhjuKQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614608532; h=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=BKqC5nB4lrKxFWeGqV6vxzP+/JjW3X3UsPxYJmBXNBc=; b=LIni6djLfC2H+omtcGtv7BVgiWpAUKpXMCe+0h2eVXQ+7zXnf1FsR5L+awNpfiHxQf5c8/MiREZRiBFFIWhyQlpjJKnPebMWiy4pipkrx2cXYq/CDD0+SSpWlTirlElFWSyMZv642HsLoMQIPfx6mBB85ph8pnhBnAbaVGOIs5M= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614608531878871.83401940369; Mon, 1 Mar 2021 06:22:11 -0800 (PST) Received: from localhost ([::1]:42470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGjR4-0000KJ-GH for importer@patchew.org; Mon, 01 Mar 2021 09:22:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36196) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGj6b-00029h-LQ; Mon, 01 Mar 2021 09:01:02 -0500 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:49875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGj6U-0003xt-Ot; Mon, 01 Mar 2021 09:01:01 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id AA941580430; Mon, 1 Mar 2021 09:00:52 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 01 Mar 2021 09:00:52 -0500 Received: from apples.local (80-167-98-190-cable.dk.customer.tdc.net [80.167.98.190]) by mail.messagingengine.com (Postfix) with ESMTPA id 9D0A9108006B; Mon, 1 Mar 2021 09:00:50 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irrelevant.dk; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=BKqC5nB4lrKxF WeGqV6vxzP+/JjW3X3UsPxYJmBXNBc=; b=BbvET98HZm7BfKmvZ7XYJudAG5At4 wfp1F2iqEXaRjikJNnwoEEFyVlokftKV5hYv3njbExIYJ60dBXxoOWtJ1NuTuJud g1OMerxj3NKnB9CPJXDtgQhKeSA4+jDHWcDRqV8716EuxdFXieVnwR8VEZxkVRPR yixz4FDaaovLJT7XkqDnEa3I5YKagNA336CjqcIKX+Q7iAdYEr6SZxPWWUKXhUXA N7qPaXzWys+/6L/mBYo45ecdkqCgMcA1abP0ayGMa2W6Yju/mQIjLGtw3GzXzV2P yE9U73owlphP1wjLIcy0u3aR8VZ7uJtI1zTYC41K3Z8it52/WWXEEyZCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=BKqC5nB4lrKxFWeGqV6vxzP+/JjW3X3UsPxYJmBXNBc=; b=dLMvB8yK 18i+JUktVZ/4VxqUvRGPsrm0s5O87yxlRAg35iyBKux/0Eh8fcm4+ncL+Nqiv7CR So4gZv+LhsedCUlgO+q1FDGqM7kjEuaRyv/6uiuj1mH6MCCuMpzy0F08C6qQUQ0u 3flpULx4jJuRhiZyyKYVBgykUZSUSBs8Kzw/svPg4d+hHPLL3DbvA7nZx3H7Vshe 3o+hUkQXe70VL9uZuBm4MNRqlU49U31fpASJU2BH67EBduNv7IPkmGCdqXIDBPfv 7KuxBvwv6poO23NjApWiPxu6qx084Yuow1D8N0OrtFaWE1E/vAKaya3VF95Cp6vB 4xOCUPdKbI9UqA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrleekgdehkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghushcu lfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrthhtvg hrnhepueelteegieeuhffgkeefgfevjeeigfetkeeitdfgtdeifefhtdfhfeeuffevgfek necukfhppeektddrudeijedrleekrdduledtnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepihhtshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PATCH v4 01/12] hw/block/nvme: remove redundant len member in compare context Date: Mon, 1 Mar 2021 15:00:36 +0100 Message-Id: <20210301140047.106261-2-its@irrelevant.dk> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301140047.106261-1-its@irrelevant.dk> References: <20210301140047.106261-1-its@irrelevant.dk> MIME-Version: 1.0 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=66.111.4.224; envelope-from=its@irrelevant.dk; helo=new2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-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: Kevin Wolf , Fam Zheng , qemu-block@nongnu.org, Klaus Jensen , Gollu Appalanaidu , Max Reitz , Klaus Jensen , Minwoo Im , Stefan Hajnoczi , Keith Busch Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Klaus Jensen The 'len' member of the nvme_compare_ctx struct is redundant since the same information is available in the 'iov' member. Signed-off-by: Klaus Jensen Reviewed-by: Minwoo Im Reviewed-by: Keith Busch --- hw/block/nvme.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index edd0b85c10ce..baa69a4a6859 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -1697,7 +1697,6 @@ static void nvme_aio_copy_in_cb(void *opaque, int ret) struct nvme_compare_ctx { QEMUIOVector iov; uint8_t *bounce; - size_t len; }; =20 static void nvme_compare_cb(void *opaque, int ret) @@ -1718,16 +1717,16 @@ static void nvme_compare_cb(void *opaque, int ret) goto out; } =20 - buf =3D g_malloc(ctx->len); + buf =3D g_malloc(ctx->iov.size); =20 - status =3D nvme_dma(nvme_ctrl(req), buf, ctx->len, DMA_DIRECTION_TO_DE= VICE, - req); + status =3D nvme_dma(nvme_ctrl(req), buf, ctx->iov.size, + DMA_DIRECTION_TO_DEVICE, req); if (status) { req->status =3D status; goto out; } =20 - if (memcmp(buf, ctx->bounce, ctx->len)) { + if (memcmp(buf, ctx->bounce, ctx->iov.size)) { req->status =3D NVME_CMP_FAILURE; } =20 @@ -1964,7 +1963,6 @@ static uint16_t nvme_compare(NvmeCtrl *n, NvmeRequest= *req) =20 ctx =3D g_new(struct nvme_compare_ctx, 1); ctx->bounce =3D bounce; - ctx->len =3D len; =20 req->opaque =3D ctx; =20 --=20 2.30.1