From patchwork Wed Apr 7 05:46:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Klaus Jensen X-Patchwork-Id: 12186951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6D28C433ED for ; Wed, 7 Apr 2021 05:54:27 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 416E7613C0 for ; Wed, 7 Apr 2021 05:54:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 416E7613C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=irrelevant.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lU190-0006Ve-0z for qemu-devel@archiver.kernel.org; Wed, 07 Apr 2021 01:54:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU11a-00028f-Lc; Wed, 07 Apr 2021 01:46:46 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:59643) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lU11Y-00051P-7a; Wed, 07 Apr 2021 01:46:46 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 74C905C00F3; Wed, 7 Apr 2021 01:46:43 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 07 Apr 2021 01:46:43 -0400 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=Crc5lY8+8kAgy fg0VFPjqfXIPSIUBFx9BFUoUUZKTVo=; b=Jk0fa0zBANtWbQf+9CxAIZHFDPJmQ qYhuUFcEKikNWb1p+DwzxG5bSmtjZ720osjNKfmYFmp1nEcUp1SHzquiHqNfcQy4 ctofaOZPjN8fsMBOfg4MCSlUychW8Bszy5fcRB0e8gQRwXE6hdSAnC5xfWBTumEx DO2t6EnU4cWPt6thO6r295tlwlG1LfpMQeul2+55INFHXz4X1JKDajAvVELl1b/h yyJr/UJy1KPSarh3P+HRxPceugNj0TJbIx27W3oFf/iQkgAf3WENMCAXi2+v1MU0 kI/Usyl1B4+Hdob7GqNcndwVWbPkN15fmQrCL7RbTUf1wqWJDIoGEGPsw== 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=Crc5lY8+8kAgyfg0VFPjqfXIPSIUBFx9BFUoUUZKTVo=; b=P2/D8Nw4 FmL16sKU5bpgrBkQ84i4Ln8lMYxK/EcYBUnfEu24JTkN8GEbY8/Dnk0YzbmGyX/B 9WGKp9CHQcbRYRoA7g+MK9FtNSy/31FTJjL2fVP7GAc7+BVG3ao6422MBUxiahqs tDpeaNt6STiV+DkvU+U0L/n6+NconcLnT0kqHLu+QSdsUsX3prsDeIA9X370uK26 n0rBzQmz8v0pSlj7U8N8P+1pO60lCuJzUMmFlVvktiICB96BZqp8SQ9SdnTVN1a9 IyXdFa2c6FoXvL+icWRUBrBKR0w8cwR2PcQxDX51E/TDKdkd0/fBOpYv44yVl162 sCpxHqU9bSstoQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejiedguddttdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepmfhlrghu shculfgvnhhsvghnuceoihhtshesihhrrhgvlhgvvhgrnhhtrdgukheqnecuggftrfgrth htvghrnhepueelteegieeuhffgkeefgfevjeeigfetkeeitdfgtdeifefhtdfhfeeuffev gfeknecukfhppeektddrudeijedrleekrdduledtnecuvehluhhsthgvrhfuihiivgepvd enucfrrghrrghmpehmrghilhhfrhhomhepihhtshesihhrrhgvlhgvvhgrnhhtrdgukh X-ME-Proxy: 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 2650D108005F; Wed, 7 Apr 2021 01:46:42 -0400 (EDT) From: Klaus Jensen To: qemu-devel@nongnu.org Subject: [PULL for-6.0 v2 03/10] hw/block/nvme: fix the nsid 'invalid' value Date: Wed, 7 Apr 2021 07:46:28 +0200 Message-Id: <20210407054635.189440-4-its@irrelevant.dk> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210407054635.189440-1-its@irrelevant.dk> References: <20210407054635.189440-1-its@irrelevant.dk> MIME-Version: 1.0 Received-SPF: pass client-ip=66.111.4.29; envelope-from=its@irrelevant.dk; helo=out5-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 , Stefan Hajnoczi , Keith Busch Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Klaus Jensen The `nvme_nsid()` function returns '-1' (FFFFFFFFh) when the given namespace is NULL. Since FFFFFFFFh is actually a valid namespace identifier (the "broadcast" value), change this to be '0' since that actually *is* the invalid value. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu Reviewed-by: Keith Busch --- hw/block/nvme-ns.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/nvme-ns.h b/hw/block/nvme-ns.h index 9ab7894fc83e..82340c4b2574 100644 --- a/hw/block/nvme-ns.h +++ b/hw/block/nvme-ns.h @@ -96,7 +96,7 @@ static inline uint32_t nvme_nsid(NvmeNamespace *ns) return ns->params.nsid; } - return -1; + return 0; } static inline bool nvme_ns_shared(NvmeNamespace *ns)