* [PATCH v1 1/1] device property: Constify a few fwnode APIs
@ 2023-03-24 11:27 Andy Shevchenko
2023-03-24 18:21 ` Sakari Ailus
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2023-03-24 11:27 UTC (permalink / raw)
To: Andy Shevchenko, Sakari Ailus, Greg Kroah-Hartman, linux-acpi,
linux-kernel
Cc: Daniel Scally, Heikki Krogerus, Rafael J. Wysocki, Russell King
The fwnode parameter is not altered in the following APIs:
- fwnode_get_next_parent_dev()
- fwnode_is_ancestor_of()
- fwnode_graph_get_endpoint_count()
so constify them.
Reported-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/base/property.c | 6 +++---
include/linux/property.h | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/base/property.c b/drivers/base/property.c
index 3fc25e568598..b19ca8f752a8 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -648,7 +648,7 @@ EXPORT_SYMBOL_GPL(fwnode_get_next_parent);
*
* Return: a pointer to the device of the @fwnode's closest ancestor.
*/
-struct device *fwnode_get_next_parent_dev(struct fwnode_handle *fwnode)
+struct device *fwnode_get_next_parent_dev(const struct fwnode_handle *fwnode)
{
struct fwnode_handle *parent;
struct device *dev;
@@ -718,7 +718,7 @@ EXPORT_SYMBOL_GPL(fwnode_get_nth_parent);
*
* Return: true if @ancestor is an ancestor of @child. Otherwise, returns false.
*/
-bool fwnode_is_ancestor_of(struct fwnode_handle *ancestor, struct fwnode_handle *child)
+bool fwnode_is_ancestor_of(const struct fwnode_handle *ancestor, const struct fwnode_handle *child)
{
struct fwnode_handle *parent;
@@ -1235,7 +1235,7 @@ EXPORT_SYMBOL_GPL(fwnode_graph_get_endpoint_by_id);
* If FWNODE_GRAPH_DEVICE_DISABLED flag is specified, also unconnected endpoints
* and endpoints connected to disabled devices are counted.
*/
-unsigned int fwnode_graph_get_endpoint_count(struct fwnode_handle *fwnode,
+unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode,
unsigned long flags)
{
struct fwnode_handle *ep;
diff --git a/include/linux/property.h b/include/linux/property.h
index 9c774b0fe5bd..8ba804721fdf 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -104,11 +104,11 @@ struct fwnode_handle *fwnode_get_next_parent(struct fwnode_handle *fwnode);
for (parent = fwnode_get_parent(fwnode); parent; \
parent = fwnode_get_next_parent(parent))
-struct device *fwnode_get_next_parent_dev(struct fwnode_handle *fwnode);
+struct device *fwnode_get_next_parent_dev(const struct fwnode_handle *fwnode);
unsigned int fwnode_count_parents(const struct fwnode_handle *fwn);
struct fwnode_handle *fwnode_get_nth_parent(struct fwnode_handle *fwn,
unsigned int depth);
-bool fwnode_is_ancestor_of(struct fwnode_handle *ancestor, struct fwnode_handle *child);
+bool fwnode_is_ancestor_of(const struct fwnode_handle *ancestor, const struct fwnode_handle *child);
struct fwnode_handle *fwnode_get_next_child_node(
const struct fwnode_handle *fwnode, struct fwnode_handle *child);
struct fwnode_handle *fwnode_get_next_available_child_node(
@@ -432,7 +432,7 @@ static inline bool fwnode_graph_is_endpoint(const struct fwnode_handle *fwnode)
struct fwnode_handle *
fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,
u32 port, u32 endpoint, unsigned long flags);
-unsigned int fwnode_graph_get_endpoint_count(struct fwnode_handle *fwnode,
+unsigned int fwnode_graph_get_endpoint_count(const struct fwnode_handle *fwnode,
unsigned long flags);
#define fwnode_graph_for_each_endpoint(fwnode, child) \
--
2.40.0.1.gaa8946217a0b
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1 1/1] device property: Constify a few fwnode APIs
2023-03-24 11:27 [PATCH v1 1/1] device property: Constify a few fwnode APIs Andy Shevchenko
@ 2023-03-24 18:21 ` Sakari Ailus
0 siblings, 0 replies; 2+ messages in thread
From: Sakari Ailus @ 2023-03-24 18:21 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Greg Kroah-Hartman, linux-acpi, linux-kernel, Daniel Scally,
Heikki Krogerus, Rafael J. Wysocki, Russell King
On Fri, Mar 24, 2023 at 01:27:20PM +0200, Andy Shevchenko wrote:
> The fwnode parameter is not altered in the following APIs:
>
> - fwnode_get_next_parent_dev()
> - fwnode_is_ancestor_of()
> - fwnode_graph_get_endpoint_count()
>
> so constify them.
>
> Reported-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Thanks, Andy!
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
--
Sakari Ailus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-24 18:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 11:27 [PATCH v1 1/1] device property: Constify a few fwnode APIs Andy Shevchenko
2023-03-24 18:21 ` Sakari Ailus
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.