[PATCH 1/5] nvme: rename nvme_validate_or_alloc_ns to nvme_scan_ns

Joel Granados j.granados at samsung.com
Tue Jul 19 06:07:05 PDT 2022


On Mon, Jul 18, 2022 at 07:24:59AM +0200, Christoph Hellwig wrote:
> This shorter name much better fits what this function does in
> the scanning process.
> 
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> Reviewed-by: Javier González <javier.gonz at samsung.com>
> Reviewed-by: Sagi Grimberg <sagi at grimberg.me>
> Reviewed-by: Kanchan Joshi <joshi.k at samsung.com>
> Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>
> ---
>  drivers/nvme/host/core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index eabffbc708cd9..88b14fbb7a5a8 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -4283,7 +4283,7 @@ static void nvme_validate_ns(struct nvme_ns *ns, struct nvme_ns_ids *ids)
>  		nvme_ns_remove(ns);
>  }
>  
> -static void nvme_validate_or_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid)
> +static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid)
>  {
>  	struct nvme_ns_ids ids = { };
>  	struct nvme_id_ns_cs_indep *id;
> @@ -4391,7 +4391,7 @@ static int nvme_scan_ns_list(struct nvme_ctrl *ctrl)
>  
>  			if (!nsid)	/* end of the list? */
>  				goto out;
> -			nvme_validate_or_alloc_ns(ctrl, nsid);
> +			nvme_scan_ns(ctrl, nsid);
>  			while (++prev < nsid)
>  				nvme_ns_remove_by_nsid(ctrl, prev);
>  		}
> @@ -4414,7 +4414,7 @@ static void nvme_scan_ns_sequential(struct nvme_ctrl *ctrl)
>  	kfree(id);
>  
>  	for (i = 1; i <= nn; i++)
> -		nvme_validate_or_alloc_ns(ctrl, i);
> +		nvme_scan_ns(ctrl, i);
>  
>  	nvme_remove_invalid_namespaces(ctrl, nn);
>  }

Great change to increase readability! I was confused at why it was named
like that in the first place.

LGTM

Reviewed-by: Joel Granados <j.granados at samsung.com>
> -- 
> 2.30.2
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20220719/6ccf36f8/attachment-0001.sig>


More information about the Linux-nvme mailing list