Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp11249747imu; Thu, 6 Dec 2018 14:10:23 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vhh5q0l77QQEv8giFU5I9dHWVJ4gA0/3WnuKxGiicRTK0FjGe8jPcpt5v284z8Z97jxTDP X-Received: by 2002:a62:8985:: with SMTP id n5mr30660367pfk.255.1544134223643; Thu, 06 Dec 2018 14:10:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544134223; cv=none; d=google.com; s=arc-20160816; b=TiRbO2Z2xQmeCCLsotnrfLqypqmgkVLmsPttPqTbR3MpUreNrFvF4ZU+BokULjaXdh Y/xoCjEj8fUf4PHmeHQTAcVFiy9O7pj1MHiCM3yTaKQapDHqASvS6PAuNESX7wMwpbY4 FyHxcx3kMJLsm7vGxNdjmDEnyiBCv3dXnpK5eEVV5VOh39EG4NtdWfB0NDvSZ50VVMH8 bZzq8Ujtp2/bsHrKhH297Yay36jmfUxPOo7ySYVHuOwbZhWun3H3CdScxz9gRFp8nZ9h M6Gqcx5U6BtRF65GgsdFQy8nL6aCgDJLgsZBXSv/DcNsWzCg1w8IAF0DehKX5ng2dmYw NLSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=jMk61PVtVAlXoaebkKs114uDULSl0RSPjulTV1FzaqU=; b=MBd3A3PiGJekpdYWRvd/gxgcKH9bI8IrXpylhR+y16JMGfX8SodZshpSkkUK9+STwr wnkIT+mNKP1448KeX0aAboHjG3qBGGhKDgwnif8NGaPws3reLncq8yrS8BYM55i9UGog 6YsuPV3M7Zsm9w7YjVrDFfYbQfBMJX09q3WNSl+BAZxG351gNJHD338/TDfhRm2x4TrG XV8hpZCSAR2NeQhtNHviAzzBnNQXFIRuZ+HOJZJ7O/1ZadVFWJt4TcbtEWc9PAWBrLkR GJHuAy8qL8RjnabzmfQI6f8ypYs6slUPRkT3KybSgngaTfPgSfqT4jXKZw86stCDgtmK dI8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61si1275362plz.117.2018.12.06.14.10.08; Thu, 06 Dec 2018 14:10:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726139AbeLFWJX (ORCPT + 99 others); Thu, 6 Dec 2018 17:09:23 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:50015 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbeLFWJV (ORCPT ); Thu, 6 Dec 2018 17:09:21 -0500 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 3AE8A809ED; Thu, 6 Dec 2018 23:09:15 +0100 (CET) Date: Thu, 6 Dec 2018 23:09:18 +0100 From: Pavel Machek To: Julia Lawall Cc: Jyri Sarha , Peter Ujfalusi , Jacek Anaszewski , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, kbuild-all@01.org Subject: Re: [PATCH] leds: tlc591xx: fix device_node_continue.cocci warnings (fwd) Message-ID: <20181206220918.GA32650@amd> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu 2018-12-06 21:28:16, Julia Lawall wrote: > Hello, >=20 > The code seems to be wrong in several ways. If the continue is wanted, > the of_node_put is not needed; it will happen on the next iteration. If > the continue is not wanted, the of_node_put is needed, and the continue > should be dropped. Yep, code is confusing. But the patch is bad, we don't want "continue; retu= rn;" Hmm, continue seems more logical to me -- but I guess Jyri should decde? Pavel > ---------- Forwarded message ---------- > Date: Thu, 6 Dec 2018 19:48:54 +0800 > From: kbuild test robot > To: kbuild@01.org > Cc: Julia Lawall > Subject: [PATCH] leds: tlc591xx: fix device_node_continue.cocci warnings >=20 > CC: kbuild-all@01.org > TO: Jyri Sarha > CC: Peter Ujfalusi > CC: Jacek Anaszewski > CC: Pavel Machek > CC: linux-leds@vger.kernel.org > CC: linux-kernel@vger.kernel.org >=20 > From: kbuild test robot >=20 > drivers/leds/leds-tlc591xx.c:342:3-14: ERROR: probable double put. >=20 > Device node iterators put the previous value of the index variable, so an > explicit put causes a double put. >=20 > Generated by: scripts/coccinelle/iterators/device_node_continue.cocci >=20 > Fixes: 7b2d34aaede7 ("leds: tlc591xx: Add gpio output support") > CC: Jyri Sarha > Signed-off-by: kbuild test robot > --- >=20 > tree: https://github.com/omap-audio/linux-audio peter/ti-linux-4.19.y/w= ip > head: 838f24e2deaf1229002bd6555eb7e889b09ac1f9 > commit: 7b2d34aaede727b4abfc78061bbd2202fcd92bc8 [62/67] leds: tlc591xx: = Add gpio output support > :::::: branch date: 26 hours ago > :::::: commit date: 26 hours ago >=20 > Please take the patch only if it's a positive warning. Thanks! >=20 > leds-tlc591xx.c | 1 - > 1 file changed, 1 deletion(-) >=20 > --- a/drivers/leds/leds-tlc591xx.c > +++ b/drivers/leds/leds-tlc591xx.c > @@ -339,7 +339,6 @@ tlc591xx_probe(struct i2c_client *client > for_each_child_of_node(np, child) { > err =3D of_property_read_u32(child, "reg", ®); > if (err) { > - of_node_put(child); > continue; > return err; > } --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --VbJkn9YxBvnuCH5J Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlwJng4ACgkQMOfwapXb+vJvgwCeNZSCkXYhPkheNnMJ4SLmjB01 ZTYAoIbXVR2d3bnSsMgMikgMlOWN6JNJ =VtYE -----END PGP SIGNATURE----- --VbJkn9YxBvnuCH5J--