* [PATCH] staging: greybus: power_supply: remove unnecessary parentheses in return
[not found] <20260615-greybus-power-supply-return-parens-v1-1-dcad9dabfe79.ref@yahoo.pl>
@ 2026-06-15 12:13 ` Tomasz Unger
2026-06-17 7:22 ` Rui Miguel Silva
0 siblings, 1 reply; 2+ messages in thread
From: Tomasz Unger @ 2026-06-15 12:13 UTC (permalink / raw)
To: Rui Miguel Silva, Johan Hovold, Alex Elder, Greg Kroah-Hartman
Cc: greybus-dev, linux-staging, linux-kernel, Tomasz Unger
return is not a function, so the parentheses around the returned
expressions are not needed. Remove them to follow kernel coding
style and silence checkpatch.pl RETURN_PARENTHESES warnings.
Verified with checkpatch.pl - no errors or warnings.
Compiled the power_supply object successfully.
Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
drivers/staging/greybus/power_supply.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c
index 33b7a63979d6..44bd8a72fa50 100644
--- a/drivers/staging/greybus/power_supply.c
+++ b/drivers/staging/greybus/power_supply.c
@@ -336,7 +336,7 @@ static int is_psy_prop_writeable(struct gb_power_supply *gbpsy,
static int is_prop_valint(enum power_supply_property psp)
{
- return ((psp < POWER_SUPPLY_PROP_MODEL_NAME) ? 1 : 0);
+ return (psp < POWER_SUPPLY_PROP_MODEL_NAME) ? 1 : 0;
}
static void next_interval(struct gb_power_supply *gbpsy)
@@ -423,7 +423,7 @@ static void check_changed(struct gb_power_supply *gbpsy,
static int total_props(struct gb_power_supply *gbpsy)
{
/* this return the intval plus the strval properties */
- return (gbpsy->properties_count + gbpsy->properties_count_str);
+ return gbpsy->properties_count + gbpsy->properties_count_str;
}
static void prop_append(struct gb_power_supply *gbpsy,
---
base-commit: 7cb1c5b32a2bfde961fff8d5204526b609bcb30a
change-id: 20260615-greybus-power-supply-return-parens-b3dd9f4a87c7
Best regards,
--
Tomasz Unger <tomasz.unger@yahoo.pl>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: greybus: power_supply: remove unnecessary parentheses in return
2026-06-15 12:13 ` [PATCH] staging: greybus: power_supply: remove unnecessary parentheses in return Tomasz Unger
@ 2026-06-17 7:22 ` Rui Miguel Silva
0 siblings, 0 replies; 2+ messages in thread
From: Rui Miguel Silva @ 2026-06-17 7:22 UTC (permalink / raw)
To: Tomasz Unger, Rui Miguel Silva, Johan Hovold, Alex Elder,
Greg Kroah-Hartman
Cc: greybus-dev, linux-staging, linux-kernel
Hi Tomasz,
Thanks for the patch.
On Mon Jun 15, 2026 at 1:13 PM WEST, Tomasz Unger wrote:
> return is not a function, so the parentheses around the returned
> expressions are not needed. Remove them to follow kernel coding
> style and silence checkpatch.pl RETURN_PARENTHESES warnings.
>
> Verified with checkpatch.pl - no errors or warnings.
> Compiled the power_supply object successfully.
>
> Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
LGTM,
Acked-by: Rui Miguel Silva <rui.silva@linaro.org>
Cheers,
Rui
> ---
> drivers/staging/greybus/power_supply.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c
> index 33b7a63979d6..44bd8a72fa50 100644
> --- a/drivers/staging/greybus/power_supply.c
> +++ b/drivers/staging/greybus/power_supply.c
> @@ -336,7 +336,7 @@ static int is_psy_prop_writeable(struct gb_power_supply *gbpsy,
>
> static int is_prop_valint(enum power_supply_property psp)
> {
> - return ((psp < POWER_SUPPLY_PROP_MODEL_NAME) ? 1 : 0);
> + return (psp < POWER_SUPPLY_PROP_MODEL_NAME) ? 1 : 0;
> }
>
> static void next_interval(struct gb_power_supply *gbpsy)
> @@ -423,7 +423,7 @@ static void check_changed(struct gb_power_supply *gbpsy,
> static int total_props(struct gb_power_supply *gbpsy)
> {
> /* this return the intval plus the strval properties */
> - return (gbpsy->properties_count + gbpsy->properties_count_str);
> + return gbpsy->properties_count + gbpsy->properties_count_str;
> }
>
> static void prop_append(struct gb_power_supply *gbpsy,
>
> ---
> base-commit: 7cb1c5b32a2bfde961fff8d5204526b609bcb30a
> change-id: 20260615-greybus-power-supply-return-parens-b3dd9f4a87c7
>
> Best regards,
> --
> Tomasz Unger <tomasz.unger@yahoo.pl>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-06-17 7:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20260615-greybus-power-supply-return-parens-v1-1-dcad9dabfe79.ref@yahoo.pl>
2026-06-15 12:13 ` [PATCH] staging: greybus: power_supply: remove unnecessary parentheses in return Tomasz Unger
2026-06-17 7:22 ` Rui Miguel Silva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox