Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757903AbcDELZo (ORCPT ); Tue, 5 Apr 2016 07:25:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:59963 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754403AbcDELZm (ORCPT ); Tue, 5 Apr 2016 07:25:42 -0400 Date: Tue, 5 Apr 2016 13:25:36 +0200 From: Joerg Roedel To: Arnd Bergmann Cc: Yong Wu , Robin Murphy , Matthias Brugger , Alex Williamson , Will Deacon , Magnus Damm , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH] iommu: provide of_xlate pointer unconditionally Message-ID: <20160405112536.GB4203@suse.de> References: <1458077877-474066-1-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458077877-474066-1-git-send-email-arnd@arndb.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1162 Lines: 23 On Tue, Mar 15, 2016 at 10:37:17PM +0100, Arnd Bergmann wrote: > iommu drivers that support the standard DT bindings use a of_xlate > callback pointer, but that is only part of struct iommu_ops when > CONFIG_OF_IOMMU is enabled, leading to build errors in randconfig > builds when that is not provided: > > drivers/iommu/mtk_iommu.c:497:2: error: unknown field 'of_xlate' specified in initializer > .of_xlate = mtk_iommu_of_xlate, > ^ > drivers/iommu/mtk_iommu.c:497:14: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] > .of_xlate = mtk_iommu_of_xlate, > ^~~~~~~~~~~~~~~~~~ > drivers/iommu/mtk_iommu.c:497:14: note: (near initialization for 'mtk_iommu_ops.domain_get_attr') > > We can work around it by adding more #ifdefs in each driver, but > it seems nicer to just allow setting the pointer even if it is > unused. This makes the driver code look nicer, and it gives better > compile-time coverage when test building on other architectures. > > Signed-off-by: Arnd Bergmann > Fixes: 0df4fabe208d ("iommu/mediatek: Add mt8173 IOMMU driver") Applied to iommu/fixes, thanks Arnd.