From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753326AbdBJQLh (ORCPT ); Fri, 10 Feb 2017 11:11:37 -0500 Received: from mx2.suse.de ([195.135.220.15]:39480 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751959AbdBJQK7 (ORCPT ); Fri, 10 Feb 2017 11:10:59 -0500 Date: Fri, 10 Feb 2017 17:11:22 +0100 From: Joerg Roedel To: Robin Murphy Cc: Joerg Roedel , Will Deacon , Lorenzo Pieralisi , Alex Williamson , David Woodhouse , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface Message-ID: <20170210161122.GB18474@suse.de> References: <1486639981-32368-1-git-send-email-joro@8bytes.org> <1486639981-32368-7-git-send-email-joro@8bytes.org> <417eee8c-4e1b-57f0-2c00-d6c3926ce66d@arm.com> <20170210152254.GI7339@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 10, 2017 at 04:03:07PM +0000, Robin Murphy wrote: > Yeah, on reflection explicit initialisation is certainly easier to read > than a bunch of arguments handled implicitly by register(), but then > from that angle, even more clear would be to simply have the drivers > write the relevant struct members directly - I'd be quite happy with > that, and we then don't have to add another setter to iommu.h for every > new struct member (and risk it looking like Java code...) Yeah, that was my first approach. But there is the Intel VT-d anomaly, where a part of the driver can be built-in (dmar.c) with CONFIG_IOMMU_API=N. In this case 'struct iommu_device' is empty, and trying to access the members directly doesn't compile anymore. I have to look if this anomaly could be removed, then it is probably the best to set the struct members directly without wrapper functions. Joerg From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH 06/11] iommu: Add iommu_device_set_fwnode() interface Date: Fri, 10 Feb 2017 17:11:22 +0100 Message-ID: <20170210161122.GB18474@suse.de> References: <1486639981-32368-1-git-send-email-joro@8bytes.org> <1486639981-32368-7-git-send-email-joro@8bytes.org> <417eee8c-4e1b-57f0-2c00-d6c3926ce66d@arm.com> <20170210152254.GI7339@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Robin Murphy Cc: Will Deacon , iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, David Woodhouse List-Id: iommu@lists.linux-foundation.org On Fri, Feb 10, 2017 at 04:03:07PM +0000, Robin Murphy wrote: > Yeah, on reflection explicit initialisation is certainly easier to read > than a bunch of arguments handled implicitly by register(), but then > from that angle, even more clear would be to simply have the drivers > write the relevant struct members directly - I'd be quite happy with > that, and we then don't have to add another setter to iommu.h for every > new struct member (and risk it looking like Java code...) Yeah, that was my first approach. But there is the Intel VT-d anomaly, where a part of the driver can be built-in (dmar.c) with CONFIG_IOMMU_API=N. In this case 'struct iommu_device' is empty, and trying to access the members directly doesn't compile anymore. I have to look if this anomaly could be removed, then it is probably the best to set the struct members directly without wrapper functions. Joerg