Thread (63 messages) 63 messages, 5 authors, 2024-09-10

Re: [PATCH 15/22] Input: iqs7222 - use cleanup facility for fwnodes

From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Date: 2024-09-04 10:50:48
Also in: lkml

Hi Dmitry,

On 04/09/2024 06:48, Dmitry Torokhov wrote:
quoted hunk ↗ jump to hunk
Use __free(fwnode_handle) cleanup facility to ensure that references to
acquired fwnodes are dropped at appropriate times automatically.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/misc/iqs7222.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c
index 9ca5a743f19f..d9b87606ff7a 100644
--- a/drivers/input/misc/iqs7222.c
+++ b/drivers/input/misc/iqs7222.c
...
quoted hunk ↗ jump to hunk
@@ -2818,9 +2813,9 @@ static int iqs7222_parse_reg_grp(struct iqs7222_private *iqs7222,
 				 int reg_grp_index)
 {
 	struct i2c_client *client = iqs7222->client;
-	struct fwnode_handle *reg_grp_node;
 	int error;
 
Nit: reg_grp_node could stay at the top (where it used to be), as you
are assigning it to NULL because there are no sensible assignments at
this point.
+	struct fwnode_handle *reg_grp_node __free(fwnode_handle) = NULL;
 	if (iqs7222_reg_grp_names[reg_grp]) {
 		char reg_grp_name[16];
 
Best regards,
Javier Carrasco
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help