From patchwork Mon Oct 24 11:31:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8641 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp421364wru; Mon, 24 Oct 2022 05:20:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ZIBUxCccSmKFXAEOQZt11E6PDzDqJF/HkNF7UUe7awN4haRZc9pNS4WdBoAc3MmfScyu3 X-Received: by 2002:a17:907:7250:b0:791:9093:47f7 with SMTP id ds16-20020a170907725000b00791909347f7mr27426475ejc.278.1666614021407; Mon, 24 Oct 2022 05:20:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666614021; cv=none; d=google.com; s=arc-20160816; b=LIFOCxDD6KaYdYsVnEjcH4Q621T+Dx/2zg3J5Jo9s978EK48TdP6yr4y4AEpQ1VTjV rVYTWZA4wy5UuGRBRrCx/TYk2jUf1y8NDlFYSxt93PiFKMKUnh+nnqsggvrcjwBgtLJw 4AXRPszILTstyCTcZ00BYF2oyGZnTuzPDyFdvs3H/Nd35pts12lsbYq7sZCnqZ8Liyv0 RrZ8Eav5wLU2wT3WVFdtrkUhEa6VK0jW35f3erBq2MXnFw5gGBjOotYefi3WJjw34FTo EYCnVeJmwx86N7ykTeZEbL3sdOJ1VR72US7nnz6HA0lkHp1D6VaXUCOdnaYAuAy5A6wy 4AqA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Zxcc/ND4viNWddjgJzs/86AMikveDxJLnPjR4RQb1zM=; b=b9i62tKdOnsHZtCMJvV9kKMZ63TdZoIb0zv809gbiVS+EbjM7rFpZSM4nDeiNBzQLj 4qH3lSYacNl932G36AbRHS5kE/yz6xbQzTyblrsHGQhePhV3YmM3z6NtHDrIJQFAZrR6 ekeWJeHTQzQGNBEg2ScbxeHr1Kspu9GiiOLnFBh1+G807rzD+fcqbj20/e9o4NFoLHTT DpY5rlCvCntRI3rje9+YC8m2pI/ABtertS+XAeJamIT+BPOng5e4lz3US0Rw/GLdInX2 unuYr2n6HkfoslFQmMgj6xzJEaM1heoqORYY+T7TMN9lS5HI5neAbDW6A+9CMk9W8Qfu 7omQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JOsHCeNN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr4-20020a170907720400b00782393c36cfsi3367793ejc.336.2022.10.24.05.19.57; Mon, 24 Oct 2022 05:20:21 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JOsHCeNN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232842AbiJXMM4 (ORCPT + 99 others); Mon, 24 Oct 2022 08:12:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230138AbiJXMME (ORCPT ); Mon, 24 Oct 2022 08:12:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2C0B80529; Mon, 24 Oct 2022 04:53:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A8348B811AC; Mon, 24 Oct 2022 11:52:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 083F6C433D7; Mon, 24 Oct 2022 11:52:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612334; bh=e9h4yRhNzUIntkHSn1fFub1FEWUXriihXcHA0orFn+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JOsHCeNNmRe61eJk4M7KCQnP5kbW8Ysii3FqN7rhGKaYFsqVnWQhqO7KP3OooLPkc Ii28VVqL3GTIa9TzrWS4gYiF/kSazp6tZxJve9rOiR0nD2us+9Chue8iMhDIxbQNIl qrPUa86HMW908b5nAnYJp6be9epOE8cRUMfsc/po= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thierry Reding , John Garry , Robin Murphy , Thierry Reding , Joerg Roedel , Sasha Levin Subject: [PATCH 4.14 158/210] iommu/iova: Fix module config properly Date: Mon, 24 Oct 2022 13:31:15 +0200 Message-Id: <20221024113002.104768124@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747571463917477186?= X-GMAIL-MSGID: =?utf-8?q?1747571463917477186?= From: Robin Murphy [ Upstream commit 4f58330fcc8482aa90674e1f40f601e82f18ed4a ] 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 Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/548c2f683ca379aface59639a8f0cccc3a1ac050.1663069227.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- 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 7d23bbb887f2..641e62700ef3 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h @@ -131,7 +131,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);