On Tue, 2018-04-24 at 16:58 +0200, Roman Pen wrote: > +void ib_pool_dev_init(enum ib_pd_flags pd_flags, > + struct ib_pool_device *(*alloc)(void), > + void (*free)(struct ib_pool_device *), > + int (*init)(struct ib_pool_device *), > + struct ib_device_pool *pool) > +{ > + INIT_LIST_HEAD(&pool->list); > + mutex_init(&pool->mutex); > + > + pool->pd_flags = pd_flags; > + > + BUG_ON(!alloc ^ !free); Most of this file looks generally OK, but this is a hard No. No new BUG_ON()s in any code unless it truly is a machine ending event where stopping is better than corrupting. That's not the case here, this was just used as a lazy means of not doing a graceful failure during early prototype. I get that. But it's got to go before this patch can even be considered. -- Doug Ledford <dledford@xxxxxxxxxx> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
Attachment:
signature.asc
Description: This is a digitally signed message part