Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5510563rwd; Mon, 12 Jun 2023 06:14:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ65z9D/IWI9SG3IpWD3BDWT2STRiN3i5vHXqfZIeIe4U01ABM260qFoVJBa+F5tmyb+VlOo X-Received: by 2002:a17:907:9349:b0:974:1f8f:89d7 with SMTP id bv9-20020a170907934900b009741f8f89d7mr10492191ejc.31.1686575672646; Mon, 12 Jun 2023 06:14:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686575672; cv=none; d=google.com; s=arc-20160816; b=k81VFMGskeAdngrdQnYzRbQb72WSfVBLC4i85e6q4PbxX5rdsXl6RLyzA+q7Ni95aP Skw7Pfm10R2FdXLWco/JMnzKrgrUfnhI0uzhVURfNjspeUQPoq1xI/s59itPcRrkohtL mWLJtAXp4oS2rUwAYpPXbozuEEqeZasJveXew3XxmrCVpL95gUfhdj0sbkeLvikSm85h JEcbeGxxDKis0nJiB23jNhUuPPS042D0DG9y+uzpeGqbtgl/cGpCM3fPs5aYX9/hn3xt 3UCWYbUewYIhjRPA+lv/5UuVFKFR6DD6tmkz99FbiOCWzDa0x0DM+KW7zPZgozT34Wro AhSw== 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:dkim-signature; bh=08whF6J8q+c8PiZJO1paGmuKx+q1QCgZkeNMlhZIkks=; b=XRh+Nuw6H/rGRF8DOzym5DsB/VB7sRzqr4ZFsBzCVoOLU4CEzSf+jYMzaawwHyR3g5 4OdzrlQKwuTCHDB3PTDIXCRCVSUkC9fdZ5a829pdsV+BDXv5MDbeHKvjNVhGFYk2wU0K V0Y8v7vxPDeBoiWBKRmxY6GTRTjZajHgbD8HrFG0zQkzM5v+QqCmb+h5u+J/XAqR6s7V 8YeiMEXjZkR9ZxJf3V3kijq4yScb46MxmHVQRtFAc6zUoHheBMmt8dtFS3/qxo7WPMtR twKEeoW0erhLTzjPcjKYGxVizVEE5TulHFwn6aRC6Q3Ze5GNDbypqOwGH/ndnwuupcmA xDCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aNZ6vU+z; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id le9-20020a170907170900b0097738977c35si2084373ejc.850.2023.06.12.06.14.08; Mon, 12 Jun 2023 06:14:32 -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=@kernel.org header.s=k20201202 header.b=aNZ6vU+z; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233493AbjFLMoR (ORCPT + 99 others); Mon, 12 Jun 2023 08:44:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231165AbjFLMoQ (ORCPT ); Mon, 12 Jun 2023 08:44:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E16E7AA for ; Mon, 12 Jun 2023 05:44:15 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 7CA7A613CA for ; Mon, 12 Jun 2023 12:44:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62198C433EF; Mon, 12 Jun 2023 12:44:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686573854; bh=gq5hRxWovnLtF31u4zc0XX1gnCt36dRWdFL6GhVRm1Y=; h=From:To:Cc:Subject:Date:From; b=aNZ6vU+zqRHWZ7v5rU9caKOXoKFrLPpnXcJFL7SjBButK5TfSon8w7qd0ZGp3yPsX EI2aVc23QU7o5UMTofxC4fGvGweV9D6QVN3tE084zyRWCdedehtmIrGLbT0VoKpqdw BT5zR5FmOIvCn1GZl8eJESDk4BGo0K/dPVAQHhF3a0XxsP8kX962PEjdsRaf+Dn6S6 syUv+UxCqUM8TTY2vYE8wjvhxTtSHo356wst1ETPwgdjxwxXSpbs8BzigsIqWGMteP dB4wSGS686NpkLtVIG7xL2SsTi2m3BtYsQxqmS+4eOCxf6HmMm0b6OSVoD/mQr+iS1 WWdWTKzRDvpCQ== From: Arnd Bergmann To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter Cc: Arnd Bergmann , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/i915/gmch: avoid unused variable warning Date: Mon, 12 Jun 2023 14:43:59 +0200 Message-Id: <20230612124408.521325-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,T_SCC_BODY_TEXT_LINE 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: Arnd Bergmann When CONFIG_PNP is disabled, the mchbar_addr variable is only written but not read: drivers/gpu/drm/i915/soc/intel_gmch.c: In function 'intel_alloc_mchbar_resource': drivers/gpu/drm/i915/soc/intel_gmch.c:41:13: error: variable 'mchbar_addr' set but not used [-Werror=unused-but-set-variable] 41 | u64 mchbar_addr; | ^~~~~~~~~~~ No idea why this showed up now, but it's easy to fix by changing the #ifdef to an IS_ENABLED() check that the compiler can see through. Signed-off-by: Arnd Bergmann --- I saw this last week already, so it's likely that someone else already sent a fix for it. drivers/gpu/drm/i915/soc/intel_gmch.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/soc/intel_gmch.c b/drivers/gpu/drm/i915/soc/intel_gmch.c index 6d0204942f7a5..49c7fb16e934f 100644 --- a/drivers/gpu/drm/i915/soc/intel_gmch.c +++ b/drivers/gpu/drm/i915/soc/intel_gmch.c @@ -47,11 +47,9 @@ intel_alloc_mchbar_resource(struct drm_i915_private *i915) mchbar_addr = ((u64)temp_hi << 32) | temp_lo; /* If ACPI doesn't have it, assume we need to allocate it ourselves */ -#ifdef CONFIG_PNP - if (mchbar_addr && + if (IS_ENABLED(CONFIG_PNP) && mchbar_addr && pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE)) return 0; -#endif /* Get some space for it */ i915->gmch.mch_res.name = "i915 MCHBAR"; -- 2.39.2