diff mbox series

[RFC,v3,2/9] lib/test_printf.c: Use helper function to unwind array of software_nodes

Message ID 20201019225903.14276-3-djrscally@gmail.com
State Superseded
Headers show
Series Add functionality to ipu3-cio2 driver allowing software_node connections to sensors on platforms designed for Windows | expand

Commit Message

Daniel Scally Oct. 19, 2020, 10:58 p.m. UTC
Use the new software_node_unregister_nodes_reverse() function to
unwind this array in a cleaner way.

Suggested-by: Andriy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Daniel Scally <djrscally@gmail.com>
---
Changes in v3:
	- patch introduced.

 lib/test_printf.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Petr Mladek Oct. 20, 2020, 7:23 a.m. UTC | #1
On Mon 2020-10-19 23:58:56, Daniel Scally wrote:
> Use the new software_node_unregister_nodes_reverse() function to

> unwind this array in a cleaner way.

> 

> Suggested-by: Andriy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Daniel Scally <djrscally@gmail.com>


If the new API gets accepted:

Acked-by: Petr Mladek <pmladek@suse.com>


Best Regards,
Petr
Andy Shevchenko Oct. 20, 2020, 9:20 a.m. UTC | #2
On Mon, Oct 19, 2020 at 11:58:56PM +0100, Daniel Scally wrote:
> Use the new software_node_unregister_nodes_reverse() function to

> unwind this array in a cleaner way.


Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>


> Suggested-by: Andriy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Daniel Scally <djrscally@gmail.com>

> ---

> Changes in v3:

> 	- patch introduced.

> 

>  lib/test_printf.c | 4 +---

>  1 file changed, 1 insertion(+), 3 deletions(-)

> 

> diff --git a/lib/test_printf.c b/lib/test_printf.c

> index 7ac87f18a..c63365570 100644

> --- a/lib/test_printf.c

> +++ b/lib/test_printf.c

> @@ -644,9 +644,7 @@ static void __init fwnode_pointer(void)

>  	test(second_name, "%pfwP", software_node_fwnode(&softnodes[1]));

>  	test(third_name, "%pfwP", software_node_fwnode(&softnodes[2]));

>  

> -	software_node_unregister(&softnodes[2]);

> -	software_node_unregister(&softnodes[1]);

> -	software_node_unregister(&softnodes[0]);

> +	software_node_unregister_nodes_reverse(softnodes);

>  }

>  

>  static void __init

> -- 

> 2.17.1

> 


-- 
With Best Regards,
Andy Shevchenko
diff mbox series

Patch

diff --git a/lib/test_printf.c b/lib/test_printf.c
index 7ac87f18a..c63365570 100644
--- a/lib/test_printf.c
+++ b/lib/test_printf.c
@@ -644,9 +644,7 @@  static void __init fwnode_pointer(void)
 	test(second_name, "%pfwP", software_node_fwnode(&softnodes[1]));
 	test(third_name, "%pfwP", software_node_fwnode(&softnodes[2]));
 
-	software_node_unregister(&softnodes[2]);
-	software_node_unregister(&softnodes[1]);
-	software_node_unregister(&softnodes[0]);
+	software_node_unregister_nodes_reverse(softnodes);
 }
 
 static void __init