* [PATCH] cklight: tps65217_bl: Remove unnecessary default brightness check
@ 2017-10-08 21:56 Christos Gkekas
2017-10-09 10:00 ` Daniel Thompson
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Christos Gkekas @ 2017-10-08 21:56 UTC (permalink / raw)
To: Lee Jones, Daniel Thompson, Jingoo Han, Bartlomiej Zolnierkiewicz,
linux-fbdev, linux-kernel
Cc: Christos Gkekas
Variable val holds the default brightness and is unsigned, therefore
checking whether it is less than zero is redundant.
Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
---
drivers/video/backlight/tps65217_bl.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c
index fd524ad..61ea82d 100644
--- a/drivers/video/backlight/tps65217_bl.c
+++ b/drivers/video/backlight/tps65217_bl.c
@@ -239,8 +239,7 @@ tps65217_bl_parse_dt(struct platform_device *pdev)
}
if (!of_property_read_u32(node, "default-brightness", &val)) {
- if (val < 0 ||
- val > 100) {
+ if (val > 100) {
dev_err(&pdev->dev,
"invalid 'default-brightness' value in the device tree\n");
err = ERR_PTR(-EINVAL);
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] cklight: tps65217_bl: Remove unnecessary default brightness check
2017-10-08 21:56 [PATCH] cklight: tps65217_bl: Remove unnecessary default brightness check Christos Gkekas
@ 2017-10-09 10:00 ` Daniel Thompson
2017-10-09 16:12 ` Jingoo Han
2017-10-13 8:50 ` Lee Jones
2 siblings, 0 replies; 4+ messages in thread
From: Daniel Thompson @ 2017-10-09 10:00 UTC (permalink / raw)
To: Christos Gkekas, Lee Jones, Jingoo Han, Bartlomiej Zolnierkiewicz,
linux-fbdev, linux-kernel
On 08/10/17 22:56, Christos Gkekas wrote:
> Variable val holds the default brightness and is unsigned, therefore
> checking whether it is less than zero is redundant.
>
> Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
> ---
> drivers/video/backlight/tps65217_bl.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c
> index fd524ad..61ea82d 100644
> --- a/drivers/video/backlight/tps65217_bl.c
> +++ b/drivers/video/backlight/tps65217_bl.c
> @@ -239,8 +239,7 @@ tps65217_bl_parse_dt(struct platform_device *pdev)
> }
>
> if (!of_property_read_u32(node, "default-brightness", &val)) {
> - if (val < 0 ||
> - val > 100) {
> + if (val > 100) {
> dev_err(&pdev->dev,
> "invalid 'default-brightness' value in the device tree\n");
> err = ERR_PTR(-EINVAL);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cklight: tps65217_bl: Remove unnecessary default brightness check
2017-10-08 21:56 [PATCH] cklight: tps65217_bl: Remove unnecessary default brightness check Christos Gkekas
2017-10-09 10:00 ` Daniel Thompson
@ 2017-10-09 16:12 ` Jingoo Han
2017-10-13 8:50 ` Lee Jones
2 siblings, 0 replies; 4+ messages in thread
From: Jingoo Han @ 2017-10-09 16:12 UTC (permalink / raw)
To: 'Christos Gkekas', 'Lee Jones',
'Daniel Thompson', 'Bartlomiej Zolnierkiewicz',
linux-fbdev, linux-kernel
On Sunday, October 8, 2017 5:57 PM, Christos Gkekas wrote:
>
> Variable val holds the default brightness and is unsigned, therefore
> checking whether it is less than zero is redundant.
>
> Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
It looks good.
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Best regards,
Jingoo Han
> ---
> drivers/video/backlight/tps65217_bl.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/video/backlight/tps65217_bl.c
> b/drivers/video/backlight/tps65217_bl.c
> index fd524ad..61ea82d 100644
> --- a/drivers/video/backlight/tps65217_bl.c
> +++ b/drivers/video/backlight/tps65217_bl.c
> @@ -239,8 +239,7 @@ tps65217_bl_parse_dt(struct platform_device *pdev)
> }
>
> if (!of_property_read_u32(node, "default-brightness", &val)) {
> - if (val < 0 ||
> - val > 100) {
> + if (val > 100) {
> dev_err(&pdev->dev,
> "invalid 'default-brightness' value in the
> device tree\n");
> err = ERR_PTR(-EINVAL);
> --
> 2.7.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cklight: tps65217_bl: Remove unnecessary default brightness check
2017-10-08 21:56 [PATCH] cklight: tps65217_bl: Remove unnecessary default brightness check Christos Gkekas
2017-10-09 10:00 ` Daniel Thompson
2017-10-09 16:12 ` Jingoo Han
@ 2017-10-13 8:50 ` Lee Jones
2 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2017-10-13 8:50 UTC (permalink / raw)
To: Christos Gkekas
Cc: Daniel Thompson, Jingoo Han, Bartlomiej Zolnierkiewicz,
linux-fbdev, linux-kernel
On Sun, 08 Oct 2017, Christos Gkekas wrote:
> Variable val holds the default brightness and is unsigned, therefore
> checking whether it is less than zero is redundant.
>
> Signed-off-by: Christos Gkekas <chris.gekas@gmail.com>
> ---
> drivers/video/backlight/tps65217_bl.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
Subject line fixed and patch applied, thanks.
> diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c
> index fd524ad..61ea82d 100644
> --- a/drivers/video/backlight/tps65217_bl.c
> +++ b/drivers/video/backlight/tps65217_bl.c
> @@ -239,8 +239,7 @@ tps65217_bl_parse_dt(struct platform_device *pdev)
> }
>
> if (!of_property_read_u32(node, "default-brightness", &val)) {
> - if (val < 0 ||
> - val > 100) {
> + if (val > 100) {
> dev_err(&pdev->dev,
> "invalid 'default-brightness' value in the device tree\n");
> err = ERR_PTR(-EINVAL);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-13 8:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-08 21:56 [PATCH] cklight: tps65217_bl: Remove unnecessary default brightness check Christos Gkekas
2017-10-09 10:00 ` Daniel Thompson
2017-10-09 16:12 ` Jingoo Han
2017-10-13 8:50 ` Lee Jones
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).