From: Colin Ian King Date: Mon, 14 Oct 2024 13:05:22 +0000 (+0100) Subject: ACPI: pfr_telemetry: remove redundant error check on ret X-Git-Tag: v6.13-rc1~192^2~2^4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f8dc4394fc51ceb6c18a68c38fb41d9bc5f1ec63;p=thirdparty%2Fkernel%2Flinux.git ACPI: pfr_telemetry: remove redundant error check on ret 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 Link: https://patch.msgid.link/20241014130522.1986428-1-colin.i.king@gmail.com Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/pfr_telemetry.c b/drivers/acpi/pfr_telemetry.c index 998264a7333d6..a32798787ed92 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)))