[PATCH v4 4/8] nvme-rdma: use rdma connection reject helper functions

Steve Wise swise at opengridcomputing.com
Wed Oct 26 09:17:23 PDT 2016


> 
> On 10/25/2016 12:34 PM, Steve Wise wrote:
> > +	rej_data = (struct nvme_rdma_cm_rej *)
> > +		   rdma_consumer_reject_data(cm_id, ev, &rej_data_len);
> 
> This cast casts away constness; that's ugly. If the data type of
> rej_data would be changed into const ... * then no cast would have been
> necessary.
>

Ok.
 
> > +	if (rej_data && rej_data_len >= sizeof(u16)) {
> > +		u16 sts = le16_to_cpu(rej_data->sts);
> >
> >  		dev_err(queue->ctrl->ctrl.device,
> > -			"Connect rejected, status %d.", le16_to_cpu(rej-
> >sts));
> > -		/* XXX: Think of something clever to do here... */
> > -	} else {
> > +		      "Connect rejected: status %d (%s) nvme status %d
> (%s).\n",
> > +		      status, rej_msg, sts, nvme_rdma_cm_msg(sts));
> > +	} else
> >  		dev_err(queue->ctrl->ctrl.device,
> > -			"Connect rejected, no private data.\n");
> > -	}
> > +			"Connect rejected: status %d (%s).\n", status,
> rej_msg);
> 
> Braces are not balanced for this if-then-else statement :-(
> 
> If you have to resend this patch series please address these comments.
> 

Sure, I'll spin another version with these changes.  This is destined for
4.10 so we have time. :)

Thanks for reviewing!






More information about the Linux-nvme mailing list