From nobody Mon Feb 9 09:33:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1603964037; cv=none; d=zohomail.com; s=zohoarc; b=hJvI9IuAjYslClw4Xxr1QaW5Z1ck2IJ0ls+yCHxzBA0XTLJOtqbpi2QdOnPagsoqnLtKXopjup4r1oOVaOkM5++plhPAPHEEobOmZbxoRz7xMvu9hcMIogTvXU7sHfYNYSDcsV/bafUohhkomYf1ahJy0c24cS5xqR1hTVn51eA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603964037; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=LNTJ5igNyyXKkWieXTvLU2UcanJIdRIlRwN2Ir3xgfg=; b=mezrV8mbnNkpxIzO9qo2VU1OD137PVtpze/hF0ppF97Z/QGVfh6w3HMtRbuZlkDuczJESi8DCRaVWeW0fsyrl8qIg/KwD0Vnglx1PsZ09HYJLw2Mb9/T2st0YU/P5b53gXu4QHPmnk3PRrBgZZ19FkuuJs+T7Uh1FRfgYazwkrs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1603964037150897.9911348347805; Thu, 29 Oct 2020 02:33:57 -0700 (PDT) Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-203-TcysfZalMw-5_yp3CfAtsQ-1; Thu, 29 Oct 2020 05:33:53 -0400 Received: by mail-ed1-f71.google.com with SMTP id dm20so954597edb.2 for ; Thu, 29 Oct 2020 02:33:53 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (234.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.234]) by smtp.gmail.com with ESMTPSA id b24sm398626edt.68.2020.10.29.02.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 02:33:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603964035; 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=LNTJ5igNyyXKkWieXTvLU2UcanJIdRIlRwN2Ir3xgfg=; b=W+k5ly2z5WEO6YzbzhoViamrwRB2FeBaH4EZg0U0XXefZP8rnrVeft52Yz/gWf0/kyv80B 1TMGPtT1Td3MgbudDtQjbXK42zZ6A/9kmXlBwke1nSYEgaOlSOO5c/GKkDq72nQhIYOg2k /BEKy5Ls0Ry6EfJI4kY84BmSJXwYMnQ= X-MC-Unique: TcysfZalMw-5_yp3CfAtsQ-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=LNTJ5igNyyXKkWieXTvLU2UcanJIdRIlRwN2Ir3xgfg=; b=p6PGnfgVywonzWGSpITxvjNoJQeAdgZkoRP/mxdc0ZwrfDcBe6LBYsjqyE0sy5ghX/ 2JYNMlwV5eRuW1Clj/3qXgLBIzRppRCqnbnp4gegXfnRnynni/LnXJxlaXBTkPLrMoej uWl5ml7klyzoiIkpwuRpgORLPYD9cHEIzFdMsjb2SqDEUhZZZfE2hJ03qU5X6y+mIcov 7P4F3spkwB5qoWgBKMjSJc5lzwAy6cEP857bge6kKGTSZblpKNXh6nTMSf2HQwgEFyZY 8X4ENPnzh7PTRWO70NP/6r6WH/Ga185+7an4KjLjqVzLZbR/ACsXHIrMx68K2ZZYYuxM vTvA== X-Gm-Message-State: AOAM5325W2pHTn4YhIbh5nW9oNPgu0x9c7kWO6T0ZQf/B0hCdRfetu39 rPMxGaAw7h0hUuxWGmPa5/x0AZQrqftzgte/PXXBKGpqhw+f2h3rNugqHgzLq62hU1SrXDLAhr6 +e7jxUvcVpBhbAw== X-Received: by 2002:a17:906:f148:: with SMTP id gw8mr518345ejb.192.1603964032301; Thu, 29 Oct 2020 02:33:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztTl+bsWy4FrmaMCFpQbfLGLKKcnQIg2bTntM3tBGkLjyLF1s0qLKsE7iZ9jsaLp8s9OC3/A== X-Received: by 2002:a17:906:f148:: with SMTP id gw8mr518331ejb.192.1603964032094; Thu, 29 Oct 2020 02:33:52 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Stefan Hajnoczi , Kevin Wolf , Klaus Jensen , Eric Auger , Max Reitz , Fam Zheng , Keith Busch , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-5.2 v2 08/25] block/nvme: Move definitions before structure declarations Date: Thu, 29 Oct 2020 10:32:49 +0100 Message-Id: <20201029093306.1063879-9-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201029093306.1063879-1-philmd@redhat.com> References: <20201029093306.1063879-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 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) To be able to use some definitions in structure declarations, move them earlier. No logical change. Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- block/nvme.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index e95d59d3126..b0629f5de80 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -41,6 +41,16 @@ =20 typedef struct BDRVNVMeState BDRVNVMeState; =20 +/* Same index is used for queues and IRQs */ +#define INDEX_ADMIN 0 +#define INDEX_IO(n) (1 + n) + +/* This driver shares a single MSIX IRQ for the admin and I/O queues */ +enum { + MSIX_SHARED_IRQ_IDX =3D 0, + MSIX_IRQ_COUNT =3D 1 +}; + typedef struct { int32_t head, tail; uint8_t *queue; @@ -81,15 +91,6 @@ typedef struct { QEMUBH *completion_bh; } NVMeQueuePair; =20 -#define INDEX_ADMIN 0 -#define INDEX_IO(n) (1 + n) - -/* This driver shares a single MSIX IRQ for the admin and I/O queues */ -enum { - MSIX_SHARED_IRQ_IDX =3D 0, - MSIX_IRQ_COUNT =3D 1 -}; - struct BDRVNVMeState { AioContext *aio_context; QEMUVFIOState *vfio; --=20 2.26.2