Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752921AbbKWMhr (ORCPT ); Mon, 23 Nov 2015 07:37:47 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:13933 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752243AbbKWMhp (ORCPT ); Mon, 23 Nov 2015 07:37:45 -0500 X-AuditID: cbfec7f4-f79026d00000418a-68-5653089750e9 Message-id: <56530896.2050802@samsung.com> Date: Mon, 23 Nov 2015 13:37:42 +0100 From: Jacek Anaszewski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-version: 1.0 To: Saurabh Sengar Cc: rpurdie@rpsys.net, linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] leds/powernv : removing NULL check References: <1448270896-23955-1-git-send-email-saurabh.truth@gmail.com> In-reply-to: <1448270896-23955-1-git-send-email-saurabh.truth@gmail.com> Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrILMWRmVeSWpSXmKPExsVy+t/xq7rTOYLDDBZP5LO4vGsOm8XWN+sY LXbvespqseOWgAOLx85Zd9k99sz/werxeZNcAHMUl01Kak5mWWqRvl0CV8bR9o1MBavYKxo/ zWFrYPzF2sXIySEhYCLR83wWO4QtJnHh3nq2LkYuDiGBpYwSW74+ZoVwnjFKTF2+gw2kildA S2LD8ZVMXYwcHCwCqhJ3r3qBhNkEDCV+vnjNBGKLCkRI/Dm9jxWiXFDix+R7LCC2iICOxP9j 9xhBbGYBf4nVr2cxg9jCAuYSe88+BrOFBNwl1hx6BnYQp4CHxLyFzewQ9dYSKydtg+qVl9i8 5i3zBEaBWUhWzEJSNgtJ2QJG5lWMoqmlyQXFSem5hnrFibnFpXnpesn5uZsYIQH7ZQfj4mNW hxgFOBiVeHg19IPChFgTy4orcw8xSnAwK4nwHtkKFOJNSaysSi3Kjy8qzUktPsQozcGiJM47 d9f7ECGB9MSS1OzU1ILUIpgsEwenVANjzpMjPl4b/1/pvOvzSvjlK7kX+/7+FZm99Emjwv5d S06cSP/t8OF7teK7JYInPoUlzzi0VcwxZNpvG/lnhjOv5X6IjGpzWee7tzo0XkMzS3xBaXCz oGF5CsOT2hip9GeFHc/3vXHuP9uzMfl/Q13cTA2DB6ul7mlsDJqeesCnuPSCyBFtx9AeJZbi jERDLeai4kQAHGBf11QCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1153 Lines: 35 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 > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/