diff mbox series

[2/7] logic_pio: Constify fwnode_handle

Message ID 20241010-dt-const-v1-2-87a51f558425@kernel.org (mailing list archive)
State New
Delegated to: Rob Herring
Headers show
Series of: Constify DT structs | expand

Commit Message

Rob Herring (Arm) Oct. 10, 2024, 4:27 p.m. UTC
The fwnode_handle passed into find_io_range_by_fwnode() and
logic_pio_trans_hwaddr() are not modified, so make them const.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
Please ack and I'll take with the rest of the series.
---
 include/linux/logic_pio.h | 6 +++---
 lib/logic_pio.c           | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Krzysztof Kozlowski Oct. 11, 2024, 2:59 p.m. UTC | #1
On Thu, Oct 10, 2024 at 11:27:15AM -0500, Rob Herring (Arm) wrote:
> The fwnode_handle passed into find_io_range_by_fwnode() and
> logic_pio_trans_hwaddr() are not modified, so make them const.
> 
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> Please ack and I'll take with the rest of the series.

Now I see. This one should be before #1.

Best regards,
Krzysztof
Rob Herring (Arm) Oct. 11, 2024, 3:08 p.m. UTC | #2
On Fri, Oct 11, 2024 at 9:59 AM Krzysztof Kozlowski <krzk@kernel.org> wrote:
>
> On Thu, Oct 10, 2024 at 11:27:15AM -0500, Rob Herring (Arm) wrote:
> > The fwnode_handle passed into find_io_range_by_fwnode() and
> > logic_pio_trans_hwaddr() are not modified, so make them const.
> >
> > Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> > ---
> > Please ack and I'll take with the rest of the series.
>
> Now I see. This one should be before #1.

Yes, you are right. Will swap 1 and 2 when applying.

Rob
diff mbox series

Patch

diff --git a/include/linux/logic_pio.h b/include/linux/logic_pio.h
index babf4e3c28ba..8f1a9408302f 100644
--- a/include/linux/logic_pio.h
+++ b/include/linux/logic_pio.h
@@ -17,7 +17,7 @@  enum {
 
 struct logic_pio_hwaddr {
 	struct list_head list;
-	struct fwnode_handle *fwnode;
+	const struct fwnode_handle *fwnode;
 	resource_size_t hw_start;
 	resource_size_t io_start;
 	resource_size_t size; /* range size populated */
@@ -110,8 +110,8 @@  void logic_outsl(unsigned long addr, const void *buffer, unsigned int count);
 #endif /* CONFIG_INDIRECT_PIO */
 #define MMIO_UPPER_LIMIT (IO_SPACE_LIMIT - PIO_INDIRECT_SIZE)
 
-struct logic_pio_hwaddr *find_io_range_by_fwnode(struct fwnode_handle *fwnode);
-unsigned long logic_pio_trans_hwaddr(struct fwnode_handle *fwnode,
+struct logic_pio_hwaddr *find_io_range_by_fwnode(const struct fwnode_handle *fwnode);
+unsigned long logic_pio_trans_hwaddr(const struct fwnode_handle *fwnode,
 			resource_size_t hw_addr, resource_size_t size);
 int logic_pio_register_range(struct logic_pio_hwaddr *newrange);
 void logic_pio_unregister_range(struct logic_pio_hwaddr *range);
diff --git a/lib/logic_pio.c b/lib/logic_pio.c
index 2ea564a40064..e29496a38d06 100644
--- a/lib/logic_pio.c
+++ b/lib/logic_pio.c
@@ -122,7 +122,7 @@  void logic_pio_unregister_range(struct logic_pio_hwaddr *range)
  *
  * Traverse the io_range_list to find the registered node for @fwnode.
  */
-struct logic_pio_hwaddr *find_io_range_by_fwnode(struct fwnode_handle *fwnode)
+struct logic_pio_hwaddr *find_io_range_by_fwnode(const struct fwnode_handle *fwnode)
 {
 	struct logic_pio_hwaddr *range, *found_range = NULL;
 
@@ -186,7 +186,7 @@  resource_size_t logic_pio_to_hwaddr(unsigned long pio)
  *
  * Returns Logical PIO value if successful, ~0UL otherwise
  */
-unsigned long logic_pio_trans_hwaddr(struct fwnode_handle *fwnode,
+unsigned long logic_pio_trans_hwaddr(const struct fwnode_handle *fwnode,
 				     resource_size_t addr, resource_size_t size)
 {
 	struct logic_pio_hwaddr *range;