linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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

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