From patchwork Wed Sep 7 15:41:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 1127672 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p87GdWX5031396 for ; Wed, 7 Sep 2011 16:39:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753054Ab1IGQi5 (ORCPT ); Wed, 7 Sep 2011 12:38:57 -0400 Received: from va3ehsobe002.messaging.microsoft.com ([216.32.180.12]:40601 "EHLO VA3EHSOBE002.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751502Ab1IGQ3O (ORCPT ); Wed, 7 Sep 2011 12:29:14 -0400 Received: from mail55-va3-R.bigfish.com (10.7.14.245) by VA3EHSOBE002.bigfish.com (10.7.40.22) with Microsoft SMTP Server id 14.1.225.22; Wed, 7 Sep 2011 15:42:11 +0000 Received: from mail55-va3 (localhost.localdomain [127.0.0.1]) by mail55-va3-R.bigfish.com (Postfix) with ESMTP id 80B9916900B6; Wed, 7 Sep 2011 15:42:11 +0000 (UTC) X-SpamScore: 1 X-BigFish: VPS1(zzzz1202hzz8275bhz32i668h839h63h) X-Spam-TCS-SCL: 2:0 X-Forefront-Antispam-Report: CIP:163.181.249.108; KIP:(null); UIP:(null); IPVD:NLI; H:ausb3twp01.amd.com; RD:none; EFVD:NLI Received: from mail55-va3 (localhost.localdomain [127.0.0.1]) by mail55-va3 (MessageSwitch) id 1315410131274086_482; Wed, 7 Sep 2011 15:42:11 +0000 (UTC) Received: from VA3EHSMHS018.bigfish.com (unknown [10.7.14.242]) by mail55-va3.bigfish.com (Postfix) with ESMTP id 2EC021BF0046; Wed, 7 Sep 2011 15:42:11 +0000 (UTC) Received: from ausb3twp01.amd.com (163.181.249.108) by VA3EHSMHS018.bigfish.com (10.7.99.28) with Microsoft SMTP Server id 14.1.225.22; Wed, 7 Sep 2011 15:41:59 +0000 X-WSS-ID: 0LR5SXX-01-4FD-02 X-M-MSG: Received: from sausexedgep02.amd.com (sausexedgep02-ext.amd.com [163.181.249.73]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ausb3twp01.amd.com (Axway MailGate 3.8.1) with ESMTP id 2EE5E102808E; Wed, 7 Sep 2011 10:41:57 -0500 (CDT) Received: from sausexhtp02.amd.com (163.181.3.152) by sausexedgep02.amd.com (163.181.36.59) with Microsoft SMTP Server (TLS) id 8.3.106.1; Wed, 7 Sep 2011 10:42:57 -0500 Received: from storexhtp01.amd.com (172.24.4.3) by sausexhtp02.amd.com (163.181.3.152) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 7 Sep 2011 10:41:57 -0500 Received: from gwo.osrc.amd.com (165.204.16.204) by storexhtp01.amd.com (172.24.4.3) with Microsoft SMTP Server id 8.3.83.0; Wed, 7 Sep 2011 11:41:56 -0400 Received: from lemmy.osrc.amd.com (lemmy.osrc.amd.com [165.204.15.93]) by gwo.osrc.amd.com (Postfix) with ESMTP id 8377049C623; Wed, 7 Sep 2011 16:41:55 +0100 (BST) Received: by lemmy.osrc.amd.com (Postfix, from userid 1000) id 70939FF918; Wed, 7 Sep 2011 17:41:55 +0200 (CEST) From: Joerg Roedel To: CC: Greg Kroah-Hartman , Alex Williamson , Ohad Ben-Cohen , David Woodhouse , David Brown , , , , Joerg Roedel Subject: [PATCH 01/10] iommu/core: Define iommu_ops and register_iommu only with CONFIG_IOMMU_API Date: Wed, 7 Sep 2011 17:41:44 +0200 Message-ID: <1315410113-26608-2-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1315410113-26608-1-git-send-email-joerg.roedel@amd.com> References: <1315410113-26608-1-git-send-email-joerg.roedel@amd.com> MIME-Version: 1.0 X-OriginatorOrg: amd.com Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 07 Sep 2011 16:39:32 +0000 (UTC) This makes it impossible to compile an iommu driver into the kernel without selecting CONFIG_IOMMU_API. Signed-off-by: Joerg Roedel --- include/linux/iommu.h | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 9940319..6470cd8 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -34,6 +34,8 @@ struct iommu_domain { #define IOMMU_CAP_CACHE_COHERENCY 0x1 #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ +#ifdef CONFIG_IOMMU_API + struct iommu_ops { int (*domain_init)(struct iommu_domain *domain); void (*domain_destroy)(struct iommu_domain *domain); @@ -49,8 +51,6 @@ struct iommu_ops { unsigned long cap); }; -#ifdef CONFIG_IOMMU_API - extern void register_iommu(struct iommu_ops *ops); extern bool iommu_found(void); extern struct iommu_domain *iommu_domain_alloc(void); @@ -70,9 +70,7 @@ extern int iommu_domain_has_cap(struct iommu_domain *domain, #else /* CONFIG_IOMMU_API */ -static inline void register_iommu(struct iommu_ops *ops) -{ -} +struct iommu_ops {}; static inline bool iommu_found(void) {