From: Paul Menzel <paulepanter@users.sourceforge.net>
To: dri-devel@lists.freedesktop.org
Subject: Re: [patch] gma500: silence an unused variable warning
Date: Thu, 10 May 2012 10:31:22 +0200 [thread overview]
Message-ID: <1336638682.4066.10.camel@mattotaupa> (raw)
In-Reply-To: <20120510073302.GA5919@elgon.mountain>
[-- Attachment #1.1: Type: text/plain, Size: 1640 bytes --]
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 ‘max’ [-Wunused-variable]
>
> 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 <dan.carpenter@oracle.com>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
> diff --git a/drivers/gpu/drm/gma500/opregion.c b/drivers/gpu/drm/gma500/opregion.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 = dev->dev_private;
> struct opregion_asle *asle = dev_priv->opregion.asle;
> struct backlight_device *bd = dev_priv->backlight_device;
> - u32 max;
>
> DRM_DEBUG_DRIVER("asle set backlight %x\n", bclp);
>
> @@ -165,11 +164,12 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
> if (bclp > 255)
> return ASLE_BACKLIGHT_FAILED;
>
> -#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
> - max = bd->props.max_brightness;
> - bd->props.brightness = bclp * max / 255;
> - backlight_update_status(bd);
> -#endif
> + if (config_enabled(CONFIG_BACKLIGHT_CLASS_DEVICE)) {
> + int max = bd->props.max_brightness;
> + bd->props.brightness = bclp * max / 255;
> + backlight_update_status(bd);
> + }
> +
> asle->cblv = (bclp * 0x64) / 0xff | ASLE_CBLV_VALID;
>
> return 0;
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2012-05-10 8:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-10 7:33 [patch] gma500: silence an unused variable warning Dan Carpenter
2012-05-10 8:01 ` Kirill A. Shutemov
2012-05-10 8:31 ` Paul Menzel [this message]
2012-05-10 15:30 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336638682.4066.10.camel@mattotaupa \
--to=paulepanter@users.sourceforge.net \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).