From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from outbound.pv.icloud.com (p-west1-cluster5-host8-snip4-1.eps.apple.com [57.103.66.242]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBF7F28D845 for ; Mon, 14 Apr 2025 11:10:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=57.103.66.242 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744629048; cv=none; b=ZDuhOMwKUK2+qFrXsZLYRoZ2OMIwociShof8C/OCBpeQpmYxfYcaSyk7bUkOaTydoqB4aJu9XGYgMnLmk6yL3u0QVGsybfaEujCkVJdSkFv4lxtCByhcUfcq+pN2ihtRgulTyuxNXAmDNaxWnqZKS9P4l6uhG6WL2J/bIj5d9S4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744629048; c=relaxed/simple; bh=PafN8z8zHH7ZH29aqmC1CQ1jw5BO3fvA+u2a60KyaHw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=laKGAtBFkeYAD/NfTIPHvOJSnfx2LlRuGnRy0MXdrZh1NYns7fnwf60heRdrZZ+EggsG91d3P8NsqvLJUw2ZenicP9Ie2Pek3ZcIah3DdbyZ/STyBkFtLZVDnDm37sZbUQCawvjwuMM/xWQW7O4jx+HpJ9asmC/ncRqqK/p6TqQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=adC9/XQH; arc=none smtp.client-ip=57.103.66.242 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="adC9/XQH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=MLy5tVDZ36BVgdmmtjXmu/rneKq26t7A9Py8c/K5oEY=; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type:x-icloud-hme; b=adC9/XQHC+DI9Vp03TpQFwbcRQ3tKnSCOUiRGm5/palIrjNErgXcm05ByxPH0roX9 GLS9W7BhW/b1FyCuMBNqndy3ZDYzJaAFi4rrmAdQ+FtU88lPRCFgcV4ijygSmon5rx ZCzvCPTOZjPvirEWTBGDZ8GmCkEyLMLUhu3zDIX5wqCbfGO83XptzHio/iPhnCoYxC ltlyY/qmu75Mk8umVjgRTHUa71KF6HSLiDLR0BbEQDkyLsIfWk1nPKYQnjAhYj68lu QzivVPiUfW5ltT17hRnlI85hWSm+hbf4DFEwIQiGq8fQwUQmm1aUfxj5lFLKyQsYfb Es2BndplLD2OA== Received: from [192.168.1.26] (pv-asmtp-me-k8s.p00.prod.me.com [17.56.9.36]) by outbound.pv.icloud.com (Postfix) with ESMTPSA id 8BA7D1800231; Mon, 14 Apr 2025 11:10:38 +0000 (UTC) Message-ID: <3ae62405-6ebf-4da4-a946-deb74cd4f93e@icloud.com> Date: Mon, 14 Apr 2025 19:10:33 +0800 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 1/2] software node: Add comment for the first ERR_CAST() in fwnode_create_software_node() To: Andy Shevchenko Cc: Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Zijun Hu References: <20250410-fix_swnode-v1-0-081c95cf7cf9@quicinc.com> <20250410-fix_swnode-v1-1-081c95cf7cf9@quicinc.com> Content-Language: en-US From: Zijun Hu In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: MdS5mcPft3y91odE22QgGzxDPsqFDVFy X-Proofpoint-ORIG-GUID: MdS5mcPft3y91odE22QgGzxDPsqFDVFy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1095,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2025-04-14_03,2025-04-10_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 mlxscore=0 malwarescore=0 clxscore=1015 bulkscore=0 spamscore=0 mlxlogscore=686 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2504140081 On 2025/4/14 16:00, Andy Shevchenko wrote: >> From: Zijun Hu >> >> ERR_CAST() is normally used to cast an error-valued pointer type to >> another different type, But the first ERR_CAST() is to cast away the >> const in fwnode_create_software_node(). >> >> Add comment for this unusual ERR_CAST() usage. > ... > >> + /* Only cast away the const by ERR_CAST() */ >> if (IS_ERR(parent)) >> return ERR_CAST(parent); > TBH, I don't see the value of this comment. And looking into the code, I would thank you Andy for comments. will drop this patch in v2. > rather drop this part. The current users do not rely on the any specific code > to be returned and also they check parent to be valid beforehand. > > But let's hear others first.