Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6473307rwn; Tue, 13 Sep 2022 05:00:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR5K3T+kIrHPX463aafzpAb263UKYvg9i8QgB2O7hsYHHaSGkRMVMZbuBWGQePQpjVAQ8FXB X-Received: by 2002:a17:907:1ca9:b0:77c:99cc:2d84 with SMTP id nb41-20020a1709071ca900b0077c99cc2d84mr7776513ejc.308.1663070426297; Tue, 13 Sep 2022 05:00:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663070426; cv=none; d=google.com; s=arc-20160816; b=yWHBfsLuGhIlc6H+9nOFTL0p2ofItbYItSBBrEE61U9oIZRjs6SCfpaGd5co6Tc+5z nE9m2mBmykCCNlJma1JdpoM7+HS6MkfL8/8n1qUOMqcCNA/2OI2EJqlgxCAARYxvo7U4 6iK12wgDqcIxQECQCW8z5KmBWujrUYhmf7Z93tqLXzAMnLqbuQeFF/aN6XX+XcmURTGO 5UNGi4gAVJlOry2xn4L3rHYz/HnpbCqZWljEfYFctOQ+BafNLXdbQe3nHZVRq+QHJeGB lsqv5bOaUXMjUABnTnmw9o8pwrpjiB+fRvAGPHj7+ParmSpfsDWJbt2Lrah5uEIjwaxU J67Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=KxfMFlSj1bA5ljaxZR7dyqEZhL7+F9FqEuS6FzwfzxQ=; b=EVYKUCLbC14G2MFtdeW+8BMTNvWyUf0ObjDqALAZdHV+U28lUx6jKyO8XsNRp331T0 +SPPEjtRd+nlqYACBz4EnI8cS/aGTKIBD9zsXvk3lTIbDDZ6N31y/7cEtUriHKHue4A/ M23JlEWAK4yrcgO4hKp6bRn/aR9+Y4nZ9tE3DkUAVbUVqtb3FtS4C+r7Fz2HcpGAwj7A yhEe2rhIzpQraqFgPY3Bnzh6memIJqInxX0BVTasB9MXCwKd9HtZimPvUzyseAD9L9Dh KFD7dg6m5HycdlKaNmi2/4Gj9XwHsb25f9G9rkQgGM3RR1XCTUw9F/Xg9J1PiK1mkqw8 L6RQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h12-20020a05640250cc00b004520b01a355si3602058edb.52.2022.09.13.04.59.56; Tue, 13 Sep 2022 05:00:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231504AbiIMLra (ORCPT + 99 others); Tue, 13 Sep 2022 07:47:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231351AbiIMLr1 (ORCPT ); Tue, 13 Sep 2022 07:47:27 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C19D11DA61 for ; Tue, 13 Sep 2022 04:47:26 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CFAF51063; Tue, 13 Sep 2022 04:47:32 -0700 (PDT) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 83A163F71A; Tue, 13 Sep 2022 04:47:25 -0700 (PDT) From: Robin Murphy To: joro@8bytes.org Cc: will@kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Thierry Reding , John Garry Subject: [PATCH] iommu/iova: Fix module config properly Date: Tue, 13 Sep 2022 12:47:20 +0100 Message-Id: <548c2f683ca379aface59639a8f0cccc3a1ac050.1663069227.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.36.1.dirty MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org IOMMU_IOVA is intended to be an optional library for users to select as and when they desire. Since it can be a module now, this means that built-in code which has chosen not to select it should not fail to link if it happens to have selected as a module by someone else. Replace IS_ENABLED() with IS_REACHABLE() to do the right thing. CC: Thierry Reding Reported-by: John Garry Fixes: 15bbdec3931e ("iommu: Make the iova library a module") Signed-off-by: Robin Murphy --- Phrased as a fix for the sake of complete honesty, but it seems everyone's been making do for years already so by now it's really just more of an enhancement. include/linux/iova.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/iova.h b/include/linux/iova.h index 8f97a43be834..fe18c3e6a725 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h @@ -75,7 +75,7 @@ static inline unsigned long iova_pfn(struct iova_domain *iovad, dma_addr_t iova) return iova >> iova_shift(iovad); } -#if IS_ENABLED(CONFIG_IOMMU_IOVA) +#if IS_REACHABLE(CONFIG_IOMMU_IOVA) int iova_cache_get(void); void iova_cache_put(void); -- 2.36.1.dirty