From patchwork Thu Aug 10 13:56:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wang Jinchao X-Patchwork-Id: 134022 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b824:0:b0:3f2:4152:657d with SMTP id z4csp476963vqi; Thu, 10 Aug 2023 07:56:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGZ2z7SgASzLBDJL98W1p93VwMS1uKRwGpuQM3H/pI+CLCPmtJo0wuStrFlfUOSmOScdGUq X-Received: by 2002:a05:6512:1c5:b0:4fe:8c1d:9e81 with SMTP id f5-20020a05651201c500b004fe8c1d9e81mr1986291lfp.36.1691679396042; Thu, 10 Aug 2023 07:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691679396; cv=none; d=google.com; s=arc-20160816; b=u63qV2h2G84MzezZyuZba4VBycgZj2Kk44nTwF7id/LmWepe+SSBpPW7g0empAvfxR p50SYRyS4KslZ0DXgHqtv+kBGXyNGMiOaLDCmaCHD40aP3KQYoTuS0VJPpQCAsThiUsZ gQni6Kfx2kHnwdD3mTktxnbtjKB46zlIiP7uqTVFLvewtmafbc9/8n5KW7F56E+DWXhV TJm2cLTFPzxhcWS02e+QAyWNPM2JkNXLQHPNL0kRLmTPzlGyUeJVlb+27SW5gjpHFvPa M7EISXPJU+JC/TtyZ9nP5gL8FZSZnRZNOyU5Ws/kUXbTacA7ivkQizNnkPXOVP8hzLV0 QF4w== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e22-20020aa7d7d6000000b00522274f8e24si1526192eds.389.2023.08.10.07.56.07; Thu, 10 Aug 2023 07:56:36 -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 S235487AbjHJN5K (ORCPT + 99 others); Thu, 10 Aug 2023 09:57:10 -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-Disposition: inline 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773854414660705371 X-GMAIL-MSGID: 1773854414660705371 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;