Re: [PATCH rdma-next v6 3/8] RDMA/restrack: Add general infrastructure to track RDMA resources

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

 



On Thu, Jan 25, 2018 at 11:39:59AM -0500, Doug Ledford wrote:
> On Thu, 2018-01-25 at 17:12 +0200, Leon Romanovsky wrote:
> > +       if (rdma_restrack_init(&device->res)) {
> > +               kfree(device);
> > +               return NULL;
> > +       }
> > +
>
> [ snip ]
>
> > +int rdma_restrack_init(struct rdma_restrack_root *res)
> > +{
> > +       init_rwsem(&res->rwsem);
> > +       return 0;
> > +}
> > +
>
> Is there a reason you are doing it this way?  Right now, the init can't
> fail and the test for failure is a no-op.  I looked through the
> remaining patches and nothing in this patchset changes that (at least
> that I caught).  Is there a future intent here?  If so, I can see
> leaving this as is (although if there is a respin, fixing it and then
> changing it back when you add the actual failure opportunity would make
> sense).  But, if not, the init function should be void and there should
> be no failure test when calling it.

I don't use the returned value, it is leftover.

>
> --
> Doug Ledford <dledford@xxxxxxxxxx>
>     GPG KeyID: B826A3330E572FDD
>     Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD


Attachment: signature.asc
Description: PGP signature


[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