Re: [PATCH] dma-mapping: remove an unnecessary NULL check

2019-04-25 Thread Ian Abbott
On 24/04/2019 15:27, Christoph Hellwig wrote: On Wed, Apr 24, 2019 at 05:24:37PM +0300, Dan Carpenter wrote: We already dereferenced "dev" when we called get_dma_ops() so this NULL check is too late. We're not supposed to pass NULL "dev" pointers to dma_alloc_attrs(). Thanks, applied to the d

Re: [PATCH] dma-mapping: remove an unnecessary NULL check

2019-04-25 Thread Ian Abbott
On 25/04/2019 15:18, Christoph Hellwig wrote: On Thu, Apr 25, 2019 at 03:13:49PM +0100, Ian Abbott wrote: So for comedi_isadma, we can just replace the NULL with a pointer to a static dummy device with a 24-bit coherent mask? It should be converted to a proper isa_driver, so that it gets a rea

Re: [PATCH] dma-mapping: remove an unnecessary NULL check

2019-04-25 Thread Christoph Hellwig
On Thu, Apr 25, 2019 at 03:31:01PM +0100, Ian Abbott wrote: > On 25/04/2019 15:18, Christoph Hellwig wrote: >> On Thu, Apr 25, 2019 at 03:13:49PM +0100, Ian Abbott wrote: >>> So for comedi_isadma, we can just replace the NULL with a pointer to a >>> static dummy device with a 24-bit coherent mask?

Re: [PATCH] dma-mapping: remove an unnecessary NULL check

2019-04-25 Thread Christoph Hellwig
On Thu, Apr 25, 2019 at 03:13:49PM +0100, Ian Abbott wrote: > So for comedi_isadma, we can just replace the NULL with a pointer to a > static dummy device with a 24-bit coherent mask? It should be converted to a proper isa_driver, so that it gets a real struct device.

Re: [PATCH] dma-mapping: remove an unnecessary NULL check

2019-04-24 Thread Christoph Hellwig
On Wed, Apr 24, 2019 at 05:24:37PM +0300, Dan Carpenter wrote: > We already dereferenced "dev" when we called get_dma_ops() so this NULL > check is too late. We're not supposed to pass NULL "dev" pointers to > dma_alloc_attrs(). Thanks, applied to the dma-mapping for-next tree. > Signed-off-by:

[PATCH] dma-mapping: remove an unnecessary NULL check

2019-04-24 Thread Dan Carpenter
We already dereferenced "dev" when we called get_dma_ops() so this NULL check is too late. We're not supposed to pass NULL "dev" pointers to dma_alloc_attrs(). Signed-off-by: Dan Carpenter --- There are still at least two drivers which do pass a NULL unfortunately. drivers/staging/comedi/driver