Skip to contentSkip to conversation

leds/powernv : removing NULL check

PATCH Applied Saurabh Sengar 3 participants 5 messages Nov 23, 2015 – Nov 25, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 leds/powernv : removing NULL check

no need to explicitly check for pointer to be null, of_prop_next_string anyways return NULL, if passed pointer is NULL and hence loop will continue

---
 drivers/leds/leds-powernv.c | 2 --
 1 file changed, 2 deletions(-)
drivers/leds/leds-powernv.c +0 -2
index 1e75e1f..bc2d76e 100644
@@ -256,8 +256,6 @@ static int powernv_led_classdev(struct platform_device *pdev,
 
 	for_each_child_of_node(led_node, np) {
 		p = of_find_property(np, "led-types", NULL);
-		if (!p)
-			continue;
 
 		while ((cur = of_prop_next_string(p, cur)) != NULL) {
 			powernv_led = devm_kzalloc(dev, sizeof(*powernv_led),
Signature · 1 line
1.9.1
#1 lore raw
Quoted 15 lines · Saurabh Sengar

no need to explicitly check for pointer to be null, of_prop_next_string anyways return NULL, if passed pointer is NULL and hence loop will continue

---
  drivers/leds/leds-powernv.c | 2 --
  1 file changed, 2 deletions(-)
drivers/leds/leds-powernv.c +0 -0
index 1e75e1f..bc2d76e 100644

drivers/leds/leds-powernv.c static int powernv_led_classdev(struct platform_device *pdev, · line 261

Quoted 8 lines
drivers/leds/leds-powernv.c +0 -2
@@ -256,8 +256,6 @@ static int powernv_led_classdev(struct platform_device *pdev,
 
  	for_each_child_of_node(led_node, np) {
  		p = of_find_property(np, "led-types", NULL);
-		if (!p)
-			continue;
 
  		while ((cur = of_prop_next_string(p, cur)) != NULL) {
  			powernv_led = devm_kzalloc(dev, sizeof(*powernv_led),

Applied, thanks.

Signature · 2 lines
Best Regards,
Jacek Anaszewski
#2 lore raw
In reply to Saurabh Sengar
Quoted 3 lines · Saurabh Sengar

no need to explicitly check for pointer to be null, of_prop_next_string anyways return NULL, if passed pointer is NULL and hence loop will continue

Thanks! Patch looks good.

-Vasant

Acked-by Vasant Hegde
#3 lore raw
Quoted 10 lines · Vasant Hegde
Quoted 3 lines · Saurabh Sengar

no need to explicitly check for pointer to be null, of_prop_next_string anyways return NULL, if passed pointer is NULL and hence loop will continue

Thanks! Patch looks good.

-Vasant

I infer that you offer your:

Can I add it? :)

Signature · 2 lines
Best Regards,
Jacek Anaszewski
#4 lore raw
Quoted 6 lines · Jacek Anaszewski
Quoted 5 lines · Vasant Hegde
Quoted 3 lines · Saurabh Sengar

no need to explicitly check for pointer to be null, of_prop_next_string anyways return NULL, if passed pointer is NULL and hence loop will continue

Quoted 7 lines
Quoted 5 lines

Thanks! Patch looks good.

-Vasant

I infer that you offer your:

Yes.. Forgot to add Ack-by tag.

Quoted 4 lines

Can I add it? :)

Sure. Thanks!

-Vasant