[PATCH 18/20] nvme: move nvme_validate_ns

Christoph Hellwig hch at lst.de
Wed Sep 30 02:13:38 EDT 2020


On Wed, Sep 30, 2020 at 12:22:28AM +0000, Chaitanya Kulkarni wrote:
> > +static int nvme_validate_ns(struct nvme_ns *ns, struct nvme_ns_ids *ids)
> > +{
> > +	struct nvme_ctrl *ctrl = ns->ctrl;
> 
> the ctrl variable only accessed twice and there is enough space for using
> 
> ns->ctrl so that we will not exceed the 80 char, consider removing that
> and using
> 
> ns->ctrl ?
> 
> > +	struct nvme_id_ns *id;
> > +	int ret = 0;
> > +
> 
> no need to initialize ret it is getting overwritten nvme_identify_ns()
> before
> 
> the first access or ret = -ENODEV and return ret on test_bit(NVME_NS_DEAD)
> 
> error case.

This patch is a pure code move.  But I think all of your comments are
taken care of later anyway.



More information about the Linux-nvme mailing list