Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp1168914rwl; Thu, 10 Aug 2023 07:25:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4DX3M3Jy0/WnJKnZsPZ6UsFauo4SB/siPSLriNqyM/s+rMYoRJd8IeGUPYZ8fOvATneEI X-Received: by 2002:a17:90b:1a92:b0:269:407d:4048 with SMTP id ng18-20020a17090b1a9200b00269407d4048mr2243346pjb.22.1691677526783; Thu, 10 Aug 2023 07:25:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691677526; cv=none; d=google.com; s=arc-20160816; b=XJhUSYuHN+u72gHAo9+/8hbzipw/8gMZirA3FJWeL5S1yIsosk4ilQA9RDSrma4U3+ u4Qy6hFhiaoh8D4yJhOq4uPTldNAQUKG/U8W6R9c+WBAPeHzpx4IpgcXAbln0s569bBQ qmgFAOVpMOACq9Eq+0/yJKLbFKV1ID2914FDfb4OyEpvTAkL7YzuUWye/r7m9lZYHR4D qR5pqL/WH+EJW9p6Rdol2biBwOMb1BqkIclwnXoRo4eZKyB6yf5RE9y9XN397ZbXulFA m3xZKSXtjhRVkSjrZ//UAdzC6CgqgesweQSkFkRFxy1zsHTDI3aOLWoONnt9DOObCL5Y viwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-disposition :mime-version:message-id:subject:cc:to:from:date; bh=AImr8P+NYbJ98qnYBwf8li4HQdPuFnvGXViiDxNkWK8=; fh=+NJ84h4fOLCbnqbXn2wYmfOGCAp7FfvVWHx+50aaS5Q=; b=qOCeq2KLXoP2VMKwmnfqHS+3r09DTrg23ALR4T5+cD6fAMQNpA2cCaX7hD30o7Xee3 vzMy/8hG4omvGESotzP4Ba/O/qd0/CAzF1U9rUJkQdqtkK71UlvcIRvVAmzSrRjGfr1A XcGleFnPLKH0uRs+wGo1sEi5Y9hP4XKh0zuv653VJRFkH+3JSCXZcs+7+hrzl9jvjgy3 4LHkgqRTSM/sxjGDSKD6ssVdGgxyTg54VzP6LDupCAtoMgxsRMzMMXM5EdYZg4oShb8P l4xfwy38x8vsy+hKUFKYL1JBX1ZrfNT2wGOHTMRR0ZDJ+2ukaFiIYTJQWg5OQvV9hTrv dy/Q== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w7-20020a17090a8a0700b00262f0035181si3668312pjn.26.2023.08.10.07.25.14; Thu, 10 Aug 2023 07:25: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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235486AbjHJN5J (ORCPT + 99 others); Thu, 10 Aug 2023 09:57:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230446AbjHJN5J (ORCPT ); Thu, 10 Aug 2023 09:57:09 -0400 Received: from wxsgout04.xfusion.com (wxsgout04.xfusion.com [36.139.87.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99E74212B for ; Thu, 10 Aug 2023 06:57:04 -0700 (PDT) Received: from wuxshcsitd00600.xfusion.com (unknown [10.32.133.213]) by wxsgout04.xfusion.com (SkyGuard) with ESMTPS id 4RM7jW43R3z9y0cV; Thu, 10 Aug 2023 21:55:27 +0800 (CST) Received: from fedora (10.82.147.3) by wuxshcsitd00600.xfusion.com (10.32.133.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 10 Aug 2023 21:56:40 +0800 Date: Thu, 10 Aug 2023 21:56:39 +0800 From: Wang Jinchao To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , , , CC: Subject: [PATCH] drm/i915/gmch: fix build error var set but not used Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Originating-IP: [10.82.147.3] X-ClientProxiedBy: wuxshcsitd00602.xfusion.com (10.32.132.250) To wuxshcsitd00600.xfusion.com (10.32.133.213) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,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 When CONFIG_PNP is not defined, i915 will fail to compile with error bellow: drivers/gpu/drm/i915/soc/intel_gmch.c:43:13: error: variable ‘mchbar_addr’ set but not used Fix it by surrounding variable declaration and assignment with ifdef Signed-off-by: Wang Jinchao --- drivers/gpu/drm/i915/soc/intel_gmch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/soc/intel_gmch.c b/drivers/gpu/drm/i915/soc/intel_gmch.c index 6d0204942f7a..d2c442b0b4eb 100644 --- a/drivers/gpu/drm/i915/soc/intel_gmch.c +++ b/drivers/gpu/drm/i915/soc/intel_gmch.c @@ -38,16 +38,17 @@ intel_alloc_mchbar_resource(struct drm_i915_private *i915) { int reg = GRAPHICS_VER(i915) >= 4 ? MCHBAR_I965 : MCHBAR_I915; u32 temp_lo, temp_hi = 0; - u64 mchbar_addr; int ret; - +#ifdef CONFIG_PNP + u64 mchbar_addr; +#endif if (GRAPHICS_VER(i915) >= 4) pci_read_config_dword(i915->gmch.pdev, reg + 4, &temp_hi); pci_read_config_dword(i915->gmch.pdev, reg, &temp_lo); - mchbar_addr = ((u64)temp_hi << 32) | temp_lo; /* If ACPI doesn't have it, assume we need to allocate it ourselves */ #ifdef CONFIG_PNP + mchbar_addr = ((u64)temp_hi << 32) | temp_lo; if (mchbar_addr && pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE)) return 0; -- 2.40.0