Re: [PATCH 03/17] RDMA/core: Introduce IB_MR_TYPE_PI and ib_alloc_mr_integrity API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 05, 2019 at 01:23:03PM +0200, Max Gurtovoy wrote:
> 
> On 2/5/2019 6:28 AM, Jason Gunthorpe wrote:
> > On Mon, Feb 04, 2019 at 08:26:48PM -0800, Bart Van Assche wrote:
> > > On 2/4/19 9:50 AM, Max Gurtovoy wrote:
> > > > +struct ib_mr *ib_alloc_mr_integrity(struct ib_pd *pd,
> > > > +				    u32 max_num_data_sg,
> > > > +				    u32 max_num_meta_sg)
> > > > +{
> > > > +	struct ib_mr *mr;
> > > > +
> > > > +	if (!pd->device->ops.alloc_mr_integrity)
> > > > +		return ERR_PTR(-EOPNOTSUPP);
> > > > +
> > > > +	if (!max_num_meta_sg)
> > > > +		return ERR_PTR(-EINVAL);
> > > > +
> > > > +	mr = pd->device->ops.alloc_mr_integrity(pd, max_num_data_sg,
> > > > +						max_num_meta_sg);
> > > > +	if (!IS_ERR(mr)) {
> > > > +		mr->device  = pd->device;
> > > > +		mr->pd      = pd;
> > > > +		mr->dm      = NULL;
> > > > +		mr->uobject = NULL;
> > > > +		atomic_inc(&pd->usecnt);
> > > > +		mr->need_inval = false;
> > > > +		mr->res.type = RDMA_RESTRACK_MR;
> > > > +		rdma_restrack_kadd(&mr->res);
> > > > +		mr->type = IB_MR_TYPE_PI;
> > > > +	}
> > > > +
> > > > +	return mr;
> > > > +}
> > > Please use the traditional Linux kernel coding style, namely if (IS_ERR(mr))
> > > return mr; instead of the above.
> > And don't randomly indent some ='s but not others. Just forget about
> > horizontal alignment :(
> > 
> > Jason
> 
> Sure no problem doing that. JFYI, this coding style was taken from
> ib_alloc_mr.

Sure, but when copying the code you have to fix the indenting to match
the new location.

If you are doing the stupid line up the ='s style then you have to
manually go and fix every nearby = sign too.

IHMO just forget about horizontal white space, run your code through
clang-format and just move on.

> I guess we can fix that too in a separate commit.

There is too much of it to fix, just don't make it worse.

Jason




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux