All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] leds/powernv : removing NULL check
@ 2015-11-23  9:28 Saurabh Sengar
  2015-11-23 12:37 ` Jacek Anaszewski
  2015-11-25 14:44 ` Vasant Hegde
  0 siblings, 2 replies; 5+ messages in thread
From: Saurabh Sengar @ 2015-11-23  9:28 UTC (permalink / raw)
  To: rpurdie, j.anaszewski, linux-leds, linux-kernel; +Cc: 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

Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
---
 drivers/leds/leds-powernv.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/leds/leds-powernv.c b/drivers/leds/leds-powernv.c
index 1e75e1f..bc2d76e 100644
--- a/drivers/leds/leds-powernv.c
+++ b/drivers/leds/leds-powernv.c
@@ -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),
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] leds/powernv : removing NULL check
  2015-11-23  9:28 [PATCH] leds/powernv : removing NULL check Saurabh Sengar
@ 2015-11-23 12:37 ` Jacek Anaszewski
  2015-11-25 14:44 ` Vasant Hegde
  1 sibling, 0 replies; 5+ messages in thread
From: Jacek Anaszewski @ 2015-11-23 12:37 UTC (permalink / raw)
  To: Saurabh Sengar; +Cc: rpurdie, linux-leds, linux-kernel

On 11/23/2015 10:28 AM, Saurabh Sengar wrote:
> 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
>
> Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
> ---
>   drivers/leds/leds-powernv.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/drivers/leds/leds-powernv.c b/drivers/leds/leds-powernv.c
> index 1e75e1f..bc2d76e 100644
> --- a/drivers/leds/leds-powernv.c
> +++ b/drivers/leds/leds-powernv.c
> @@ -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.

-- 
Best Regards,
Jacek Anaszewski

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] leds/powernv : removing NULL check
  2015-11-23  9:28 [PATCH] leds/powernv : removing NULL check Saurabh Sengar
  2015-11-23 12:37 ` Jacek Anaszewski
@ 2015-11-25 14:44 ` Vasant Hegde
  2015-11-25 15:17   ` Jacek Anaszewski
  1 sibling, 1 reply; 5+ messages in thread
From: Vasant Hegde @ 2015-11-25 14:44 UTC (permalink / raw)
  To: Saurabh Sengar, rpurdie, j.anaszewski, linux-leds, linux-kernel

On 11/23/2015 02:58 PM, Saurabh Sengar wrote:
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] leds/powernv : removing NULL check
  2015-11-25 14:44 ` Vasant Hegde
@ 2015-11-25 15:17   ` Jacek Anaszewski
  2015-11-25 16:42     ` Vasant Hegde
  0 siblings, 1 reply; 5+ messages in thread
From: Jacek Anaszewski @ 2015-11-25 15:17 UTC (permalink / raw)
  To: Vasant Hegde; +Cc: Saurabh Sengar, rpurdie, linux-leds, linux-kernel

On 11/25/2015 03:44 PM, Vasant Hegde wrote:
> On 11/23/2015 02:58 PM, Saurabh Sengar wrote:
>> 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:

Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

Can I add it? :)

-- 
Best Regards,
Jacek Anaszewski

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] leds/powernv : removing NULL check
  2015-11-25 15:17   ` Jacek Anaszewski
@ 2015-11-25 16:42     ` Vasant Hegde
  0 siblings, 0 replies; 5+ messages in thread
From: Vasant Hegde @ 2015-11-25 16:42 UTC (permalink / raw)
  To: Jacek Anaszewski; +Cc: Saurabh Sengar, rpurdie, linux-leds, linux-kernel

On 11/25/2015 08:47 PM, Jacek Anaszewski wrote:
> On 11/25/2015 03:44 PM, Vasant Hegde wrote:
>> On 11/23/2015 02:58 PM, Saurabh Sengar wrote:
>>> 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:

Yes.. Forgot to add Ack-by tag.

> 
> Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> 
> Can I add it? :)

Sure. Thanks!

-Vasant

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-11-25 16:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-23  9:28 [PATCH] leds/powernv : removing NULL check Saurabh Sengar
2015-11-23 12:37 ` Jacek Anaszewski
2015-11-25 14:44 ` Vasant Hegde
2015-11-25 15:17   ` Jacek Anaszewski
2015-11-25 16:42     ` Vasant Hegde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.