From: Zijun Hu <zijun_hu@icloud.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Daniel Scally <djrscally@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Danilo Krummrich <dakr@kernel.org>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
Zijun Hu <quic_zijuhu@quicinc.com>
Subject: Re: [PATCH 1/2] software node: Add comment for the first ERR_CAST() in fwnode_create_software_node()
Date: Mon, 14 Apr 2025 19:10:33 +0800 [thread overview]
Message-ID: <3ae62405-6ebf-4da4-a946-deb74cd4f93e@icloud.com> (raw)
In-Reply-To: <Z_zAo3PTEWH9nkTt@smile.fi.intel.com>
On 2025/4/14 16:00, Andy Shevchenko wrote:
>> From: Zijun Hu <quic_zijuhu@quicinc.com>
>>
>> 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.
next prev parent reply other threads:[~2025-04-14 11:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 13:12 [PATCH 0/2] software node: bug fixes Zijun Hu
2025-04-10 13:12 ` [PATCH 1/2] software node: Add comment for the first ERR_CAST() in fwnode_create_software_node() Zijun Hu
2025-04-14 8:00 ` Andy Shevchenko
2025-04-14 11:10 ` Zijun Hu [this message]
2025-04-10 13:12 ` [PATCH 2/2] software node: Correct a OOB check in software_node_get_reference_args() Zijun Hu
2025-04-14 8:08 ` Andy Shevchenko
2025-04-14 11:12 ` Zijun Hu
2025-04-15 6:42 ` Andy Shevchenko
2025-04-14 8:45 ` Sakari Ailus
2025-04-14 7:23 ` [PATCH 0/2] software node: bug fixes Andy Shevchenko
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=3ae62405-6ebf-4da4-a946-deb74cd4f93e@icloud.com \
--to=zijun_hu@icloud.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dakr@kernel.org \
--cc=djrscally@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_zijuhu@quicinc.com \
--cc=rafael@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/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
all inboxes | Powered by JetHome®