From patchwork Sat Jul 4 21:30:46 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: 1322942 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AcyF/swf; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 49zlYt2Lp8z9sSJ for ; Sun, 5 Jul 2020 07:38:10 +1000 (AEST) Received: from localhost ([::1]:49026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrprM-00069C-2G for incoming@patchwork.ozlabs.org; Sat, 04 Jul 2020 17:38:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrplH-0003Iy-Jl for qemu-devel@nongnu.org; Sat, 04 Jul 2020 17:31:51 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:40870 helo=us-smtp-delivery-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 1jrplG-00045z-3v for qemu-devel@nongnu.org; Sat, 04 Jul 2020 17:31:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593898309; 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=KMa3yNwCNdnEQnAOsKRyk2u/lQpm0dom4ME9xGYTEfY=; b=AcyF/swf3B8F0rKXxgX+8/ltHAvuXxg+4djbW/azgzBw6Tol6M4FQwJ6lK2Luh8PKSnl4i aGVak0Qmt9tLdeIn3YEOCRrOZ312C+zBY+3IAWaBQzqS0kWZiwqIt0x9U3QJ2+ULWWTuiv eM1P2QBaqsKjchL3b4yUDH0gaHc4Y6A= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-318-PXmjHMfnPO6KtDB4AFy2NA-1; Sat, 04 Jul 2020 17:31:48 -0400 X-MC-Unique: PXmjHMfnPO6KtDB4AFy2NA-1 Received: by mail-wr1-f71.google.com with SMTP id y13so36932363wrp.13 for ; Sat, 04 Jul 2020 14:31:47 -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=KMa3yNwCNdnEQnAOsKRyk2u/lQpm0dom4ME9xGYTEfY=; b=GeJTK+VflWhzCn13lMKAfaRgCJ3NYwGmLXvuRcPPsFO4zx1XL6rfDvhW11iFG3FxFK K18GXygJI6+2h4HG0zSqUpiovHENuiBk+dTHQUAurdNCOI3FmIzsBFB+JsqjtyQ9GkEa tLYe0GHa+5HGxcjt9L5/ljSPmoDRhoL/7SdHwolYwha+5zAPwKE5zkXtf9vk181OaByj xLIqm6d1r0wGQeCSJl0wZ+6P7qg/6In4A7eFaDx3MRFuGp7xLQYhN4p1WsZ35iiAM+9u enQsZTl7hpX+tM2232PSWq2mIcYQEnRt5vW7mSt/MZEDGAmN1FP+UHZcOawafa7TO5XF DcVQ== X-Gm-Message-State: AOAM533V5wMnaERhpxv9zpE12mzIyOCPVuTbWlCnn5erLyqJhx+wqFxt HQIcI4GpNrXBTEdtq5Yu/QQeH5Mk/YLvVPa6wsAcPbsYQfod2DwJJNA1eU4eoyaOsxtiW17LODR SavSWlKGXSA9nmqE= X-Received: by 2002:a1c:7706:: with SMTP id t6mr1700052wmi.3.1593898306661; Sat, 04 Jul 2020 14:31:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzy4n66+oUCV6z6QscLxmjAXBlqtT6LIwTglcpd2ABRnavWmNcU7UAPcpaRzgRlikFbz2CT+g== X-Received: by 2002:a1c:7706:: with SMTP id t6mr1700040wmi.3.1593898306517; Sat, 04 Jul 2020 14:31:46 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id h84sm18654307wme.22.2020.07.04.14.31.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jul 2020 14:31:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v3 11/16] block/nvme: Simplify nvme_init_queue() arguments Date: Sat, 4 Jul 2020 23:30:46 +0200 Message-Id: <20200704213051.19749-12-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200704213051.19749-1-philmd@redhat.com> References: <20200704213051.19749-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.61; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/04 17:28:04 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=_AUTOLEARN 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, Maxim Levitsky , Max Reitz , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.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 9566001ba6..97a63be9d8 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;