From patchwork Tue Nov 19 12:16:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13879820 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8F4341CFECF; Tue, 19 Nov 2024 12:17:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732018630; cv=none; b=qEmZQuEobpRl6O55EwBOT5guZwtTz4iL6klbxexDf3uwIUDN9pNNMton3knATnJbxfW97+gOzOFuFcolBENuq/Bd3HbzDVf/Fyv/rDPb4TMrbgB1Kppwt+nXBWmk3GiIAWPYd7BhtkWhNrzWdtlp2eM2+5QVsGaFNKglIXZYJj4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732018630; c=relaxed/simple; bh=vnGU4okU53nYgmwOe3httUO+XccGFlcUk+FJra+UCfg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HS/3yCdJvqUD0l4j8QLyPNP8FQuIywSsy7bvPB/tRv+RpsLzc1pRMip1scLK9X1Is1fo56lWCBobY26ui098PZ5/Ym0JriJ8ehaNoNrRk1Z61w51qLn99plCiwChqmjuOPEouGijwDraKcI92H7XL0y53XNk3vkusVZtA2QW2To= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=sli5kFmY; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="sli5kFmY" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=gIxXCn1b8yRUHIv/Q/T8s0ufDNDjaj42bcMFpNpW0/4=; b=sli5kFmYL4O16QWe+uEScUndGZ o93i9baryKF3o2gZbKSCP8ro38uRViFjlN7Kvr0d/KnfhXI0o0p4Uca+xfZDKKVY6ewt7ntD5L2/J vuOEYMQW7YJhZuZ6oAh6vxA6wwT5aOTsC7LSoyEsFl/FcUOlh+HZxxt9RQvVvQcekZIEMWfxtMjdA zIu3O2SUkufdCLhoJtyiDND86643nhgE9Jp7XS6xO8ZwrJ7eaU2HT46BTfrCUZuFTI8goqK6XOGmU /zglOJ2G2sLQCvPjDg3M1gLE2a53aQlzhJrFMdGh4Uj1gihc2kJNKQjEs7CtCBmoBZ+dqF6hKgRJg i06CSJNg==; Received: from 2a02-8389-2341-5b80-1731-a089-d2b1-3edf.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:1731:a089:d2b1:3edf] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.98 #2 (Red Hat Linux)) id 1tDNAJ-0000000CJDT-1zwp; Tue, 19 Nov 2024 12:17:08 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Christian Brauner , Keith Busch , Sagi Grimberg , Kanchan Joshi , Hui Qi , Nitesh Shetty , Jan Kara , Pavel Begunkov , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, io-uring@vger.kernel.org Subject: [PATCH 11/15] nvme: pass a void pointer to nvme_get/set_features for the result Date: Tue, 19 Nov 2024 13:16:25 +0100 Message-ID: <20241119121632.1225556-12-hch@lst.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241119121632.1225556-1-hch@lst.de> References: <20241119121632.1225556-1-hch@lst.de> Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html That allows passing in structures instead of the u32 result, and thus reduce the amount of bit shifting and masking required to parse the result. Signed-off-by: Christoph Hellwig --- drivers/nvme/host/core.c | 4 ++-- drivers/nvme/host/nvme.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index d194b36b08ac..0d058276845b 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1671,7 +1671,7 @@ static int nvme_features(struct nvme_ctrl *dev, u8 op, unsigned int fid, int nvme_set_features(struct nvme_ctrl *dev, unsigned int fid, unsigned int dword11, void *buffer, size_t buflen, - u32 *result) + void *result) { return nvme_features(dev, nvme_admin_set_features, fid, dword11, buffer, buflen, result); @@ -1680,7 +1680,7 @@ EXPORT_SYMBOL_GPL(nvme_set_features); int nvme_get_features(struct nvme_ctrl *dev, unsigned int fid, unsigned int dword11, void *buffer, size_t buflen, - u32 *result) + void *result) { return nvme_features(dev, nvme_admin_get_features, fid, dword11, buffer, buflen, result); diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 9b916a904f00..8cea8416b0d2 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -892,10 +892,10 @@ int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd, int qid, nvme_submit_flags_t flags); int nvme_set_features(struct nvme_ctrl *dev, unsigned int fid, unsigned int dword11, void *buffer, size_t buflen, - u32 *result); + void *result); int nvme_get_features(struct nvme_ctrl *dev, unsigned int fid, unsigned int dword11, void *buffer, size_t buflen, - u32 *result); + void *result); int nvme_set_queue_count(struct nvme_ctrl *ctrl, int *count); void nvme_stop_keep_alive(struct nvme_ctrl *ctrl); int nvme_reset_ctrl(struct nvme_ctrl *ctrl);