lkml.org 
[lkml]   [2015]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] leds/powernv : removing NULL check
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


\
 
 \ /
  Last update: 2015-11-23 14:01    [W:0.051 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site