Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Tony Battersby
On 08/03/2018 05:07 PM, Matthew Wilcox wrote: > On Fri, Aug 03, 2018 at 02:43:07PM -0400, Tony Battersby wrote: >> Out of curiosity, I just tried to create a dmapool with a NULL dev and >> it crashed on this: >> >> static inline int dev_to_node(struct device *dev) >> { >> return

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Matthew Wilcox
On Fri, Aug 03, 2018 at 02:43:07PM -0400, Tony Battersby wrote: > Out of curiosity, I just tried to create a dmapool with a NULL dev and > it crashed on this: > > static inline int dev_to_node(struct device *dev) > { > return dev->numa_node; > } > > struct dma_pool *dma_pool_create(const

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Douglas Gilbert
On 2018-08-03 02:38 PM, Andy Shevchenko wrote: On Fri, Aug 3, 2018 at 8:03 PM, Tony Battersby wrote: On 08/03/2018 12:22 PM, Matthew Wilcox wrote: On Fri, Aug 03, 2018 at 06:59:20PM +0300, Andy Shevchenko wrote: I'm pretty sure this was created in an order to avoid bad looking (and in some

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Tony Battersby
On 08/03/2018 02:38 PM, Andy Shevchenko wrote: > >> dma_alloc_coherent() does appear to support a NULL dev, so it might make >> sense in theory. But I can't find any in-tree callers that actually >> pass a NULL dev to dma_pool_create(). So for one of the dreaded (NULL >> device *) messages to

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Tony Battersby
On 08/03/2018 01:03 PM, Tony Battersby wrote: > On 08/03/2018 12:22 PM, Matthew Wilcox wrote: >> On Fri, Aug 03, 2018 at 06:59:20PM +0300, Andy Shevchenko wrote: >> I'm pretty sure this was created in an order to avoid bad looking (and >> in some cases frightening) "NULL device *" part.

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Andy Shevchenko
On Fri, Aug 3, 2018 at 8:03 PM, Tony Battersby wrote: > On 08/03/2018 12:22 PM, Matthew Wilcox wrote: >> On Fri, Aug 03, 2018 at 06:59:20PM +0300, Andy Shevchenko wrote: >> I'm pretty sure this was created in an order to avoid bad looking (and >> in some cases frightening) "NULL device *"

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Tony Battersby
On 08/03/2018 12:22 PM, Matthew Wilcox wrote: > On Fri, Aug 03, 2018 at 06:59:20PM +0300, Andy Shevchenko wrote: > I'm pretty sure this was created in an order to avoid bad looking (and > in some cases frightening) "NULL device *" part. >> JFYI: git log --no-merges --grep 'NULL device \*'

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Matthew Wilcox
On Fri, Aug 03, 2018 at 06:59:20PM +0300, Andy Shevchenko wrote: > >>> I'm pretty sure this was created in an order to avoid bad looking (and > >>> in some cases frightening) "NULL device *" part. > > JFYI: git log --no-merges --grep 'NULL device \*' I think those commits actually argue in

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Tony Battersby
On 08/03/2018 12:01 PM, Andy Shevchenko wrote: > On Fri, Aug 3, 2018 at 6:59 PM, Andy Shevchenko > wrote: >> On Fri, Aug 3, 2018 at 6:17 PM, Tony Battersby wrote: >>> But then I decided to simplify it to just use dev_err(). I still have >>> the old version. When I submit v3 of the patchset,

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Andy Shevchenko
On Fri, Aug 3, 2018 at 6:59 PM, Andy Shevchenko wrote: > On Fri, Aug 3, 2018 at 6:17 PM, Tony Battersby wrote: >> But then I decided to simplify it to just use dev_err(). I still have >> the old version. When I submit v3 of the patchset, which would you prefer? > > JFYI: git log --no-merges

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Andy Shevchenko
On Fri, Aug 3, 2018 at 6:17 PM, Tony Battersby wrote: > On 08/03/2018 09:41 AM, Tony Battersby wrote: >> On 08/03/2018 04:56 AM, Andy Shevchenko wrote: >>> On Thu, Aug 2, 2018 at 10:57 PM, Tony Battersby >>> wrote: Remove code duplication in error messages. It is now safe to pas a NULL

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Tony Battersby
On 08/03/2018 09:41 AM, Tony Battersby wrote: > On 08/03/2018 04:56 AM, Andy Shevchenko wrote: >> On Thu, Aug 2, 2018 at 10:57 PM, Tony Battersby >> wrote: >>> Remove code duplication in error messages. It is now safe to pas a NULL >>> dev to dev_err(), so the checks to avoid doing so are no

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Tony Battersby
On 08/03/2018 04:56 AM, Andy Shevchenko wrote: > On Thu, Aug 2, 2018 at 10:57 PM, Tony Battersby wrote: >> Remove code duplication in error messages. It is now safe to pas a NULL >> dev to dev_err(), so the checks to avoid doing so are no longer >> necessary. >> >> Example: >> >> Error message

Re: [PATCH v2 2/9] dmapool: cleanup error messages

2018-08-03 Thread Andy Shevchenko
On Thu, Aug 2, 2018 at 10:57 PM, Tony Battersby wrote: > Remove code duplication in error messages. It is now safe to pas a NULL > dev to dev_err(), so the checks to avoid doing so are no longer > necessary. > > Example: > > Error message with dev != NULL: > mpt3sas :02:00.0:

[PATCH v2 2/9] dmapool: cleanup error messages

2018-08-02 Thread Tony Battersby
Remove code duplication in error messages. It is now safe to pas a NULL dev to dev_err(), so the checks to avoid doing so are no longer necessary. Example: Error message with dev != NULL: mpt3sas :02:00.0: dma_pool_destroy chain pool, (ptrval) busy Same error message with dev ==