Skip to contentSkip to conversation

staging: greybus: power_supply fix alignment

PATCH In review Akhil Varkey 3 participants 5 messages Jul 14, 2025 – Jul 15, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: greybus: power_supply fix alignment

Fix checkpatch check "CHECK:Alignment should match open parenthesis"

---

Hello, This is my first patch, I appreciate any feedbacks. Thanks!!

---
 drivers/staging/greybus/power_supply.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/greybus/power_supply.c +7 -7
index 2ef46822f676..a484c0ca058d 100644
@@ -324,7 +324,7 @@ static struct gb_power_supply_prop *get_psy_prop(struct gb_power_supply *gbpsy,
 }
 
 static int is_psy_prop_writeable(struct gb_power_supply *gbpsy,
-				     enum power_supply_property psp)
+				 enum power_supply_property psp)
 {
 	struct gb_power_supply_prop *prop;
 
@@ -493,7 +493,7 @@ static int gb_power_supply_description_get(struct gb_power_supply *gbpsy)
 	if (!gbpsy->model_name)
 		return -ENOMEM;
 	gbpsy->serial_number = kstrndup(resp.serial_number, PROP_MAX,
-				       GFP_KERNEL);
+					GFP_KERNEL);
 	if (!gbpsy->serial_number)
 		return -ENOMEM;
 
@@ -546,7 +546,7 @@ static int gb_power_supply_prop_descriptors_get(struct gb_power_supply *gbpsy)
 	}
 
 	gbpsy->props = kcalloc(gbpsy->properties_count, sizeof(*gbpsy->props),
-			      GFP_KERNEL);
+			       GFP_KERNEL);
 	if (!gbpsy->props) {
 		ret = -ENOMEM;
 		goto out_put_operation;
@@ -634,8 +634,8 @@ static int __gb_power_supply_property_get(struct gb_power_supply *gbpsy,
 }
 
 static int __gb_power_supply_property_strval_get(struct gb_power_supply *gbpsy,
-						enum power_supply_property psp,
-						union power_supply_propval *val)
+						 enum power_supply_property psp,
+						 union power_supply_propval *val)
 {
 	switch (psp) {
 	case POWER_SUPPLY_PROP_MODEL_NAME:
@@ -943,8 +943,8 @@ static int gb_power_supplies_setup(struct gb_power_supplies *supplies)
 		goto out;
 
 	supplies->supply = kcalloc(supplies->supplies_count,
-				     sizeof(struct gb_power_supply),
-				     GFP_KERNEL);
+				   sizeof(struct gb_power_supply),
+				   GFP_KERNEL);
 
 	if (!supplies->supply) {
 		ret = -ENOMEM;
Signature · 1 line
2.47.2
maintainer
#1 lore raw

Hey Akhil,
Thanks for your patch.

All looks good with the exception of a small nit...

Quoted 6 lines · Akhil Varkey

Fix checkpatch check "CHECK:Alignment should match open parenthesis"

---

Hello, This is my first patch, I appreciate any feedbacks. Thanks!!

Welcome, and continue...

Quoted 36 lines
---
 drivers/staging/greybus/power_supply.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/greybus/power_supply.c +3 -3
index 2ef46822f676..a484c0ca058d 100644
@@ -324,7 +324,7 @@ static struct gb_power_supply_prop *get_psy_prop(struct gb_power_supply *gbpsy,
 }
 
 static int is_psy_prop_writeable(struct gb_power_supply *gbpsy,
-				     enum power_supply_property psp)
+				 enum power_supply_property psp)
 {
 	struct gb_power_supply_prop *prop;
 
@@ -493,7 +493,7 @@ static int gb_power_supply_description_get(struct gb_power_supply *gbpsy)
 	if (!gbpsy->model_name)
 		return -ENOMEM;
 	gbpsy->serial_number = kstrndup(resp.serial_number, PROP_MAX,
-				       GFP_KERNEL);
+					GFP_KERNEL);
 	if (!gbpsy->serial_number)
 		return -ENOMEM;
 
@@ -546,7 +546,7 @@ static int gb_power_supply_prop_descriptors_get(struct gb_power_supply *gbpsy)
 	}
 
 	gbpsy->props = kcalloc(gbpsy->properties_count, sizeof(*gbpsy->props),
-			      GFP_KERNEL);
+			       GFP_KERNEL);
 	if (!gbpsy->props) {
 		ret = -ENOMEM;
 		goto out_put_operation;

drivers/staging/greybus/power_supply.c static int __gb_power_supply_property_get(struct gb_power_supply *gbpsy, · line 638

Quoted 7 lines
drivers/staging/greybus/power_supply.c +2 -2
@@ -634,8 +634,8 @@ static int __gb_power_supply_property_get(struct gb_power_supply *gbpsy,
 }
 
 static int __gb_power_supply_property_strval_get(struct gb_power_supply *gbpsy,
-						enum power_supply_property psp,
-						union power_supply_propval *val)
+						 enum power_supply_property psp,
+						 union power_supply_propval *val)

Here you fix the alignment, but the last line goes over column 81, even though 80 is not really one hard requirement anymore, all code (strings is ok to go over to be easier to grep for messages) is on that register.

So, to be coherent, if you could please send a V2 without this specific change would be great, Or even better, if you could get rid of all the _ and __ prefixes in functions names that would be great, and will give more space for function paramethers.
Your call.

Also, gives you also the chance to practice to send a new version ;).

Cheers,
Rui

Quoted 16 lines
drivers/staging/greybus/power_supply.c +2 -2
 {
 	switch (psp) {
 	case POWER_SUPPLY_PROP_MODEL_NAME:
@@ -943,8 +943,8 @@ static int gb_power_supplies_setup(struct gb_power_supplies *supplies)
 		goto out;
 
 	supplies->supply = kcalloc(supplies->supplies_count,
-				     sizeof(struct gb_power_supply),
-				     GFP_KERNEL);
+				   sizeof(struct gb_power_supply),
+				   GFP_KERNEL);
 
 	if (!supplies->supply) {
 		ret = -ENOMEM;
Signature · 1 line
2.47.2
maintainer
#2 lore raw
Quoted 65 lines · Rui Miguel Silva

Hey Akhil,
Thanks for your patch.

All looks good with the exception of a small nit...

Quoted 6 lines · Akhil Varkey

Fix checkpatch check "CHECK:Alignment should match open parenthesis"

---

Hello, This is my first patch, I appreciate any feedbacks. Thanks!!

Welcome, and continue...

Quoted 36 lines
---
 drivers/staging/greybus/power_supply.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/greybus/power_supply.c +3 -3
index 2ef46822f676..a484c0ca058d 100644
@@ -324,7 +324,7 @@ static struct gb_power_supply_prop *get_psy_prop(struct gb_power_supply *gbpsy,
 }
 
 static int is_psy_prop_writeable(struct gb_power_supply *gbpsy,
-				     enum power_supply_property psp)
+				 enum power_supply_property psp)
 {
 	struct gb_power_supply_prop *prop;
 
@@ -493,7 +493,7 @@ static int gb_power_supply_description_get(struct gb_power_supply *gbpsy)
 	if (!gbpsy->model_name)
 		return -ENOMEM;
 	gbpsy->serial_number = kstrndup(resp.serial_number, PROP_MAX,
-				       GFP_KERNEL);
+					GFP_KERNEL);
 	if (!gbpsy->serial_number)
 		return -ENOMEM;
 
@@ -546,7 +546,7 @@ static int gb_power_supply_prop_descriptors_get(struct gb_power_supply *gbpsy)
 	}
 
 	gbpsy->props = kcalloc(gbpsy->properties_count, sizeof(*gbpsy->props),
-			      GFP_KERNEL);
+			       GFP_KERNEL);
 	if (!gbpsy->props) {
 		ret = -ENOMEM;
 		goto out_put_operation;

drivers/staging/greybus/power_supply.c static int __gb_power_supply_property_get(struct gb_power_supply *gbpsy, · line 638

Quoted 7 lines
drivers/staging/greybus/power_supply.c +2 -2
@@ -634,8 +634,8 @@ static int __gb_power_supply_property_get(struct gb_power_supply *gbpsy,
 }
 
 static int __gb_power_supply_property_strval_get(struct gb_power_supply *gbpsy,
-						enum power_supply_property psp,
-						union power_supply_propval *val)
+						 enum power_supply_property psp,
+						 union power_supply_propval *val)

Here you fix the alignment, but the last line goes over column 81, even though 80 is not really one hard requirement anymore, all code (strings is ok to go over to be easier to grep for messages) is on that register.

Quoted 5 lines

So, to be coherent, if you could please send a V2 without this specific change would be great, Or even better, if you could get rid of all the _ and __ prefixes in functions names that would be great, and will give more space for function paramethers.
Your call.

Nah, this is fine as-is, we can go over the limit to 100 for tiny stuff like this.

And the __ prefixes should be there to show no locking, or "internal" functions, right? So changing the name needs to happen very carefully.

thanks,

greg k-h

maintainer Reviewed-by
#3 lore raw

Hey Greg,

Quoted 72 lines · Greg KH
Quoted 65 lines · Rui Miguel Silva

Hey Akhil,
Thanks for your patch.

All looks good with the exception of a small nit...

Quoted 6 lines · Akhil Varkey

Fix checkpatch check "CHECK:Alignment should match open parenthesis"

---

Hello, This is my first patch, I appreciate any feedbacks. Thanks!!

Welcome, and continue...

Quoted 36 lines
---
 drivers/staging/greybus/power_supply.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/greybus/power_supply.c +3 -3
index 2ef46822f676..a484c0ca058d 100644
@@ -324,7 +324,7 @@ static struct gb_power_supply_prop *get_psy_prop(struct gb_power_supply *gbpsy,
 }
 
 static int is_psy_prop_writeable(struct gb_power_supply *gbpsy,
-				     enum power_supply_property psp)
+				 enum power_supply_property psp)
 {
 	struct gb_power_supply_prop *prop;
 
@@ -493,7 +493,7 @@ static int gb_power_supply_description_get(struct gb_power_supply *gbpsy)
 	if (!gbpsy->model_name)
 		return -ENOMEM;
 	gbpsy->serial_number = kstrndup(resp.serial_number, PROP_MAX,
-				       GFP_KERNEL);
+					GFP_KERNEL);
 	if (!gbpsy->serial_number)
 		return -ENOMEM;
 
@@ -546,7 +546,7 @@ static int gb_power_supply_prop_descriptors_get(struct gb_power_supply *gbpsy)
 	}
 
 	gbpsy->props = kcalloc(gbpsy->properties_count, sizeof(*gbpsy->props),
-			      GFP_KERNEL);
+			       GFP_KERNEL);
 	if (!gbpsy->props) {
 		ret = -ENOMEM;
 		goto out_put_operation;

drivers/staging/greybus/power_supply.c static int __gb_power_supply_property_get(struct gb_power_supply *gbpsy, · line 638

Quoted 7 lines
drivers/staging/greybus/power_supply.c +2 -2
@@ -634,8 +634,8 @@ static int __gb_power_supply_property_get(struct gb_power_supply *gbpsy,
 }
 
 static int __gb_power_supply_property_strval_get(struct gb_power_supply *gbpsy,
-						enum power_supply_property psp,
-						union power_supply_propval *val)
+						 enum power_supply_property psp,
+						 union power_supply_propval *val)

Here you fix the alignment, but the last line goes over column 81, even though 80 is not really one hard requirement anymore, all code (strings is ok to go over to be easier to grep for messages) is on that register.

Quoted 5 lines

So, to be coherent, if you could please send a V2 without this specific change would be great, Or even better, if you could get rid of all the _ and __ prefixes in functions names that would be great, and will give more space for function paramethers.
Your call.

Quoted 5 lines

Nah, this is fine as-is, we can go over the limit to 100 for tiny stuff like this.

And the __ prefixes should be there to show no locking, or "internal" functions, right? So changing the name needs to happen very carefully.

Yup, we can go either way here. I do not have strong feelings about this.

So, LGTM, Thanks Akhil.

Cheers,
Rui

Quoted 4 lines

thanks,

greg k-h

author
#4 lore raw

Hi Rui and Greg,

Quoted 81 lines · Rui Miguel Silva

Hey Greg,

Quoted 72 lines · Greg KH
Quoted 65 lines · Rui Miguel Silva

Hey Akhil,
Thanks for your patch.

All looks good with the exception of a small nit...

Quoted 6 lines · Akhil Varkey

Fix checkpatch check "CHECK:Alignment should match open parenthesis"

---

Hello, This is my first patch, I appreciate any feedbacks. Thanks!!

Welcome, and continue...

Quoted 36 lines
---
  drivers/staging/greybus/power_supply.c | 14 +++++++-------
  1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/greybus/power_supply.c +3 -3
index 2ef46822f676..a484c0ca058d 100644
@@ -324,7 +324,7 @@ static struct gb_power_supply_prop *get_psy_prop(struct gb_power_supply *gbpsy,
  }
 
  static int is_psy_prop_writeable(struct gb_power_supply *gbpsy,
-				     enum power_supply_property psp)
+				 enum power_supply_property psp)
  {
  	struct gb_power_supply_prop *prop;
 
@@ -493,7 +493,7 @@ static int gb_power_supply_description_get(struct gb_power_supply *gbpsy)
  	if (!gbpsy->model_name)
  		return -ENOMEM;
  	gbpsy->serial_number = kstrndup(resp.serial_number, PROP_MAX,
-				       GFP_KERNEL);
+					GFP_KERNEL);
  	if (!gbpsy->serial_number)
  		return -ENOMEM;
 
@@ -546,7 +546,7 @@ static int gb_power_supply_prop_descriptors_get(struct gb_power_supply *gbpsy)
  	}
 
  	gbpsy->props = kcalloc(gbpsy->properties_count, sizeof(*gbpsy->props),
-			      GFP_KERNEL);
+			       GFP_KERNEL);
  	if (!gbpsy->props) {
  		ret = -ENOMEM;
  		goto out_put_operation;

drivers/staging/greybus/power_supply.c static int __gb_power_supply_property_get(struct gb_power_supply *gbpsy, · line 638

Quoted 7 lines
drivers/staging/greybus/power_supply.c +2 -2
@@ -634,8 +634,8 @@ static int __gb_power_supply_property_get(struct gb_power_supply *gbpsy,
  }
 
  static int __gb_power_supply_property_strval_get(struct gb_power_supply *gbpsy,
-						enum power_supply_property psp,
-						union power_supply_propval *val)
+						 enum power_supply_property psp,
+						 union power_supply_propval *val)

Here you fix the alignment, but the last line goes over column 81, even though 80 is not really one hard requirement anymore, all code (strings is ok to go over to be easier to grep for messages) is on that register.

Quoted 5 lines

So, to be coherent, if you could please send a V2 without this specific change would be great, Or even better, if you could get rid of all the _ and __ prefixes in functions names that would be great, and will give more space for function paramethers.
Your call.

Quoted 5 lines

Nah, this is fine as-is, we can go over the limit to 100 for tiny stuff like this.

And the __ prefixes should be there to show no locking, or "internal" functions, right? So changing the name needs to happen very carefully.

Quoted 16 lines

Yup, we can go either way here. I do not have strong feelings about this.

So, LGTM, Thanks Akhil.

Cheers,
Rui

Quoted 4 lines

thanks,

greg k-h

Thanks accepting my patches and for the suggestions on what could be done better.

Best Regards,
Akhil Varkey