lkml.org 
[lkml]   [2019]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] dma-mapping: Protect dma_addressing_limited against NULL dma_mask
From
Date
Hi Christoph,

On 7/22/19 5:26 PM, Christoph Hellwig wrote:
>> static inline bool dma_addressing_limited(struct device *dev)
>> {
>> - return min_not_zero(*dev->dma_mask, dev->bus_dma_mask) <
>> - dma_get_required_mask(dev);
>> + return WARN_ON_ONCE(!dev->dma_mask) ? false :
>> + min_not_zero(*dev->dma_mask, dev->bus_dma_mask) <
>> + dma_get_required_mask(dev);
>
> This should really use a separate if statement, but I can fix that
> up when applying it.
>
Just wondering why we don't use the dma_get_mask() accessor which
returns DMA_BIT_MASK(32) in case the dma_mask is not set.

Do you foresee any issue and would it still mandate to add dma_mask
checks on each call sites?

Thanks

Eric

\
 
 \ /
  Last update: 2019-07-22 17:46    [W:0.053 / U:1.672 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site