Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1468702 > unrolled thread

[PATCH] drm/gma500: remove unnecessary config_enabled() guard

Started byMasahiro Yamada <yamada.masahiro@socionext.com>
First post2016-08-23 18:50 +0200
Last post2016-08-24 07:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] drm/gma500: remove unnecessary config_enabled() guard Masahiro Yamada <yamada.masahiro@socionext.com> - 2016-08-23 18:50 +0200
    Re: [PATCH] drm/gma500: remove unnecessary config_enabled() guard Daniel Vetter <daniel@ffwll.ch> - 2016-08-24 07:50 +0200

#1468702 — [PATCH] drm/gma500: remove unnecessary config_enabled() guard

FromMasahiro Yamada <yamada.masahiro@socionext.com>
Date2016-08-23 18:50 +0200
Subject[PATCH] drm/gma500: remove unnecessary config_enabled() guard
Message-ID<s9n3I-6xg-19@gated-at.bofh.it>
Commit d112a8163f83 ("gma500/cdv: Add eDP support") replaced the
code inside this if-conditional with gma_backlight_set(), which
becomes a nop stub if CONFIG_BACKLIGHT_CLASS_DEVICE is disabled.
So, there is no need to guard the caller with config_enabled().

Note:
This is one of remaining TODOs to deprecate config_enabled() macro.
Refer to commit 97f2645f358b ("tree-wide: replace config_enabled()
with IS_ENABLED()").

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 drivers/gpu/drm/gma500/opregion.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/gma500/opregion.c b/drivers/gpu/drm/gma500/opregion.c
index ab696ca..eab6d88 100644
--- a/drivers/gpu/drm/gma500/opregion.c
+++ b/drivers/gpu/drm/gma500/opregion.c
@@ -163,10 +163,7 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
 	if (bclp > 255)
 		return ASLE_BACKLIGHT_FAILED;
 
-	if (config_enabled(CONFIG_BACKLIGHT_CLASS_DEVICE)) {
-		int max = bd->props.max_brightness;
-		gma_backlight_set(dev, bclp * max / 255);
-	}
+	gma_backlight_set(dev, bclp * bd->props.max_brightness / 255);
 
 	asle->cblv = (bclp * 0x64) / 0xff | ASLE_CBLV_VALID;
 
-- 
1.9.1

[toc] | [next] | [standalone]


#1469083

FromDaniel Vetter <daniel@ffwll.ch>
Date2016-08-24 07:50 +0200
Message-ID<s9zex-6kx-1@gated-at.bofh.it>
In reply to#1468702
On Wed, Aug 24, 2016 at 01:42:54AM +0900, Masahiro Yamada wrote:
> Commit d112a8163f83 ("gma500/cdv: Add eDP support") replaced the
> code inside this if-conditional with gma_backlight_set(), which
> becomes a nop stub if CONFIG_BACKLIGHT_CLASS_DEVICE is disabled.
> So, there is no need to guard the caller with config_enabled().
> 
> Note:
> This is one of remaining TODOs to deprecate config_enabled() macro.
> Refer to commit 97f2645f358b ("tree-wide: replace config_enabled()
> with IS_ENABLED()").
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Applied to drm-misc, thanks.
-Daniel
> ---
> 
>  drivers/gpu/drm/gma500/opregion.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/gma500/opregion.c b/drivers/gpu/drm/gma500/opregion.c
> index ab696ca..eab6d88 100644
> --- a/drivers/gpu/drm/gma500/opregion.c
> +++ b/drivers/gpu/drm/gma500/opregion.c
> @@ -163,10 +163,7 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp)
>  	if (bclp > 255)
>  		return ASLE_BACKLIGHT_FAILED;
>  
> -	if (config_enabled(CONFIG_BACKLIGHT_CLASS_DEVICE)) {
> -		int max = bd->props.max_brightness;
> -		gma_backlight_set(dev, bclp * max / 255);
> -	}
> +	gma_backlight_set(dev, bclp * bd->props.max_brightness / 255);
>  
>  	asle->cblv = (bclp * 0x64) / 0xff | ASLE_CBLV_VALID;
>  
> -- 
> 1.9.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web