From patchwork Mon Oct 24 11:31:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9567 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp527193wru; Mon, 24 Oct 2022 09:00:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5JyiTCq5C1l3MSxg7W62ZCGomYj+skTx31jwtSfe8MkjS6kLDcAQx3/7fDe/8GJbI1eje3 X-Received: by 2002:a17:906:844c:b0:78d:ce8f:fc81 with SMTP id e12-20020a170906844c00b0078dce8ffc81mr28765861ejy.128.1666627228443; Mon, 24 Oct 2022 09:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627228; cv=none; d=google.com; s=arc-20160816; b=Th06ffwBkeMwu6Sy0p39DBnefcBDMi8hjbL/TElBccv5UfAho+iRlI5LLEuitLDJwY 6vriIwMgYmtKgF0tkfKG6uZm289Pb6iEMBBS8qer0qBTAXi16SCGgNFxcEuHaQd2S7/C PONsnOfQvkDU2PlV4sjbqF4cJMMolj3TowYIzNUKFKcQ+KuDvKvatq6w5+T4zrHoUksj k+CSZjnI/XpTrGRMhE0IS4EsgcHDM5Lfn2kdNGyB8F7X5N0b+GpVz7sErBsbBnJMrvIG +G7hiErFsyLF/ZTcYzp8NCg4GxNUOz7Nbm6I010qKZlSUES6gTwHD8mlC9DNQOU97ly9 VWCg== 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=/yIv/TiNzDkV862+WWJeo0gFEhSGBGJcXAw9+6YoxsY=; b=G5Dbd4poqE7deyjTRSv7SlWftVG2Nrcp2viwHavwZusjdn9xdBh8J/mOZh+PonHYCf /1i42BWi67Aky9JS3o7POVL1q5FkJNvI8BbZRvpLeJrT73r8ROJf+u8ntsSXMW8vls4P huGIki9ZJIkzYm7/iGTuD/Lt0dZ8suQOk+T5UDzGb0rFmP5BrJFZ8GSuHGv4rqdW5HR6 Phcmxj1R/zlhyIbqLPd+dcQeqRLPBY/h5zLdQA//5lqSGP1KwhKgSqODmAGOZBxQQzkk fLHlbuW3aUGGyogLoNhP/f9dKOqbB2W4UCqaWu+zF6F51Pa+tR1YgeV+tv1JVcyfHf46 Hzwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yLb3ubns; 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 w2-20020a056402268200b00461f1a036f0si139330edd.335.2022.10.24.08.59.59; Mon, 24 Oct 2022 09:00:28 -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=yLb3ubns; 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 S229907AbiJXPze (ORCPT + 99 others); Mon, 24 Oct 2022 11:55:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231797AbiJXPy6 (ORCPT ); Mon, 24 Oct 2022 11:54:58 -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 7DFE5B4883; Mon, 24 Oct 2022 07:50:22 -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 7ADB2B8169B; Mon, 24 Oct 2022 12:29:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC426C433D6; Mon, 24 Oct 2022 12:29:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614597; bh=fzcrBvCZW7mXwVLKymyezTswcQKSn+eSTCs7/2xGe8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yLb3ubnsaWN+LGMJWFdDKBDpFYeNbMzSETWf58PSo9DKaBBDth4XMB9dQ/eJHhBT1 KcpprNVRJkrj91s2fsZv78y9ppS66Gy5ykAlXmrKm1emF50s1I6ZLya22sFQt2DLK5 bBFcNDyozjjgoRXEsCopEDomEmgvrzC9c8DljxWc= 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 5.10 282/390] iommu/iova: Fix module config properly Date: Mon, 24 Oct 2022 13:31:19 +0200 Message-Id: <20221024113034.963397269@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747585312633266503?= X-GMAIL-MSGID: =?utf-8?q?1747585312633266503?= 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 a0637abffee8..6c19b09e9663 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h @@ -132,7 +132,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);