All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] leds: pwm: Remove a warning on non-DT platforms
@ 2013-12-12  0:11 Olof Johansson
  2013-12-12 17:35 ` Bryan Wu
  0 siblings, 1 reply; 2+ messages in thread
From: Olof Johansson @ 2013-12-12  0:11 UTC (permalink / raw)
  To: cooloney; +Cc: rpurdie, linux-leds, linux-kernel, Olof Johansson

This removes a warning on non-DT-enabled platforms:

drivers/leds/leds-pwm.c: In function 'led_pwm_create_of':
drivers/leds/leds-pwm.c:88:22: warning: unused variable 'node'

Really caused by the local variable that is assigned to and then never
used. Just do away with the local var, it's not needed.

Technically this code path can never be entered without DT enabled,
since there's an earlier check about number of children in the calling
function, but the compiler can't see that.

Signed-off-by: Olof Johansson <olof@lixom.net>
---
 drivers/leds/leds-pwm.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index b31d8e99..bf49547 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -85,11 +85,10 @@ static inline size_t sizeof_pwm_leds_priv(int num_leds)
 static int led_pwm_create_of(struct platform_device *pdev,
 			     struct led_pwm_priv *priv)
 {
-	struct device_node *node = pdev->dev.of_node;
 	struct device_node *child;
 	int ret;
 
-	for_each_child_of_node(node, child) {
+	for_each_child_of_node(pdev->dev.of_node, child) {
 		struct led_pwm_data *led_dat = &priv->leds[priv->num_leds];
 
 		led_dat->cdev.name = of_get_property(child, "label",
-- 
1.7.10.4

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

* Re: [PATCH] leds: pwm: Remove a warning on non-DT platforms
  2013-12-12  0:11 [PATCH] leds: pwm: Remove a warning on non-DT platforms Olof Johansson
@ 2013-12-12 17:35 ` Bryan Wu
  0 siblings, 0 replies; 2+ messages in thread
From: Bryan Wu @ 2013-12-12 17:35 UTC (permalink / raw)
  To: Olof Johansson; +Cc: rpurdie, Linux LED Subsystem, lkml

On Wed, Dec 11, 2013 at 4:11 PM, Olof Johansson <olof@lixom.net> wrote:
> This removes a warning on non-DT-enabled platforms:
>
> drivers/leds/leds-pwm.c: In function 'led_pwm_create_of':
> drivers/leds/leds-pwm.c:88:22: warning: unused variable 'node'
>
> Really caused by the local variable that is assigned to and then never
> used. Just do away with the local var, it's not needed.
>
> Technically this code path can never be entered without DT enabled,
> since there's an earlier check about number of children in the calling
> function, but the compiler can't see that.
>

Great, actually we got an 0-Day kbuild warning about this. I'll merge
this fixing.

Thanks,
-Bryan

> Signed-off-by: Olof Johansson <olof@lixom.net>
> ---
>  drivers/leds/leds-pwm.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
> index b31d8e99..bf49547 100644
> --- a/drivers/leds/leds-pwm.c
> +++ b/drivers/leds/leds-pwm.c
> @@ -85,11 +85,10 @@ static inline size_t sizeof_pwm_leds_priv(int num_leds)
>  static int led_pwm_create_of(struct platform_device *pdev,
>                              struct led_pwm_priv *priv)
>  {
> -       struct device_node *node = pdev->dev.of_node;
>         struct device_node *child;
>         int ret;
>
> -       for_each_child_of_node(node, child) {
> +       for_each_child_of_node(pdev->dev.of_node, child) {
>                 struct led_pwm_data *led_dat = &priv->leds[priv->num_leds];
>
>                 led_dat->cdev.name = of_get_property(child, "label",
> --
> 1.7.10.4
>

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

end of thread, other threads:[~2013-12-12 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-12  0:11 [PATCH] leds: pwm: Remove a warning on non-DT platforms Olof Johansson
2013-12-12 17:35 ` Bryan Wu

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.