Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp166601imn; Fri, 29 Jul 2022 03:23:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1slZXdoJv051ajMcP8+oOzLhsfQHL9aAknqL+kW0KYcpmF1KpEtIZOTPeovOg+Z0/TBoj75 X-Received: by 2002:a05:6402:51d1:b0:43b:f89e:a751 with SMTP id r17-20020a05640251d100b0043bf89ea751mr2734635edd.391.1659090211146; Fri, 29 Jul 2022 03:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659090211; cv=none; d=google.com; s=arc-20160816; b=cM+dflC69/QFjzRVOYzL4C0atxrl3cGE31wBh2TaUofXCuqFL7bLH1vcmmIMBD9VMb iH6fHVbUzeu1mPtEsBeRCZjDCtidFKfUE6m1bFa7QyI2eqTOxOxMWqpnP3iHdzwtxBxb zn9uhFR8lk8fxeWE0Xtl+hH3IxMeBf609SAkCALvZwdOAbdywzPao/syy5QaVCrvuXGB GmFudHv9AjG53L14DY3Ur9yzkY1xYXcEp2u2grXRPO9gEdN9sYAN/7gcvQcRwQ5qS1zF bD7hANRV8cRMjl2zhM93IYM1WfxOyb0FuLu+/PugdpWDaE4LRDSiD6RmoMeJ7/+2g4u9 Qxdw== 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=kGjiuaIo/fPfAP7qvF9QnQNMIGJAXiahcMZcS3zbzvk=; b=x41p5rYhSm2FhhBSloEEdo3FGim46zJcNdWl7akxG57gyvf+4jV/HXTJLOfc7N3XR+ /wGv4XrHotC/+y4giRIBx/nYSjz1vsMBDYB486/GXDvfywa4FcHdH2HoFwvboZ75Eqn4 qbKoSEjWz9+W+UZBmlIQXQaIym3XzNq35fYG4I8aSgYVOqTHjdl37vEYvnTbbpQZoHAt mOSfluk6unXtt8d06cvEdM1W22jdIPkbhM/VKgLIAhvhvKUBa3BslD9XFKMWdkAffoPS ZElSgdyGO7rTdNPIc84Aq4hH3wpMd4MEk8//7xegcTE6z8A9sknYwTb8vf26eqgB6Doy 9lKQ== 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=8bytes.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13-20020a056402238d00b0043bb8ee67cbsi2653133eda.272.2022.07.29.03.23.06; Fri, 29 Jul 2022 03:23:31 -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=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235143AbiG2KEu (ORCPT + 99 others); Fri, 29 Jul 2022 06:04:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbiG2KEs (ORCPT ); Fri, 29 Jul 2022 06:04:48 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0D967B794 for ; Fri, 29 Jul 2022 03:04:47 -0700 (PDT) Received: from lemmy.home.8bytes.org (p549adf92.dip0.t-ipconnect.de [84.154.223.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by theia.8bytes.org (Postfix) with ESMTPSA id 794A9DC; Fri, 29 Jul 2022 12:04:45 +0200 (CEST) From: Joerg Roedel To: Joerg Roedel Cc: Suravee Suthikulpanit , Will Deacon , Jerry Snitselaar , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Joerg Roedel Subject: [PATCH] iommu/amd: Fix compile warning in init code Date: Fri, 29 Jul 2022 12:04:32 +0200 Message-Id: <20220729100432.22474-1-joro@8bytes.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 From: Joerg Roedel A recent commit introduced these compile warnings: CC drivers/iommu/amd/init.o drivers/iommu/amd/init.c:938:12: error: ‘iommu_init_ga_log’ defined but not used [-Werror=unused-function] 938 | static int iommu_init_ga_log(struct amd_iommu *iommu) | ^~~~~~~~~~~~~~~~~ drivers/iommu/amd/init.c:902:12: error: ‘iommu_ga_log_enable’ defined but not used [-Werror=unused-function] 902 | static int iommu_ga_log_enable(struct amd_iommu *iommu) | ^~~~~~~~~~~~~~~~~~~ The warnings appear because both functions are defined when IRQ remapping is not enabled, but only used when IRQ remapping is enabled. Fix it by only defining the functions when IRQ remapping is enabled. Fixes: c5e1a1eb9279 ("iommu/amd: Simplify and Consolidate Virtual APIC (AVIC) Enablement") Signed-off-by: Joerg Roedel --- drivers/iommu/amd/init.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index 6bbaf6b971e8..fdc642362c14 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -899,9 +899,9 @@ static void free_ga_log(struct amd_iommu *iommu) #endif } +#ifdef CONFIG_IRQ_REMAP static int iommu_ga_log_enable(struct amd_iommu *iommu) { -#ifdef CONFIG_IRQ_REMAP u32 status, i; u64 entry; @@ -931,13 +931,12 @@ static int iommu_ga_log_enable(struct amd_iommu *iommu) if (WARN_ON(i >= LOOP_TIMEOUT)) return -EINVAL; -#endif /* CONFIG_IRQ_REMAP */ + return 0; } static int iommu_init_ga_log(struct amd_iommu *iommu) { -#ifdef CONFIG_IRQ_REMAP if (!AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir)) return 0; @@ -955,10 +954,8 @@ static int iommu_init_ga_log(struct amd_iommu *iommu) err_out: free_ga_log(iommu); return -EINVAL; -#else - return 0; -#endif /* CONFIG_IRQ_REMAP */ } +#endif /* CONFIG_IRQ_REMAP */ static int __init alloc_cwwb_sem(struct amd_iommu *iommu) { -- 2.36.1