From nobody Mon Feb 9 07:56:35 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=1612861149; cv=none; d=zohomail.com; s=zohoarc; b=jez05MX4n2g6XMdJwY0j7XlDtZhNmqeuIk8GRantnuPxRouxyurj6JGJTgWe7JXm4Hm0rMQjoCr55BuP04v4dobmiwS79iPWiARh/zRT8L2hIYgfJBdyD2MHgLcjWs0/ReEgKnbbI/E4zTOa/ETPVGvKllv2Iuv/CAjE/48sVz8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612861149; 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=GRHAgtYF+OuPgt1vzaDi3gDgCfTt/KuTQlFSyyDK3fk=; b=HQLJkUn1BE5GPHukc4tlqP2bGHX8VXq9amonv9I9rtEprw8etafKSDjutDdq1LOynzf5kZtQbJZC0rQC9SCuk+LzT1KwSKCqzbBZn1NZmFkW2Yz9D4r2b3DM03CRVNpFz4iBaMYJ1lUQerLzfJdNVF7lBB2TMPBr+6MHte4rGsM= 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 1612861149326963.2898220877014; Tue, 9 Feb 2021 00:59:09 -0800 (PST) Received: from localhost ([::1]:41342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l9OrU-0002FV-8r for importer@patchew.org; Tue, 09 Feb 2021 03:59:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9NWL-0005mA-3b; Tue, 09 Feb 2021 02:33:13 -0500 Received: from wnew1-smtp.messagingengine.com ([64.147.123.26]:44445) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l9NWJ-00060q-7R; Tue, 09 Feb 2021 02:33:12 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id EB250CCB; Tue, 9 Feb 2021 02:32:45 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 09 Feb 2021 02:32:46 -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 1B97C1080067; Tue, 9 Feb 2021 02:32:44 -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=GRHAgtYF+OuPg t1vzaDi3gDgCfTt/KuTQlFSyyDK3fk=; b=tJsexsKDMeVpppCW0cXK+WfR353C/ UGpuBBL4M+Q45rk453JtSXYhh2hsDcyhJtgQj0nwuNlxuw5vb3LPOVIGiK2i93Nr 3dmDtN3ZsSMxFPcQi/zOTphIEWLiKARIhxA1m7OOiT6jJFBvcoE6ERo7UgXBOVRL GF5vLXVG7c2q/XM07t+IK45ziQLNwHpr73OpRjdk2VugGz+5gx+Z7t2thUDq9GwO awGRbXCFQGcD85BwRP+m5V8NgV12FgEdAymM+/slsXB45/DUS4YL16LcMTwjfTnt h+rcRcrNwaZJ5nTxlegS4T5BiDVtr6gcL7fJq/Lca9N5yQx/wiCuwkoEQ== 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=GRHAgtYF+OuPgt1vzaDi3gDgCfTt/KuTQlFSyyDK3fk=; b=mNl1VrUn D1pm33dfrfRakUu/ZFxwuZGwCBj8qiMYWzn6YCYNDkp2SdTByFDO4V3g+wxnSamB 3ldEsxPTIFQK+BkzOHt+yobLjZdUtc+ZUAEq4NQUjBOqCwwuNQEfUr7wdEhOsy9x bauXXTd1DUuMgJV2Q8r8qBe/aH7UrQXNCdXbQf9Xg0NV6JpnCYkuv6LOx7Z5bbwW 0EOw2HGsAMbblTNcsQi1B8HzkQHALO/qd1t3bAwIU6KlNQAEwdFlv9uoGTycs3WZ txblJHrRYPhjqosY6iy78gBaqFVWOMPIbSmn3ASLoAb97zbIiYvCyOAcYY37g9pc g8nINY3p8QaVcQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrheeggdduuddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefmlhgruhhs ucflvghnshgvnhcuoehithhssehirhhrvghlvghvrghnthdrughkqeenucggtffrrghtth gvrhhnpeeuleetgeeiuefhgfekfefgveejiefgteekiedtgfdtieefhfdthfefueffvefg keenucfkphepkedtrdduieejrdelkedrudeltdenucevlhhushhtvghrufhiiigvpedvvd enucfrrghrrghmpehmrghilhhfrhhomhepihhtshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: From: Klaus Jensen To: qemu-devel@nongnu.org, Peter Maydell Subject: [PULL 53/56] hw/block/nvme: align with existing style Date: Tue, 9 Feb 2021 08:30:58 +0100 Message-Id: <20210209073101.548811-54-its@irrelevant.dk> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210209073101.548811-1-its@irrelevant.dk> References: <20210209073101.548811-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=64.147.123.26; envelope-from=its@irrelevant.dk; helo=wnew1-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: Fam Zheng , Kevin Wolf , qemu-block@nongnu.org, Dmitry Fomichev , Klaus Jensen , Gollu Appalanaidu , Max Reitz , Klaus Jensen , 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: Gollu Appalanaidu Change status checks to align with the existing style and remove the explicit check against NVME_SUCCESS. Cc: Dmitry Fomichev Signed-off-by: Gollu Appalanaidu Reviewed-by: Klaus Jensen Reviewed-by: Keith Busch Reviewed-by: Dmitry Fomichev Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index c99a3fbf3461..2335739bdb17 100644 --- a/hw/block/nvme.c +++ b/hw/block/nvme.c @@ -1198,7 +1198,7 @@ static uint16_t nvme_check_zone_write(NvmeCtrl *n, Nv= meNamespace *ns, status =3D nvme_check_zone_state_for_write(zone); } =20 - if (status !=3D NVME_SUCCESS) { + if (status) { trace_pci_nvme_err_zone_write_not_ok(slba, nlb, status); } else { assert(nvme_wp_is_valid(zone)); @@ -1253,7 +1253,7 @@ static uint16_t nvme_check_zone_read(NvmeNamespace *n= s, uint64_t slba, uint16_t status; =20 status =3D nvme_check_zone_state_for_read(zone); - if (status !=3D NVME_SUCCESS) { + if (status) { ; } else if (unlikely(end > bndry)) { if (!ns->params.cross_zone_read) { @@ -1266,7 +1266,7 @@ static uint16_t nvme_check_zone_read(NvmeNamespace *n= s, uint64_t slba, do { zone++; status =3D nvme_check_zone_state_for_read(zone); - if (status !=3D NVME_SUCCESS) { + if (status) { break; } } while (end > nvme_zone_rd_boundary(ns, zone)); @@ -1677,7 +1677,7 @@ static uint16_t nvme_read(NvmeCtrl *n, NvmeRequest *r= eq) =20 if (ns->params.zoned) { status =3D nvme_check_zone_read(ns, slba, nlb); - if (status !=3D NVME_SUCCESS) { + if (status) { trace_pci_nvme_err_zone_read_not_ok(slba, nlb, status); goto invalid; } @@ -1748,12 +1748,12 @@ static uint16_t nvme_do_write(NvmeCtrl *n, NvmeRequ= est *req, bool append, zone =3D nvme_get_zone_by_slba(ns, slba); =20 status =3D nvme_check_zone_write(n, ns, zone, slba, nlb, append); - if (status !=3D NVME_SUCCESS) { + if (status) { goto invalid; } =20 status =3D nvme_auto_open_zone(ns, zone); - if (status !=3D NVME_SUCCESS) { + if (status) { goto invalid; } =20 @@ -1852,14 +1852,14 @@ static uint16_t nvme_open_zone(NvmeNamespace *ns, N= vmeZone *zone, switch (state) { case NVME_ZONE_STATE_EMPTY: status =3D nvme_aor_check(ns, 1, 0); - if (status !=3D NVME_SUCCESS) { + if (status) { return status; } nvme_aor_inc_active(ns); /* fall through */ case NVME_ZONE_STATE_CLOSED: status =3D nvme_aor_check(ns, 0, 1); - if (status !=3D NVME_SUCCESS) { + if (status) { if (state =3D=3D NVME_ZONE_STATE_EMPTY) { nvme_aor_dec_active(ns); } @@ -1972,7 +1972,7 @@ static uint16_t nvme_set_zd_ext(NvmeNamespace *ns, Nv= meZone *zone) =20 if (state =3D=3D NVME_ZONE_STATE_EMPTY) { status =3D nvme_aor_check(ns, 1, 0); - if (status !=3D NVME_SUCCESS) { + if (status) { return status; } nvme_aor_inc_active(ns); @@ -3301,7 +3301,7 @@ static uint16_t nvme_set_feature_timestamp(NvmeCtrl *= n, NvmeRequest *req) =20 ret =3D nvme_dma(n, (uint8_t *)×tamp, sizeof(timestamp), DMA_DIRECTION_TO_DEVICE, req); - if (ret !=3D NVME_SUCCESS) { + if (ret) { return ret; } =20 --=20 2.30.0