From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756089AbcAZGzg (ORCPT ); Tue, 26 Jan 2016 01:55:36 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:33789 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750797AbcAZGzc (ORCPT ); Tue, 26 Jan 2016 01:55:32 -0500 X-AuditID: cbfec7f5-f79b16d000005389-9f-56a71861c5c7 Subject: Re: [PATCH] media: platform: exynos4-is: media-dev: Add missing of_node_put To: Julia Lawall References: <20160125152136.GA19484@amitoj-Inspiron-3542> <56A6BCC3.8040407@samsung.com> Cc: Amitoj Kaur Chawla , kyungmin.park@samsung.com, s.nawrocki@samsung.com, mchehab@osg.samsung.com, kgene@kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org From: Krzysztof Kozlowski Message-id: <56A7185F.7020207@samsung.com> Date: Tue, 26 Jan 2016 15:55:27 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCLMWRmVeSWpSXmKPExsVy+t/xq7qJEsvDDDoblS0e/VrEZrHswWlG i9cvDC36H79mtjjb9IbdYtPja6wWl3fNYbPo2bCV1WLG+X1MFqufVVgcftPO6sDtsXPWXXaP Tas62Tz2bsny2Lyk3mNLP1Ckb8sqRo/Pm+QC2KO4bFJSczLLUov07RK4MhbPaGcr+M5bsevG MfYGxmbuLkZODgkBE4mnB7YxQthiEhfurWfrYuTiEBJYyiix4c43JgjnKaPEvhWTgRwODmGB MIkjXwxBTBEBdYneD7kQJTMZJZ7N38UK4jALTGWSuP9lD9hUNgFjic3Ll7CB2LwCWhJNZ3+y gNgsAqoSHU37mUFsUYEIicOdXewQNYISPybfA6vhFPCU6JjzAWwvs4CexP2LWiBhZgF5ic1r 3jJPYBSYhaRjFkLVLCRVCxiZVzGKppYmFxQnpeca6RUn5haX5qXrJefnbmKExMXXHYxLj1kd YhTgYFTi4eUsXhYmxJpYVlyZe4hRgoNZSYRXiXd5mBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHe mbvehwgJpCeWpGanphakFsFkmTg4pRoYt096ZVL4am2Jj6PiDIZsqfhTG0+Y+s8813RGwXod h/t53qUezkcOfGOUXpJxe7NM4x8LhmSFLhHH/dfVDnMd4tq2lUGdrfaIpbfXx/iVLksrskK0 l4lYpfG9+Wsd+oKzM/yXSGfvMqmQ/+G14Y0LJkmbCjWuzX3gPP/DkRWLA6urZ5pf+NOkxFKc kWioxVxUnAgAgwkwN4cCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26.01.2016 15:24, Julia Lawall wrote: > > > On Tue, 26 Jan 2016, Krzysztof Kozlowski wrote: > >> On 26.01.2016 00:21, Amitoj Kaur Chawla wrote: >>> for_each_available_child_of_node and for_each_child_of_node perform an >>> of_node_get on each iteration, so to break out of the loop an of_node_put is >>> required. >>> >>> Found using Coccinelle. The simplified version of the semantic patch >>> that is used for this is as follows: >>> >>> // >>> @@ >>> local idexpression n; >>> expression e,r; >>> @@ >>> >>> for_each_available_child_of_node(r,n) { >>> ... >>> ( >>> of_node_put(n); >>> | >>> e = n >>> | >>> + of_node_put(n); >>> ? break; >>> ) >>> ... >>> } >>> ... when != n >>> // >> >> Patch iselft looks correct but why are you pasting coccinelle script >> into the message? >> >> The script is already present in Linux kernel: >> scripts/coccinelle/iterators/device_node_continue.cocci > > I don't think so. The continue one takes care of the case where there is > an extraneous of_node_put before a continue, not a missing one before a > break. But OK to drop it if it doesn't seem useful. > > julia You are right - this is not covered by that cocci patch... but I think is covered by scripts/coccinelle/iterators/fen.cocci, isn't it? BR, Krzysztof > >> This just extends the commit message without any meaningful data so with >> removal of coccinelle script above: >> Reviewed-by: Krzysztof Kozlowski >> >> Best regards, >> Krzysztof >> >>> >>> Signed-off-by: Amitoj Kaur Chawla >>> --- >>> drivers/media/platform/exynos4-is/media-dev.c | 12 +++++++++--- >>> 1 file changed, 9 insertions(+), 3 deletions(-)