Re: [PATCH rdma-next v4 8/9] RDMA/nldev: Share with user-space object IDs

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

 



On Wed, Feb 06, 2019 at 07:55:08PM +0200, Leon Romanovsky wrote:

> > Is there some reason this isn't just written as
> >
> >   ret = nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_CM_IDN, rdma_res_to_id(res));
> >   if (ret)
> >          return ret;
> >
> > ?
> 
> Yes, in next patch, I'm filling parent ID in that function.

I didn't notice any common code for the parent ID either, so same question
still applies..

> > I'm confused why we jump to a case statement when every caller in this
> > patch seems to already know what type it is.
> 
> I did it to localize all changes of IDs in one place.

Doesn't seem like a good approach to me - adding switch where no
switch is needed is convoluted

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