Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp647892lqp; Wed, 22 May 2024 15:51:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFv+zqI657UbBSpDgPSfEUGaknsXFmPIDCpeY+OL2Pk9BDKHnyh7EQfI69sNWl1llGJLvP6GrJyBM3kMdfxG4TewBDE8Yod2mOX+YpjQ== X-Google-Smtp-Source: AGHT+IEQxGSNKUn7YadJEuGtH8VSgkP+PdygeVRi+/rGZVUskkB1CS8Ysgfv5li9LxDh2BXz+oaj X-Received: by 2002:a05:6214:5783:b0:6ab:8a4b:19e9 with SMTP id 6a1803df08f44-6ab8a4b1c0amr19939816d6.10.1716418281916; Wed, 22 May 2024 15:51:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716418281; cv=pass; d=google.com; s=arc-20160816; b=t2FA/ca1skBeq+FVYGSBOejevzsNVIegLBEHsgMQD3upkUs5Qdn3W/Vukf/05BVR95 MtV/hjF2my4gxTRmv3uNItP2VI1mdYKNfuv0/O8aMIXwzS+ZKILOvV5clTLpfCsMreKA TNqiEoW2JHUC7qTmay75FQIWaBc/uNWCUYHwPNjtMgnlTp2qdopjxqqT6X1zKURLOEJC BUjsq57UzY7d6BWZ5Ck4tSB8fXVGrgcoJgRpFtZAWtqoMfFrNTs3Up/ViIvb25HmwugA tJzjq7GPIl5bFfruNihnr0r/7BodVxF6ANavTIBb0qDEMYGA+RozcZf8iNkV6AxO/icn rzzQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=rmJLfKJR+Q2eeJtf3DVr6zWcjm+6oeXAsT8oHQhkVro=; fh=AzpfUCKj397pM+GzGdByP4I/9URdflsdQg3vT6Zh5GM=; b=i84Q2jslZwb+CGItl+x26cgC2KeiAgV+cPZpSGTjFNKV/SVHyvVRx2jeZvR2BtH31M Rta4s63wFQvImzli8S3XTu9UJiJckTU8mVK47DsqnnPkXcT+3PSH1ZhpJjLQWEIPHZ3s eAhSVLUjsuQbZYlplYRHYEG6XLU3rg9GVHb+Uhcq80Ga3Yma15larulZgfZ/xvtjiRLw bYnNA43dMZA03xVipp8BOsWlgjdIXKyXIZiJZXDxTCLRhTH6aMOfA0fFX9FqIj5jgxau 8zl1jtJCC5eZJ2vHCbxwI+7PLva4YDkFA4DZ8oa31cV7p0DlRMIYwEfsVeNr71TfkCNJ yLuQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KXihOJVa; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-186791-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186791-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6ab1ff8b23bsi76916856d6.297.2024.05.22.15.51.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 15:51:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186791-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=KXihOJVa; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-186791-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186791-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 971031C21B7F for ; Wed, 22 May 2024 22:51:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7704C1494B6; Wed, 22 May 2024 22:51:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KXihOJVa" Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF10B81AC6; Wed, 22 May 2024 22:51:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716418273; cv=none; b=mHoc44w1yafix+SY1i2l64ZpAP3qFzADqQBlXpMUpbOY7S3QpuHSuDztVNiXkRvj41SMANoezSrF+foZoympKVFITgGTKdiWIE1vRlp7+SuyKUGH5izn964UPnScG6dkBCg5XJZ22LU9YwhJoOIRmfN4ntzam6MXOFnzQrVZ6T0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716418273; c=relaxed/simple; bh=jPpl63O0p6Rp21ZrFjNcB9apG31h1Zk+5mFlFQjc6Q0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DDgJ3KqpaoFDAjQu4FPLab1AyERZsuYgUN8Ia1evcFTZmxqKkHvNhM6Y2rqHvpASGACJE5TioTr53rj+cyX4S+XWGpRBGQCVfdI0BRBbflGXQsK3U4dlv6MzpIFuD+4ZXNYY0nrCygGav24ruVwLHNuw08eJrV9OhfODgQVUF8w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KXihOJVa; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1ee5235f5c9so115407835ad.2; Wed, 22 May 2024 15:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716418271; x=1717023071; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=rmJLfKJR+Q2eeJtf3DVr6zWcjm+6oeXAsT8oHQhkVro=; b=KXihOJVaGQ08lAKLSKKNyiZ9DbJZ7Y4YomqtPE/WcqtRpDlALYoCXFC7p7L4pCAenc DJS21B5j6PgRqsLe/+V0qEVP2+7JCxN99/Rms8mgnvOo6GdjIcao6seXPmYqzxL8Ax+F MJSgcjpSY/gzEL56+lROWgymHnp0GnbNYfpahdIDj7WjKWJ2l4vecQzYmjwcw9sLW4dN BvFAVDSPYAkSKZxwvPZjUiWb0NMhGdLKym6n1BHajgoRDpGkT6A0yQoMBJbxlkFVZKcd TEg4rJiINePKz1hS779xFkOs8YJFRXnNI0JF5IJ+rH6sIGLEXDA808i170506iLuSZhV ZhjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716418271; x=1717023071; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rmJLfKJR+Q2eeJtf3DVr6zWcjm+6oeXAsT8oHQhkVro=; b=rRRFXKRyURQSzMNy127Bj2IBwQJuQgBqRW6l9uHgybIGvN0wVFgg/wFpExkPodhufv iEqMjiHLOaXJm9AAXU0ytbXt1mCugkP8zfdNqVwiqcpemp3iD0yMlQbUsdLvjW8+HvEH HmL8O5poZ1pog28dpPrrdIx1tJW9fyIBt+GTb7zOn4CifZdn2KwQ6fdRVj/3/vqEU2ut /6dPCrwBeqrQwU6GpJ7y64Qi32AmlBeVm2HXa7KFF1KbzKi4HIfgok2H0ii4IDGav+gM 5gCnZ8MxCxOHORxZHghjYTpBs0tuw4C3Z5LngM1IHShF9TiWmg+hdMriFNp76MsSohiY pmHA== X-Forwarded-Encrypted: i=1; AJvYcCWgZAXJPXdLI0AO/Gy1PfaiFPi24Mw7PxMhxq08Ps05k9v1krJDFXr5eMDP7Fe39q8xxPCCjYym+3tLz+J6jb3KILIUVkfo4gfZ+Jkn8i6pQCya3fnySKkrKb8VoriqesisO4WTeIvmLYQ= X-Gm-Message-State: AOJu0YxVzrq32+4KWgMUfspO4p1ByZ1+vNbnMJRAEybyZ3QMFQcM64ob E//lxfPOe3ZzZn06mtw9hKGayCIAJ/FRyBOPPEqfxQB3kaYcr085d3lR2w== X-Received: by 2002:a17:902:e84c:b0:1f3:35e8:d315 with SMTP id d9443c01a7336-1f335e8d5f2mr12779395ad.63.1716418271124; Wed, 22 May 2024 15:51:11 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f33d551493sm1023955ad.13.2024.05.22.15.51.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 May 2024 15:51:10 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Wed, 22 May 2024 15:51:08 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] hwmon: (ltc2992) use fwnode_for_each_available_child_node_scoped() To: Javier Carrasco , Greg Kroah-Hartman , "Rafael J. Wysocki" , Andy Shevchenko , Daniel Scally , Heikki Krogerus , Sakari Ailus , Jean Delvare , Antoniu Miclaus , Jonathan Cameron Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org References: <20240522-fwnode_for_each_available_child_node_scoped-v1-0-1188b0da12dc@gmail.com> <20240522-fwnode_for_each_available_child_node_scoped-v1-2-1188b0da12dc@gmail.com> <57645247-fb14-4180-bef0-1638e9f522fe@roeck-us.net> <97567de0-895d-4a23-907f-506551e86362@gmail.com> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy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EOeIMk7Rj trjv82EZtrhLuLjHRCaG50OOm0hwPSk1J64R8O3HjSLdertmw7eyAYOo4RuWJguYMg5DRnBk WkRwrSuCn7UG+qVWZeKEsFKFOkynOs3pVbcbq1pxbhk3TRWCGRU5JolI4ohy/7JV1TVbjiDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <97567de0-895d-4a23-907f-506551e86362@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/22/24 12:46, Javier Carrasco wrote: > On 22/05/2024 21:08, Guenter Roeck wrote: >> On 5/22/24 02:18, Javier Carrasco wrote: >>> The error path from a zero value of the "shunt-resistor-micro-ohms" >>> property does not decrement the refcount of the child node. >>> >>> Instead of adding the missing fwnode_handle_put(), a safer fix for >>> future modifications is using the _scoped version of the macro, >>> which removes the need for fwnode_handle_put() in all error paths. >>> >>> The macro defines the child node internally, which removes the need for >>> the current child node declaration as well. >>> >>> Fixes: 10b029020487 ("hwmon: (ltc2992) Avoid division by zero") >>> Signed-off-by: Javier Carrasco >> >> I really don't like fixes which depend on an API change. >> >> Guenter >> > > We could split the fix into two steps as suggested by Andy, where the > fix would simply add the missing fwnode_handle_put(), adding the > corresponding tag to include it in the stable kernels (the bug was > introduced with v6.7). By doing that, the new macro would not need to be > backported, which is probably a safer approach. > > The patch with the new macro would be left as it is, and another patch > would convert the the loop to use the new macro to avoid that a similar > bug arises again. That would be this 2/2 + dropping the additional > fwnode_handle_put(). > Please do. Thanks, Guenter > Best regards, > Javier Carrasco >