[PATCH 1/2] nvme-core: remove redundant condition in nvme_ns_head_multipath
Jens Axboe
axboe at kernel.dk
Thu May 18 19:12:23 PDT 2023
On 5/18/23 4:10?PM, Irvin Cote wrote:
> head->disk implies IS_ENABLED(CONFIG_NVME_MULTIPATH) (c.f
> nvme_mpath_alloc_disk) hence the condition is redundant.
>
> Signed-off-by: Irvin Cote <irvincoteg at gmail.com>
> ---
> drivers/nvme/host/nvme.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
> index bf46f122e9e1..7820e40cdce4 100644
> --- a/drivers/nvme/host/nvme.h
> +++ b/drivers/nvme/host/nvme.h
> @@ -453,7 +453,7 @@ struct nvme_ns_head {
>
> static inline bool nvme_ns_head_multipath(struct nvme_ns_head *head)
> {
> - return IS_ENABLED(CONFIG_NVME_MULTIPATH) && head->disk;
> + return head->disk;
> }
Might not matter for this case, but this changes something that'd
compile away for !CONFIG_NVME_MULTIPATH to now needing to read
disk->head instead. That doesn't seem like a good change.
--
Jens Axboe
More information about the Linux-nvme
mailing list