From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Mon, 25 Sep 2017 14:51:16 +0200 (CEST) Received: from verein.lst.de ([213.95.11.211]:39910 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S23990493AbdIYMvJ6wnhV (ORCPT ); Mon, 25 Sep 2017 14:51:09 +0200 Received: by newverein.lst.de (Postfix, from userid 2407) id 999D268C4E; Mon, 25 Sep 2017 14:51:07 +0200 (CEST) Date: Mon, 25 Sep 2017 14:51:07 +0200 From: Christoph Hellwig To: Huacai Chen Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , Andrew Morton , Fuxin Zhang , linux-kernel@vger.kernel.org, Ralf Baechle , James Hogan , linux-mips@linux-mips.org, "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, Roland Dreier , Pawel Osciak , Kyungmin Park , Michael Chan , Benjamin Herrenschmidt , Ivan Mikhaylov , Tariq Toukan , Andy Gross , "Mark A . Greer" , Robert Baldyga , stable@vger.kernel.org Subject: Re: [PATCH V7 1/2] dma-mapping: Rework dma_get_cache_alignment() Message-ID: <20170925125107.GC8130@lst.de> References: <1506332766-23966-1-git-send-email-chenhc@lemote.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1506332766-23966-1-git-send-email-chenhc@lemote.com> 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: 60148 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 > index aba7138..e2c5d9e 100644 > --- a/arch/mips/include/asm/dma-mapping.h > +++ b/arch/mips/include/asm/dma-mapping.h > @@ -39,4 +39,6 @@ static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, > #endif > } > > +int mips_get_cache_alignment(struct device *dev); All the other mips generic dma helpers are prefixed mips_dma_* so it might make sense to follow that. Also please don't add arch-local helpers to asm/dma-mapping.h - this is a header used by linux/dma-mapping.h and should not contain implementation details if avoidable. > + dma_get_cache_alignment(NULL)) / mdev->limits.mtt_seg_size; As said before - please don't pass NULL to this function but the proper device, which would be &mdev->pdev->dev in this case for example. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH V7 1/2] dma-mapping: Rework dma_get_cache_alignment() Date: Mon, 25 Sep 2017 14:51:07 +0200 Message-ID: <20170925125107.GC8130@lst.de> References: <1506332766-23966-1-git-send-email-chenhc@lemote.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1506332766-23966-1-git-send-email-chenhc@lemote.com> Sender: linux-kernel-owner@vger.kernel.org To: Huacai Chen Cc: Christoph Hellwig , Marek Szyprowski , Robin Murphy , Andrew Morton , Fuxin Zhang , linux-kernel@vger.kernel.org, Ralf Baechle , James Hogan , linux-mips@linux-mips.org, "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, Roland Dreier , Pawel Osciak , Kyungmin Park , Michael Chan , Benjamin Herrenschmidt , Ivan Mikhaylov , Tariq Toukan , Andy Gross List-Id: linux-scsi@vger.kernel.org > index aba7138..e2c5d9e 100644 > --- a/arch/mips/include/asm/dma-mapping.h > +++ b/arch/mips/include/asm/dma-mapping.h > @@ -39,4 +39,6 @@ static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, > #endif > } > > +int mips_get_cache_alignment(struct device *dev); All the other mips generic dma helpers are prefixed mips_dma_* so it might make sense to follow that. Also please don't add arch-local helpers to asm/dma-mapping.h - this is a header used by linux/dma-mapping.h and should not contain implementation details if avoidable. > + dma_get_cache_alignment(NULL)) / mdev->limits.mtt_seg_size; As said before - please don't pass NULL to this function but the proper device, which would be &mdev->pdev->dev in this case for example.