diff mbox

cklight: tps65217_bl: Remove unnecessary default brightness check

Message ID 1507499808-12896-1-git-send-email-chris.gekas@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Christos Gkekas Oct. 8, 2017, 9:56 p.m. UTC
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(-)

Comments

Daniel Thompson Oct. 9, 2017, 10 a.m. UTC | #1
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);
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Han Jingoo Oct. 9, 2017, 4:12 p.m. UTC | #2
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


--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lee Jones Oct. 13, 2017, 8:50 a.m. UTC | #3
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);
diff mbox

Patch

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);