Re: [PATCH 27/67] dma-direct: add dma address sanity checks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>
- Subject: Re: [PATCH 27/67] dma-direct: add dma address sanity checks
- From: Christoph Hellwig <hch@xxxxxx>
- Date: Thu, 4 Jan 2018 09:52:05 +0100
- Cc: Christoph Hellwig <hch@xxxxxx>, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx, Linux MIPS Mailing List <linux-mips@xxxxxxxxxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx, Linux-sh list <linux-sh@xxxxxxxxxxxxxxx>, sparclinux <sparclinux@xxxxxxxxxxxxxxx>, Guan Xuetao <gxt@xxxxxxxxxxxxxxx>, Linux-Arch <linux-arch@xxxxxxxxxxxxxxx>, linux-s390 <linux-s390@xxxxxxxxxxxxxxx>, linux-c6x-dev@xxxxxxxxxxxxx, "open list:QUALCOMM HEXAGON..." <linux-hexagon@xxxxxxxxxxxxxxx>, the arch/x86 maintainers <x86@xxxxxxxxxx>, arcml <linux-snps-arc@xxxxxxxxxxxxxxxxxxx>, adi-buildroot-devel@xxxxxxxxxxxxxxxxxxxxx, linux-m68k <linux-m68k@xxxxxxxxxxxxxxx>, patches@xxxxxxxxxxxxxxxx, "open list:METAG ARCHITECTURE" <linux-metag@xxxxxxxxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, Michal Simek <monstr@xxxxxxxxx>, Parisc List <linux-parisc@xxxxxxxxxxxxxxx>, Cris <linux-cris-kernel@xxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, alpha <linux-alpha@xxxxxxxxxxxxxxx>, linuxppc-dev@xxxxxxxxxxxxxxxx
- In-reply-to: <CAMuHMdWg3PnTXezMCcr3oGf-83-cjvcj4wGiPk7j2pY1Tgzo9Q@mail.gmail.com>
- References: <20171229081911.2802-1-hch@lst.de> <20171229081911.2802-28-hch@lst.de> <CAMuHMdWg3PnTXezMCcr3oGf-83-cjvcj4wGiPk7j2pY1Tgzo9Q@mail.gmail.com>
- User-agent: Mutt/1.5.17 (2007-11-01)
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]