Message ID | 20230612124408.521325-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2565392vqr; Mon, 12 Jun 2023 05:58:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5fZZXhW+aLxNmBFumV7dlU94pfx1FXQh7O2CkDG+bdP7rSzgqPnnScSlY9LaA/4DUKH55s X-Received: by 2002:a05:6a20:918d:b0:119:6153:5d0e with SMTP id v13-20020a056a20918d00b0011961535d0emr10210223pzd.56.1686574683471; Mon, 12 Jun 2023 05:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686574683; cv=none; d=google.com; s=arc-20160816; b=d0XRl0cUPF/ctYA39oduPuKeI6t2V1YOe/MU/xeC4juqRm62QwLNcr9AzffiYWhvoZ 45TxMLrM8cWZdlsyux1Jf0DsogX4mItVuH8kqCMehYa7i2SpgC5A+JCNOY2hjsSE1MZh xVBP9nL9RRcRVmXE5BR75d8KKULY3sWUyhkAF7PB5sAbTdY/DT+7LIq14U6FZxV9lQwq 8exjHYltu6SPfhlrZ4KMyBC7cQuC2cfzsLJwI0ucvw6wOiZecbl6gpoLOIRQrOH4votF XoUCpFB5zq4c2IbnhAchjutlCfJ/8k+GWbSiOMC9lHizDqTdB/A/tbb6HCWA+0C2MP/H Mjgg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a637251000000b00543cc3151f9si7179427pgn.461.2023.06.12.05.57.51; Mon, 12 Jun 2023 05:58:03 -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 S233614AbjFLMoS (ORCPT <rfc822;rust.linux@gmail.com> + 99 others); Mon, 12 Jun 2023 08:44:18 -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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <linux-kernel@vger.kernel.org>; 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 <arnd@kernel.org> To: Jani Nikula <jani.nikula@linux.intel.com>, Joonas Lahtinen <joonas.lahtinen@linux.intel.com>, Rodrigo Vivi <rodrigo.vivi@intel.com>, Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch> Cc: Arnd Bergmann <arnd@arndb.de>, =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= <ville.syrjala@linux.intel.com>, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768501735333436360?= X-GMAIL-MSGID: =?utf-8?q?1768501735333436360?= |
Series |
drm/i915/gmch: avoid unused variable warning
|
|
Commit Message
Arnd Bergmann
June 12, 2023, 12:43 p.m. UTC
From: Arnd Bergmann <arnd@arndb.de> 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 <arnd@arndb.de> --- 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(-)
Comments
Hi Arnd, On Mon, Jun 12, 2023 at 02:43:59PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > 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 <arnd@arndb.de> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Andi > --- > 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 >
Hi Arnd, On Mon, Jun 12, 2023 at 02:43:59PM +0200, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > 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 <arnd@arndb.de> applied to drm-intel-next. Thank you, Andi
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";