* [PATCH] Fix brace and parentheses in thinkpad_acpi.c
@ 2025-01-16 4:51 Matheus Polkorny
2025-01-17 16:30 ` Ilpo Järvinen
0 siblings, 1 reply; 2+ messages in thread
From: Matheus Polkorny @ 2025-01-16 4:51 UTC (permalink / raw)
To: hmh, hdegoede, ilpo.jarvinen
Cc: Matheus Polkorny, ibm-acpi-devel, platform-driver-x86
This patch addresses checkpatch diagnostics related to
coding style in thinkpad_acpi.c:
- Ensures open braces '{' for function definitions are placed on
the next line
- Fixes parentheses usage in conditionals, ensuring proper readability
Reported by checkpatch.pl:
ERROR: open brace '{' following function definitions go on the next line
Signed-off-by: Matheus Polkorny <mpolkorny@gmail.com>
---
drivers/platform/x86/thinkpad_acpi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 2cfb2ac3f465..7a693092f398 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -9519,14 +9519,14 @@ static int tpacpi_battery_set(int what, int battery, int value)
switch (what) {
case THRESHOLD_START:
- if ACPI_FAILURE(tpacpi_battery_acpi_eval(SET_START, &ret, param)) {
+ if (ACPI_FAILURE(tpacpi_battery_acpi_eval(SET_START, &ret, param))) {
pr_err("failed to set charge threshold on battery %d",
battery);
return -ENODEV;
}
return 0;
case THRESHOLD_STOP:
- if ACPI_FAILURE(tpacpi_battery_acpi_eval(SET_STOP, &ret, param)) {
+ if (ACPI_FAILURE(tpacpi_battery_acpi_eval(SET_STOP, &ret, param))) {
pr_err("failed to set stop threshold: %d", battery);
return -ENODEV;
}
@@ -9608,7 +9608,7 @@ static int tpacpi_battery_probe(int battery)
* 8) Check for support
*/
if (acpi_has_method(hkey_handle, GET_START)) {
- if ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_START, &ret, battery)) {
+ if (ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_START, &ret, battery))) {
pr_err("Error probing battery %d\n", battery);
return -ENODEV;
}
@@ -9627,7 +9627,7 @@ static int tpacpi_battery_probe(int battery)
}
}
if (acpi_has_method(hkey_handle, GET_STOP)) {
- if ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_STOP, &ret, battery)) {
+ if (ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_STOP, &ret, battery))) {
pr_err("Error probing battery stop; %d\n", battery);
return -ENODEV;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix brace and parentheses in thinkpad_acpi.c
2025-01-16 4:51 [PATCH] Fix brace and parentheses in thinkpad_acpi.c Matheus Polkorny
@ 2025-01-17 16:30 ` Ilpo Järvinen
0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2025-01-17 16:30 UTC (permalink / raw)
To: Matheus Polkorny; +Cc: hmh, Hans de Goede, ibm-acpi-devel, platform-driver-x86
On Thu, 16 Jan 2025, Matheus Polkorny wrote:
Hi Matheus,
You need to add the correct prefix(es) to the shortlog in the subject.
Please see what the existing commits use in 'git log' of the file as the
prefix (there might be variation at times, so try to pick the most
common prefix that makes sense).
> This patch addresses checkpatch diagnostics related to
> coding style in thinkpad_acpi.c:
>
> - Ensures open braces '{' for function definitions are placed on
> the next line
I don't see any change in your patch which relates to this??
> - Fixes parentheses usage in conditionals, ensuring proper readability
>
> Reported by checkpatch.pl:
> ERROR: open brace '{' following function definitions go on the next line
>
> Signed-off-by: Matheus Polkorny <mpolkorny@gmail.com>
> ---
> drivers/platform/x86/thinkpad_acpi.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index 2cfb2ac3f465..7a693092f398 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -9519,14 +9519,14 @@ static int tpacpi_battery_set(int what, int battery, int value)
>
> switch (what) {
> case THRESHOLD_START:
> - if ACPI_FAILURE(tpacpi_battery_acpi_eval(SET_START, &ret, param)) {
> + if (ACPI_FAILURE(tpacpi_battery_acpi_eval(SET_START, &ret, param))) {
> pr_err("failed to set charge threshold on battery %d",
> battery);
> return -ENODEV;
> }
> return 0;
> case THRESHOLD_STOP:
> - if ACPI_FAILURE(tpacpi_battery_acpi_eval(SET_STOP, &ret, param)) {
> + if (ACPI_FAILURE(tpacpi_battery_acpi_eval(SET_STOP, &ret, param))) {
> pr_err("failed to set stop threshold: %d", battery);
> return -ENODEV;
> }
> @@ -9608,7 +9608,7 @@ static int tpacpi_battery_probe(int battery)
> * 8) Check for support
> */
> if (acpi_has_method(hkey_handle, GET_START)) {
> - if ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_START, &ret, battery)) {
> + if (ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_START, &ret, battery))) {
> pr_err("Error probing battery %d\n", battery);
> return -ENODEV;
> }
> @@ -9627,7 +9627,7 @@ static int tpacpi_battery_probe(int battery)
> }
> }
> if (acpi_has_method(hkey_handle, GET_STOP)) {
> - if ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_STOP, &ret, battery)) {
> + if (ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_STOP, &ret, battery))) {
> pr_err("Error probing battery stop; %d\n", battery);
> return -ENODEV;
> }
>
--
i.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-17 16:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-16 4:51 [PATCH] Fix brace and parentheses in thinkpad_acpi.c Matheus Polkorny
2025-01-17 16:30 ` Ilpo Järvinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox