* [PATCH][next] ACPI: pfr_telemetry: remove redundant error check on ret
@ 2024-10-14 13:05 Colin Ian King
2024-10-24 15:43 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2024-10-14 13:05 UTC (permalink / raw)
To: Rafael J . Wysocki, Len Brown, linux-acpi; +Cc: kernel-janitors, linux-kernel
The variable ret is initialized to zero and a littler later in
the PFRT_LOG_IOC_GET_INFO case of a switch statement is being checked
for negative error value. Since ret has not been re-assigned since
the initialization ret can never be less than zero so the check is
redundant and can be removed. Remove it.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/acpi/pfr_telemetry.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/acpi/pfr_telemetry.c b/drivers/acpi/pfr_telemetry.c
index 998264a7333d..a32798787ed9 100644
--- a/drivers/acpi/pfr_telemetry.c
+++ b/drivers/acpi/pfr_telemetry.c
@@ -272,9 +272,6 @@ static long pfrt_log_ioctl(struct file *file, unsigned int cmd, unsigned long ar
case PFRT_LOG_IOC_GET_INFO:
info.log_level = get_pfrt_log_level(pfrt_log_dev);
- if (ret < 0)
- return ret;
-
info.log_type = pfrt_log_dev->info.log_type;
info.log_revid = pfrt_log_dev->info.log_revid;
if (copy_to_user(p, &info, sizeof(info)))
--
2.39.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH][next] ACPI: pfr_telemetry: remove redundant error check on ret
2024-10-14 13:05 [PATCH][next] ACPI: pfr_telemetry: remove redundant error check on ret Colin Ian King
@ 2024-10-24 15:43 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2024-10-24 15:43 UTC (permalink / raw)
To: Colin Ian King
Cc: Rafael J . Wysocki, Len Brown, linux-acpi, kernel-janitors, linux-kernel
On Mon, Oct 14, 2024 at 3:05 PM Colin Ian King <colin.i.king@gmail.com> wrote:
>
> The variable ret is initialized to zero and a littler later in
> the PFRT_LOG_IOC_GET_INFO case of a switch statement is being checked
> for negative error value. Since ret has not been re-assigned since
> the initialization ret can never be less than zero so the check is
> redundant and can be removed. Remove it.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
> drivers/acpi/pfr_telemetry.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/acpi/pfr_telemetry.c b/drivers/acpi/pfr_telemetry.c
> index 998264a7333d..a32798787ed9 100644
> --- a/drivers/acpi/pfr_telemetry.c
> +++ b/drivers/acpi/pfr_telemetry.c
> @@ -272,9 +272,6 @@ static long pfrt_log_ioctl(struct file *file, unsigned int cmd, unsigned long ar
>
> case PFRT_LOG_IOC_GET_INFO:
> info.log_level = get_pfrt_log_level(pfrt_log_dev);
> - if (ret < 0)
> - return ret;
> -
> info.log_type = pfrt_log_dev->info.log_type;
> info.log_revid = pfrt_log_dev->info.log_revid;
> if (copy_to_user(p, &info, sizeof(info)))
> --
Applied as 6.13 material, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-10-24 15:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-14 13:05 [PATCH][next] ACPI: pfr_telemetry: remove redundant error check on ret Colin Ian King
2024-10-24 15:43 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®