From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Menzel Subject: Re: [patch] gma500: silence an unused variable warning Date: Thu, 10 May 2012 10:31:22 +0200 Message-ID: <1336638682.4066.10.camel@mattotaupa> References: <20120510073302.GA5919@elgon.mountain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0062731952==" Return-path: Received: from mail.gw90.de (mail.gw90.de [188.40.100.199]) by gabe.freedesktop.org (Postfix) with ESMTP id E42EBA08B9 for ; Thu, 10 May 2012 01:31:31 -0700 (PDT) Received: from f053043044.adsl.alicedsl.de ([78.53.43.44] helo=[192.168.178.20]) by mail.gw90.de with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1SSOmf-0003O5-Qf for dri-devel@lists.freedesktop.org; Thu, 10 May 2012 08:31:38 +0000 In-Reply-To: <20120510073302.GA5919@elgon.mountain> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============0062731952== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-Vks/im+I+W7Mx/SsoiwD" --=-Vks/im+I+W7Mx/SsoiwD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Am Donnerstag, den 10.05.2012, 10:33 +0300 schrieb Dan Carpenter: > If CONFIG_BACKLIGHT_CLASS_DEVICE is disabled then GCC warns that: > drivers/gpu/drm/gma500/opregion.c:154:6: warning: > unused variable =E2=80=98max=E2=80=99 [-Wunused-variable] >=20 > Which give me a chance to use the new config_enabled() macro. :) Also the variable type is changed from `u32` to `int`. > Signed-off-by: Dan Carpenter Acked-by: Paul Menzel > diff --git a/drivers/gpu/drm/gma500/opregion.c b/drivers/gpu/drm/gma500/o= pregion.c > index 05661bf..d2125ba 100644 > --- a/drivers/gpu/drm/gma500/opregion.c > +++ b/drivers/gpu/drm/gma500/opregion.c > @@ -151,7 +151,6 @@ static u32 asle_set_backlight(struct drm_device *dev,= u32 bclp) > struct drm_psb_private *dev_priv =3D dev->dev_private; > struct opregion_asle *asle =3D dev_priv->opregion.asle; > struct backlight_device *bd =3D dev_priv->backlight_device; > - u32 max; > =20 > DRM_DEBUG_DRIVER("asle set backlight %x\n", bclp); > =20 > @@ -165,11 +164,12 @@ static u32 asle_set_backlight(struct drm_device *de= v, u32 bclp) > if (bclp > 255) > return ASLE_BACKLIGHT_FAILED; > =20 > -#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE > - max =3D bd->props.max_brightness; > - bd->props.brightness =3D bclp * max / 255; > - backlight_update_status(bd); > -#endif > + if (config_enabled(CONFIG_BACKLIGHT_CLASS_DEVICE)) { > + int max =3D bd->props.max_brightness; > + bd->props.brightness =3D bclp * max / 255; > + backlight_update_status(bd); > + } > + > asle->cblv =3D (bclp * 0x64) / 0xff | ASLE_CBLV_VALID; > =20 > return 0; --=-Vks/im+I+W7Mx/SsoiwD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAk+rfNsACgkQPX1aK2wOHVj6kgCffoJijzjYA2PuTzh+U3PFXT+v i+oAn0uWqTdrFHw0UAKd0sSF0RLE6bmL =m1KJ -----END PGP SIGNATURE----- --=-Vks/im+I+W7Mx/SsoiwD-- --===============0062731952== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0062731952==--