Linux LED subsystem development
 help / color / mirror / Atom feed
From: Jacek Anaszewski <jacek.anaszewski@gmail.com>
To: Julia Lawall <julia.lawall@lip6.fr>,
	Joachim Eastwood <manabian@gmail.com>
Cc: Riku Voipio <riku.voipio@iki.fi>,
	Richard Purdie <rpurdie@rpsys.net>, Pavel Machek <pavel@ucw.cz>,
	linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
	kbuild-all@01.org
Subject: Re: [PATCH] leds: pca9532: fix device_node_continue.cocci warnings
Date: Thu, 29 Dec 2016 22:34:47 +0100	[thread overview]
Message-ID: <963119a2-efe4-86ef-16a8-85e5f4487b66@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1612292207390.2245@hadrien>

Hi Julia,

This patch doesn't apply to current for-next branch
of linux-leds.git.

Best regards,
Jacek Anaszewski

On 12/29/2016 10:10 PM, Julia Lawall wrote:
> Device node iterators put the previous value of the index variable, so an
> explicit put causes a double put.
> 
> Generated by: scripts/coccinelle/iterators/device_node_continue.cocci
> 
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
> 
> I haven't looked at the context in detail, but given the rule, I assume
> that there is an iterator, such as for_each_child_of_node, and these
> iterators do a put on each iteration, so none is needed in the loop body.
> 
> tree:   https://github.com/manabian/linux-lpc lpc18xx_43xx_devel
> head:   9ee5f58bbb16c08da223c4b4933457e0eb72268d
> commit: c58957273142be779f62c17fae389ce9c134139f [44/55] leds: pca9532: use
> 
>  leds-pca9532.c |    3 ---
>  1 file changed, 3 deletions(-)
> 
> --- a/drivers/leds/leds-pca9532.c
> +++ b/drivers/leds/leds-pca9532.c
> @@ -473,7 +473,6 @@ pca9532_of_populate_pdata(struct device
> 
>  		res = of_property_read_u32(child, "reg", &reg);
>  		if ((res != 0) || (reg >= maxleds)) {
> -			of_node_put(child);
>  			continue;
>  		}
> 
> @@ -484,8 +483,6 @@ pca9532_of_populate_pdata(struct device
>  		of_property_read_u32(child, "type", &pdata->leds[reg].type);
>  		of_property_read_string(child, "linux,default-trigger",
>  					&pdata->leds[reg].default_trigger);
> -
> -		of_node_put(child);
>  	}
> 
>  	return pdata;
> 

  reply	other threads:[~2016-12-29 21:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-29 21:10 [PATCH] leds: pca9532: fix device_node_continue.cocci warnings Julia Lawall
2016-12-29 21:34 ` Jacek Anaszewski [this message]
2016-12-29 21:39   ` Julia Lawall
2016-12-30 14:05     ` Jacek Anaszewski
2016-12-30 16:24       ` Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=963119a2-efe4-86ef-16a8-85e5f4487b66@gmail.com \
    --to=jacek.anaszewski@gmail.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=manabian@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=riku.voipio@iki.fi \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox