nvme: pass a void pointer to nvme_get/set_features for the result
authorChristoph Hellwig <hch@lst.de>
Tue, 6 May 2025 12:17:29 +0000 (17:47 +0530)
committerJens Axboe <axboe@kernel.dk>
Tue, 6 May 2025 13:46:43 +0000 (07:46 -0600)
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.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Link: https://lore.kernel.org/r/20250506121732.8211-9-joshi.k@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h

index 0d834ca606d9923bed2d0df647f03c665793dc8a..dd71b4c2b7b755ebf17372803cba56d93900d781 100644 (file)
@@ -1676,7 +1676,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);
@@ -1685,7 +1685,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);
index 51e07864212710d8d0abca707b6afa89757094c1..aedb734283b8c23887a7a699348353de2ba1c480 100644 (file)
@@ -896,10 +896,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);