From patchwork Wed Aug 12 18:50:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 11711155 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6963A1392 for ; Wed, 12 Aug 2020 18:57:47 +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 3EBE220774 for ; Wed, 12 Aug 2020 18:57:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="WtWqE9Q8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3EBE220774 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:55560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5vwY-0005cu-E7 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 12 Aug 2020 14:57:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5vqK-0001Gl-J0 for qemu-devel@nongnu.org; Wed, 12 Aug 2020 14:51:20 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:23404 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k5vqI-0004iA-Sc for qemu-devel@nongnu.org; Wed, 12 Aug 2020 14:51:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1597258278; 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=1c0lJvpK3LQRvY2kqrmfHIQ8FCfpX6rfitS2IFNbV54=; b=WtWqE9Q8wpQVAmZv226uHe+uFGk1rwTVnZSTktpWAv07xJ27kXg7UYdXRlBs0wBwxdmtFX ZYo37V94olmO7OdlgrMsECGKbND7he516s4UbcElbQhbZENd9MkLN7fLRoAYTzVrf+KgEn UOKYn8EfXn39TILpXTe0deU2PbzqgCE= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-564-hjJjLtpGNSqmbayq0c98xg-1; Wed, 12 Aug 2020 14:51:14 -0400 X-MC-Unique: hjJjLtpGNSqmbayq0c98xg-1 Received: by mail-wm1-f71.google.com with SMTP id f74so1220142wmf.1 for ; Wed, 12 Aug 2020 11:51:14 -0700 (PDT) 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=1c0lJvpK3LQRvY2kqrmfHIQ8FCfpX6rfitS2IFNbV54=; b=XJcQAK8IvsIXuS0zkcsnXGW+8iqSqAUaY/ZCI0IeE4fL6mZJaMKbEnSvjCu2LJPkfN 69QO3q1+MFFYfOsyZ8zpZCUyfeCFZhUKeuz9VIuqx12lFAR5FNCqBQ5XG6SRgQeLL2w7 MexAyG5Kehqs12qTkoZfhoZtjLlm4rCazeKy5No/Hn3FJl8JFrnrixnJiyCxVFeJfzLV mU1/mvOQwFQ2o4ulH7BzcXKHraGAcXHYsW1GpINHqs2iwFhjtC+hzTHC4HeArdIkF2rT 8WCGshRJqc2hM+pwZs8cm5qY6H5YYdRFfObQU32HmGPL9PkzCyW8c5GUFgzEW4o1mLN6 1wRw== X-Gm-Message-State: AOAM530kH9AezYiXV9Ey4znfneeOOeRp9meoW8MGIMzfs8eITlzZaDgB r8tVwVFq5leX8EIBNgPuDKUTfVP30tA9sAF5XZ3rThO4zLViNkvXxOFcf3ckjUP6vfOpUqWJIKH Sqx02LxZdUuy+M5A= X-Received: by 2002:adf:9ed1:: with SMTP id b17mr530641wrf.140.1597258273250; Wed, 12 Aug 2020 11:51:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEwHjyRSmbEFbSW/Ujtw+7gf/dXCLUhnyRHL928yQQcPRG26+47SEB4svlVlTeAWO0kwdJKA== X-Received: by 2002:adf:9ed1:: with SMTP id b17mr530625wrf.140.1597258273058; Wed, 12 Aug 2020 11:51:13 -0700 (PDT) Received: from x1w.redhat.com (121.red-81-40-121.staticip.rima-tde.net. [81.40.121.121]) by smtp.gmail.com with ESMTPSA id x2sm6106118wrg.73.2020.08.12.11.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2020 11:51:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 11/14] block/nvme: Simplify nvme_init_queue() arguments Date: Wed, 12 Aug 2020 20:50:11 +0200 Message-Id: <20200812185014.18267-12-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200812185014.18267-1-philmd@redhat.com> References: <20200812185014.18267-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 Received-SPF: pass client-ip=205.139.110.120; envelope-from=philmd@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/12 10:32:11 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=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, Max Reitz , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" nvme_init_queue() doesn't require BlockDriverState anymore. Replace it by BDRVNVMeState to simplify. Reviewed-by: Stefan Hajnoczi Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index f180078e78..5b69fc75a6 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -165,10 +165,9 @@ static QemuOptsList runtime_opts = { }, }; -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 = bs->opaque; size_t bytes; int r; @@ -251,14 +250,14 @@ static NVMeQueuePair *nvme_create_queue_pair(BlockDriverState *bs, req->prp_list_iova = prp_list_iova + i * s->page_size; } - 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 = &s->regs->doorbells[idx * 2 * s->doorbell_scale]; - 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;