From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Thu, 04 Jan 2018 09:52:12 +0100 (CET) Received: from verein.lst.de ([213.95.11.211]:37928 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23990418AbeADIwFt30dB (ORCPT ); Thu, 4 Jan 2018 09:52:05 +0100 Received: by newverein.lst.de (Postfix, from userid 2407) id 5C80568C8A; Thu, 4 Jan 2018 09:52:05 +0100 (CET) Date: Thu, 4 Jan 2018 09:52:05 +0100 From: Christoph Hellwig 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 , Parisc List , Cris , Linux Kernel Mailing List , alpha , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH 27/67] dma-direct: add dma address sanity checks Message-ID: <20180104085205.GC3251@lst.de> References: <20171229081911.2802-1-hch@lst.de> <20171229081911.2802-28-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Return-Path: X-Envelope-To: <"|/home/ecartis/ecartis -s linux-mips"> (uid 0) X-Orcpt: rfc822;linux-mips@linux-mips.org Original-Recipient: rfc822;linux-mips@linux-mips.org X-archive-position: 61897 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: hch@lst.de Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips 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.