lkml.org 
[lkml]   [2015]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v5 1/2] usb: make xhci platform driver use 64 bit or 32 bit DMA
Date
On Wednesday 19 August 2015 14:28:33 Duc Dang wrote:
>
> Hi Arnd,
>
> So the check will look like this, please let me know what do you think:
> if (!pdev->dev.dma_mask) {
> WARN_ON(1);
> /* Initialize dma_mask if the broken platform code has
> not done so */
> pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
> }

The condition can be written as

if (WARN_ON(!pdev->dev.dma_mask))

and I'd use dma_coerce_mask_and_coherent() instead of manually setting the
pointer, as an annotation for the fact that we are knowingly violating the
API here.

Those two points are just cosmetic though, aside from them, your code
above is what I had in mind.

Thanks,

Arnd


\
 
 \ /
  Last update: 2015-08-20 15:41    [W:0.305 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site