Skip to content

Commit 0a9f850

Browse files
keithbuschChristoph Hellwig
authored andcommitted
nvme: remove nssa from struct nvme_ctrl
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 <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 1c3adf0 commit 0a9f850

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/nvme/host/core.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ static int nvme_get_stream_params(struct nvme_ctrl *ctrl,
790790
static int nvme_configure_directives(struct nvme_ctrl *ctrl)
791791
{
792792
struct streams_directive_params s;
793+
u16 nssa;
793794
int ret;
794795

795796
if (!(ctrl->oacs & NVME_CTRL_OACS_DIRECTIVES))
@@ -805,16 +806,16 @@ static int nvme_configure_directives(struct nvme_ctrl *ctrl)
805806
if (ret)
806807
goto out_disable_stream;
807808

808-
ctrl->nssa = le16_to_cpu(s.nssa);
809-
if (ctrl->nssa < BLK_MAX_WRITE_HINTS - 1) {
809+
nssa = le16_to_cpu(s.nssa);
810+
if (nssa < BLK_MAX_WRITE_HINTS - 1) {
810811
dev_info(ctrl->device, "too few streams (%u) available\n",
811-
ctrl->nssa);
812+
nssa);
812813
/* this condition is not an error: streams are optional */
813814
ret = 0;
814815
goto out_disable_stream;
815816
}
816817

817-
ctrl->nr_streams = min_t(u16, ctrl->nssa, BLK_MAX_WRITE_HINTS - 1);
818+
ctrl->nr_streams = min_t(u16, nssa, BLK_MAX_WRITE_HINTS - 1);
818819
dev_info(ctrl->device, "Using %u streams\n", ctrl->nr_streams);
819820
return 0;
820821

drivers/nvme/host/nvme.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ struct nvme_ctrl {
280280
u16 crdt[3];
281281
u16 oncs;
282282
u16 oacs;
283-
u16 nssa;
284283
u16 nr_streams;
285284
u16 sqsize;
286285
u32 max_namespaces;

0 commit comments

Comments
 (0)