nvme: remove nssa from struct nvme_ctrl
authorKeith Busch <kbusch@kernel.org>
Tue, 15 Feb 2022 15:37:19 +0000 (07:37 -0800)
committerChristoph Hellwig <hch@lst.de>
Mon, 28 Feb 2022 11:45:06 +0000 (13:45 +0200)
The reported number of streams is not used outside the function that
gets it, so no need to stash it in the controller structure. Use a local
variable instead.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h

index 1ce579d583c064ff773b9ca69e1711085252a0d8..9cffc4770e737a9de611f1600664c133187e22a3 100644 (file)
@@ -790,6 +790,7 @@ static int nvme_get_stream_params(struct nvme_ctrl *ctrl,
 static int nvme_configure_directives(struct nvme_ctrl *ctrl)
 {
        struct streams_directive_params s;
+       u16 nssa;
        int ret;
 
        if (!(ctrl->oacs & NVME_CTRL_OACS_DIRECTIVES))
@@ -805,16 +806,16 @@ static int nvme_configure_directives(struct nvme_ctrl *ctrl)
        if (ret)
                goto out_disable_stream;
 
-       ctrl->nssa = le16_to_cpu(s.nssa);
-       if (ctrl->nssa < BLK_MAX_WRITE_HINTS - 1) {
+       nssa = le16_to_cpu(s.nssa);
+       if (nssa < BLK_MAX_WRITE_HINTS - 1) {
                dev_info(ctrl->device, "too few streams (%u) available\n",
-                                       ctrl->nssa);
+                                       nssa);
                /* this condition is not an error: streams are optional */
                ret = 0;
                goto out_disable_stream;
        }
 
-       ctrl->nr_streams = min_t(u16, ctrl->nssa, BLK_MAX_WRITE_HINTS - 1);
+       ctrl->nr_streams = min_t(u16, nssa, BLK_MAX_WRITE_HINTS - 1);
        dev_info(ctrl->device, "Using %u streams\n", ctrl->nr_streams);
        return 0;
 
index 4ce48203e63f85d3337894bfe064cc4424c5ed42..587d92df118b7e0acfe9e1391b4c2fe70f1f84d5 100644 (file)
@@ -280,7 +280,6 @@ struct nvme_ctrl {
        u16 crdt[3];
        u16 oncs;
        u16 oacs;
-       u16 nssa;
        u16 nr_streams;
        u16 sqsize;
        u32 max_namespaces;