lkml.org 
[lkml]   [2018]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 27/67] dma-direct: add dma address sanity checks
On Fri, Dec 29, 2017 at 03:12:25PM +0100, Geert Uytterhoeven wrote:
> > +check_addr(struct device *dev, dma_addr_t dma_addr, size_t size,
> > + const char *caller)
> > +{
> > + if (unlikely(dev && !dma_capable(dev, dma_addr, size))) {
> > + if (*dev->dma_mask >= DMA_BIT_MASK(32)) {
> > + dev_err(dev,
> > + "%s: overflow %llx+%zu of device mask %llx\n",
>
> Please use "%pad" to format dma_addr_t ...
>
> > + caller, (long long)dma_addr, size,
>
> ... and use &dma_addr.
>
> > + (long long)*dev->dma_mask);
>
> This cast is not needed, as u64 is unsigned long long in kernelspace on
> all architectures.

Thanks, fixed.

\
 
 \ /
  Last update: 2018-01-04 09:52    [W:0.098 / U:0.100 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site