From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Thu, 04 Jan 2018 08:52:05 +0000 Subject: Re: [PATCH 27/67] dma-direct: add dma address sanity checks Message-Id: <20180104085205.GC3251@lst.de> List-Id: References: <20171229081911.2802-1-hch@lst.de> <20171229081911.2802-28-hch@lst.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Geert Uytterhoeven Cc: Christoph Hellwig , iommu@lists.linux-foundation.org, Linux MIPS Mailing List , linux-ia64@vger.kernel.org, Linux-sh list , sparclinux , Guan Xuetao , Linux-Arch , linux-s390 , linux-c6x-dev@linux-c6x.org, "open list:QUALCOMM HEXAGON..." , the arch/x86 maintainers , arcml , adi-buildroot-devel@lists.sourceforge.net, linux-m68k , patches@groups.riscv.org, "open list:METAG ARCHITECTURE" , linux-arm-kernel@lists.infradead.org, Michal Simek 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.