Skip to content

nvme: dead code cleanups - #15

Open
ghost wants to merge 9 commits into
for-next_basefrom
series/1202635=>for-next
Open

ghost wants to merge 9 commits into
for-next_basefrom
series/1202635=>for-next

Conversation

@ghost

@ghost ghost commented Nov 10, 2026

Copy link
Copy Markdown

Pull request for series with
subject: nvme: dead code cleanups
version: 2
url: https://patchwork.kernel.org/series/1203690/

@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: de52810
series: https://patchwork.kernel.org/series/1203690/
version: 2

@ghost
ghost force-pushed the for-next_base branch from 8c33852 to 18eb5ad Compare November 10, 2026 10:19
Commit fa46c6f ("nvme/pci: move cqe check after device shutdown")
removed the only reader of the NVMEQ_DELETE_ERROR flag, but left the
flag and its two writes behind. Without a reader the flag carries no
state, and nvme_del_cq_end() degenerates to a plain wrapper around
nvme_del_queue_end(), which the SQ deletion path already uses directly.

Remove the flag, its writes, and the now redundant wrapper.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
The seqno field of struct nvme_fc_queue has never been referenced
since it was introduced in commit e399441 ("nvme-fabrics: Add
host support for FC transport"). Drop it.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
The entry list_head of struct nvme_dhchap_queue_context has never been
used since it was introduced in commit f50fff7 ("nvme: implement
In-Band authentication"). Drop it.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
The opts->host check in the NVMF_OPT_HOSTNQN handler can never fire:
options are parsed into a freshly allocated struct, and opts->host is
only assigned after the parsing loop completes. A duplicate hostnqn
option is already silently overridden by the strscpy() into the local
buffer. Remove the dead check.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
The "off" case was copied from fast_io_fail_tmo_show(), but unlike
fast_io_fail_tmo, reconnect_delay is an unsigned int that the option
parser bounds to positive values and that has no off state. The
comparison can only trigger when the raw value 4294967295 is written
through sysfs, which is not a meaningful delay. Drop the case and
the matching sentence in the ABI documentation.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
The fcpreq field of struct nvmet_fc_ls_iod is only ever assigned NULL
and never read, and the ninetypercent field of struct nvmet_fc_tgt_queue
is never referenced as the 90% queue state is recomputed on demand.
Drop both.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
The first entry of nvmet_addr_family[] is never matched: both the
adrfam show and store handlers skip index 0, and the
NVMF_ADDR_FAMILY_PCI type is matched by the "pci" entry further down
the array. Drop the entry and start the iteration at index 0 so the
map no longer needs an explanation for the skipped element.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
In the nvme_admin_set_features and nvme_admin_get_features handlers of
nvmet_passthru_parse_cmd(), every path of the inner switch over the
feature id returns, so the break statement following the switch can
never be reached. Remove them.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
nvmet_pci_epf_delete_sq() calls nvmet_pci_epf_drain_queue() on the
submission queue, but IOD links are only ever added to the completion
queue list, so the SQ list is always empty and the call is a no-op.
Remove it.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: de52810
series: https://patchwork.kernel.org/series/1203690/
version: 2

@ghost
ghost force-pushed the series/1202635=>for-next branch from 01eef8d to 849f93d Compare November 10, 2026 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant