Re: [PATCH rdma-next 1/4] RDMA: Mark if create address handle is in a sleepable context

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

 



On Tue, Dec 11, 2018 at 06:31:09PM +0200, Gal Pressman wrote:
> On 11-Dec-18 18:22, Jason Gunthorpe wrote:
> > On Tue, Dec 11, 2018 at 10:59:25AM +0200, Gal Pressman wrote:
> > 
> >> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> >> index 85021451eee0..499d96302262 100644
> >> +++ b/include/rdma/ib_verbs.h
> >> @@ -2374,6 +2374,7 @@ struct ib_device {
> >>  	int                        (*dealloc_pd)(struct ib_pd *pd);
> >>  	struct ib_ah *             (*create_ah)(struct ib_pd *pd,
> >>  						struct rdma_ah_attr *ah_attr,
> >> +						bool sleepable,
> >>  						struct ib_udata *udata);
> > 
> > I think the Linux style consensus here is that these should be a flag with a
> > enum name not a bool
> 
> Will change.
> I'm familiar with the no bool fields in structs
> (https://lkml.org/lkml/2017/11/21/384), good to know it applies to function
> parameters as well.

I think it is under the rational that

foo(true)

tells the user nothing, while

foo(DO_SOMETHING)

Should be more informative

Same argument applies to 'int' pretending to be bool

At least a struct member has a name..

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