[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJZ5v0jjrm0C7+6o3+ZfsrFKedo_o42wErKTHMjfU5ZGBJ=Mbg@mail.gmail.com>
Date: Thu, 24 Oct 2024 17:43:46 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Colin Ian King <colin.i.king@...il.com>
Cc: "Rafael J . Wysocki" <rafael@...nel.org>, Len Brown <lenb@...nel.org>, linux-acpi@...r.kernel.org,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][next] ACPI: pfr_telemetry: remove redundant error check
on ret
On Mon, Oct 14, 2024 at 3:05 PM Colin Ian King <colin.i.king@...il.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@...il.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!
Powered by blists - more mailing lists