From nobody Mon Feb 9 09:43:16 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=1599136145; cv=none; d=zohomail.com; s=zohoarc; b=LbLjRXUuGM8oO3wrv9t5ypIarJsPHZCGHsXIHBAYJ2O8oA9XvAvS+rGLe03QfA+TmaqM3JWZD2W/h3k/dcIoVo2S/wlrkgwjiyaOncwEr3FoGUdY/9r/HLt2LEN3EtoXw9DRh6QXFT2dLwDGYzRaix0mA3H7ed0Ct36a150/4no= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599136145; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=UCjqLrpq3STI/zR0Jd2dpzbux+828cWdkCvReZKkRjw=; b=MLMLEvwlamqmKFJ14pLfVV5fPlBfQ74BGWhTCvM09LQLKk6YMHTnKXcdSPKLVZNlD0AbkFv39PfWx1o2UwbF4z/1y5UVG2iNQ8/QnWAz3Ul5XDHdNbg2unWo5R0KSJpJBWe4Urzly2l5+R8xmgx2l/GQj2g+enASsW44OVKVsDc= 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 1599136145389485.1188829063026; Thu, 3 Sep 2020 05:29:05 -0700 (PDT) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-87-Qm1G3sNSNiG-Zursm4XIxA-1; Thu, 03 Sep 2020 08:29:00 -0400 Received: by mail-wr1-f72.google.com with SMTP id k11so1015624wrw.16 for ; Thu, 03 Sep 2020 05:29:00 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (50.red-83-52-54.dynamicip.rima-tde.net. [83.52.54.50]) by smtp.gmail.com with ESMTPSA id 31sm4270787wrd.26.2020.09.03.05.28.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 05:28:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599136144; 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=UCjqLrpq3STI/zR0Jd2dpzbux+828cWdkCvReZKkRjw=; b=UNxuMxjqQJ9QSsqeanC+3H3h8MarnINVrakUslpePIBAotKqSw713VQoGRjaDaLkWQ8bbq 6MSrSsy7JEpr+3GitV2Hlsj0bbBPZ0kL9i7oULXlJb3Z76DtlImiz3kZPRS7ErwfucGvbR LdCMPHlRUYizs8TP/rDChrnQZ+3MrCE= X-MC-Unique: Qm1G3sNSNiG-Zursm4XIxA-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=UCjqLrpq3STI/zR0Jd2dpzbux+828cWdkCvReZKkRjw=; b=HtCZOH8GkbWEdphyfzQivawANhRrE/9YtrO5rTXttxD1WbRcLYud1JsHMLVdi4iwq+ ttUcLp16Z7YhwC++HQHCGie/mTbajynJ8777stZbXA/syVDW7EpziHrOD6vAqk1Jh4rX UPqzLgt+Ry1GJfrSHiYAXrSEk1OW1egGbwmiHLVz0v9nZW2kboTNYJhGjwkyTlxEqSzd JrqLJmq4Dg4zbOpPJM1kpPdyE07hM8Bf+pOElwEfKpnUXVkP8jOoHgHwe7EgDUmx061M UNzUvesYJIFFknp1i9ztOCN206uWf3Dw0e8yv47AjLtvC908KEek98yD2fPC/+rt/N7C uPBQ== X-Gm-Message-State: AOAM530QqHiYFXkGS4R/UNmifAr46ITeenrNvtB0SIHGF1Sajiw69yTC V7hxZg1gZ9sJH1ANc5l5zez8KdN8zPFTQ9N/NWKQu4STrCnjRZtId3r22ZnkfQVTx5MdTuz/a7S VFVNm68y95CL8bg== X-Received: by 2002:a05:600c:210c:: with SMTP id u12mr2405995wml.185.1599136139208; Thu, 03 Sep 2020 05:28:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8hFE3CvHTi9Py94SC3XSsO9X1tDGI99PWFdfkU8QM5rLUDH1IojgEtK0eXq5W6MfXjO6VSA== X-Received: by 2002:a05:600c:210c:: with SMTP id u12mr2405983wml.185.1599136139051; Thu, 03 Sep 2020 05:28:59 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Klaus Jensen , Fam Zheng , Max Reitz , Keith Busch , Kevin Wolf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Stefano Garzarella Subject: [PATCH v7 11/15] block/nvme: Simplify nvme_init_queue() arguments Date: Thu, 3 Sep 2020 14:27:59 +0200 Message-Id: <20200903122803.405265-12-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200903122803.405265-1-philmd@redhat.com> References: <20200903122803.405265-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 X-ZohoMail-DKIM: pass (identity @redhat.com) nvme_init_queue() doesn't require BlockDriverState anymore. Replace it by BDRVNVMeState to simplify. Reviewed-by: Stefan Hajnoczi Reviewed-by: Stefano Garzarella Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- block/nvme.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 0c8ad1d60b6..e04e1fa4f8f 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -165,10 +165,9 @@ static QemuOptsList runtime_opts =3D { }, }; =20 -static void nvme_init_queue(BlockDriverState *bs, NVMeQueue *q, +static void nvme_init_queue(BDRVNVMeState *s, NVMeQueue *q, int nentries, int entry_bytes, Error **errp) { - BDRVNVMeState *s =3D bs->opaque; size_t bytes; int r; =20 @@ -251,14 +250,14 @@ static NVMeQueuePair *nvme_create_queue_pair(BlockDri= verState *bs, req->prp_list_iova =3D prp_list_iova + i * s->page_size; } =20 - nvme_init_queue(bs, &q->sq, size, NVME_SQ_ENTRY_BYTES, &local_err); + nvme_init_queue(s, &q->sq, size, NVME_SQ_ENTRY_BYTES, &local_err); if (local_err) { error_propagate(errp, local_err); goto fail; } q->sq.doorbell =3D &s->regs->doorbells[idx * 2 * s->doorbell_scale]; =20 - nvme_init_queue(bs, &q->cq, size, NVME_CQ_ENTRY_BYTES, &local_err); + nvme_init_queue(s, &q->cq, size, NVME_CQ_ENTRY_BYTES, &local_err); if (local_err) { error_propagate(errp, local_err); goto fail; --=20 2.26.2