From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
linux-acpi@vger.kernel.org, linux-media@vger.kernel.org,
Paul Elder <paul.elder@ideasonboard.com>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Julien Stephan <jstephan@baylibre.com>,
devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 1/1] device property: Add fwnode_name_eq()
Date: Tue, 31 Oct 2023 18:32:17 +0200 [thread overview]
Message-ID: <ZUEsEQQTTlXmOHPt@smile.fi.intel.com> (raw)
In-Reply-To: <20231031135306.1106640-1-sakari.ailus@linux.intel.com>
On Tue, Oct 31, 2023 at 03:53:06PM +0200, Sakari Ailus wrote:
> Add fwnode_name_eq() to implement the functionality of of_node_name_eq()
> on fwnode property API. The same convention of ending the comparison at
> '@' (besides '\0') is applied on also both ACPI and swnode. The function
> is intended for comparing unit address-less node names on DT and firmware
> or swnodes compliant with DT bindings.
Some comments below.
...
> Would you be able to use this to replace of_node_name_eq()?
Can you point out to the use case? Maybe it can be rewritten using existing
APIs?
...
> + len = strchrnul(node_name, '@') - node_name;
> + return strlen(name) == len && !strncmp(node_name, name, len);
Seems like this is reimplementation of str_has_prefix().
len = strchrnul(node_name, '@') - node_name;
return str_has_prefix(node_name, name) == len;
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-10-31 16:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 13:53 [PATCH 1/1] device property: Add fwnode_name_eq() Sakari Ailus
2023-10-31 16:32 ` Andy Shevchenko [this message]
2023-10-31 17:19 ` Sakari Ailus
2023-10-31 21:49 ` kernel test robot
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=ZUEsEQQTTlXmOHPt@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jstephan@baylibre.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=paul.elder@ideasonboard.com \
--cc=robh+dt@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