From patchwork Fri Sep 13 08:14:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ghadi Elie Rahme X-Patchwork-Id: 1985044 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X4nDK0qmSz1y1y for ; Fri, 13 Sep 2024 18:15:13 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sp1SK-00027B-UY; Fri, 13 Sep 2024 08:15:05 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sp1SF-00020a-Qh for kernel-team@lists.ubuntu.com; Fri, 13 Sep 2024 08:14:59 +0000 Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id AE28D3F2FC for ; Fri, 13 Sep 2024 08:14:59 +0000 (UTC) Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-3780c8d689bso943330f8f.2 for ; Fri, 13 Sep 2024 01:14:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726215299; x=1726820099; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Nja1Zb5hiiioxkbzg4VCDGFAY/SuggG9aul+fqMrMrw=; b=Ezb7xvAZmfrsE8OTJhC5xNzamLn8PJZPjfDNChroNdniXajFINATykYtIIzusgZ5M0 xdmpFhF/sB6yBK7JECWOmOji9JYs8BNkjqlNnQI88Sfd3/7/dMn06hXywLtyor0+y3+w kXybt22t5M7+qJjM1GB4UA7BJTGeVjQaGNLW1i/eqnqDYW83j6MrEvxtik4rrOI82hrJ RyCCLPIHRa1HxOFlIHl3QVpToBNwPVq6bZYi9BgS2xdG/69Gd5hpW1dRin5ElN11aOMZ ekHRpcP8JkiMtzWt0yR9a8hWT11+zf2nLvkcaBc95lfsQWL9Eg2VxrwxeJDGTVJQi6L0 etNA== X-Gm-Message-State: AOJu0YzVUc7rR53LhT3wu1Q3FRAwlUOXW/96Ysnw0ovPf/83+Xtuebeh CACPLjCbRRLOm/HPLn7LrUNCR5ODkj7ZL1LMH0dpsyRiRFEX2b4BNyhOkL+3tjut8bJKWu5SbCO qbRV7xKACABZhEaGypXq53G2qZpZfSvINDvZNSpwm3vuAJ/Sevh8qeumP0FRPCBcvNuyv3Ni4Z6 A6P7Y+2jhwpQ== X-Received: by 2002:adf:f901:0:b0:374:c318:2188 with SMTP id ffacd0b85a97d-378c2d51913mr2807312f8f.42.1726215299051; Fri, 13 Sep 2024 01:14:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEg74tzMftA0KbOOP9o5T/TV2+7QWqunwnfVAwOMNKG2E+f7NUn8B4N/iEPlX6vlV9YAwUQgQ== X-Received: by 2002:adf:f901:0:b0:374:c318:2188 with SMTP id ffacd0b85a97d-378c2d51913mr2807288f8f.42.1726215298542; Fri, 13 Sep 2024 01:14:58 -0700 (PDT) Received: from XPS-17-9720.han-hoki.ts.net ([213.204.117.111]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3789564aea0sm16082829f8f.20.2024.09.13.01.14.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 01:14:58 -0700 (PDT) From: Ghadi Elie Rahme To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2] iommu/amd: Fix compile warning in init code Date: Fri, 13 Sep 2024 11:14:31 +0300 Message-ID: <20240913081432.703550-3-ghadi.rahme@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240913081432.703550-1-ghadi.rahme@canonical.com> References: <20240913081432.703550-1-ghadi.rahme@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" 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 Link: https://lore.kernel.org/r/20220729100432.22474-1-joro@8bytes.org (backported from commit be280ea763f7db492e0e30ba22873433aea0f468) [ghadi-rahme: Had to adjust the context due to missing commits] signed-off-by: Ghadi Elie Rahme --- 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 f30d607f0e08..8c250240e63e 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -808,9 +808,9 @@ static void __init free_ppr_log(struct amd_iommu *iommu) free_pages((unsigned long)iommu->ppr_log, get_order(PPR_LOG_SIZE)); } +#ifdef CONFIG_IRQ_REMAP static void free_ga_log(struct amd_iommu *iommu) { -#ifdef CONFIG_IRQ_REMAP free_pages((unsigned long)iommu->ga_log, get_order(GA_LOG_SIZE)); free_pages((unsigned long)iommu->ga_log_tail, get_order(8)); #endif @@ -848,13 +848,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; @@ -872,10 +871,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) {