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


Groups > linux.kernel > #1687909 > unrolled thread

[PATCH 1/2 v2] leds: tlc591xx: merge conditional tests

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2017-07-15 12:30 +0200
Last post2017-07-15 12:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2 v2] leds: tlc591xx: merge conditional tests Julia Lawall <Julia.Lawall@lip6.fr> - 2017-07-15 12:30 +0200

#1687909 — [PATCH 1/2 v2] leds: tlc591xx: merge conditional tests

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-07-15 12:30 +0200
Subject[PATCH 1/2 v2] leds: tlc591xx: merge conditional tests
Message-ID<u3suK-gI-3@gated-at.bofh.it>
Merge conditionals that have the same then branch, to prepare for extending
that branch with of_node_put.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/leds/leds-tlc591xx.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/leds/leds-tlc591xx.c b/drivers/leds/leds-tlc591xx.c
index 30453164..fcc87ee 100644
--- a/drivers/leds/leds-tlc591xx.c
+++ b/drivers/leds/leds-tlc591xx.c
@@ -232,9 +232,8 @@ struct tlc591xx {
 		err = of_property_read_u32(child, "reg", &reg);
 		if (err)
 			return err;
-		if (reg < 0 || reg >= tlc591xx->max_leds)
-			return -EINVAL;
-		if (priv->leds[reg].active)
+		if (reg < 0 || reg >= tlc591xx->max_leds ||
+		    priv->leds[reg].active)
 			return -EINVAL;
 		priv->leds[reg].active = true;
 		priv->leds[reg].ldev.name =

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web