diff mbox series

[next] tpm/eventlog: remove redundant assignment to variabel ret

Message ID 20240411084913.305780-1-colin.i.king@gmail.com (mailing list archive)
State New, archived
Headers show
Series [next] tpm/eventlog: remove redundant assignment to variabel ret | expand

Commit Message

Colin Ian King April 11, 2024, 8:49 a.m. UTC
Variable ret is being assigned and error code that is never read, it is
either being re-assigned in an error exit path or never referenced again
on the non-error path. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/char/tpm/eventlog/acpi.c:145:2: warning: Value stored to 'ret'
is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/char/tpm/eventlog/acpi.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Jarkko Sakkinen April 13, 2024, 9:39 p.m. UTC | #1
On Thu Apr 11, 2024 at 11:49 AM EEST, Colin Ian King wrote:
> Variable ret is being assigned and error code that is never read, it is
> either being re-assigned in an error exit path or never referenced again
> on the non-error path. The assignment is redundant and can be removed.
>
> Cleans up clang scan build warning:
> drivers/char/tpm/eventlog/acpi.c:145:2: warning: Value stored to 'ret'
> is never read [deadcode.DeadStores]
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>  drivers/char/tpm/eventlog/acpi.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/char/tpm/eventlog/acpi.c b/drivers/char/tpm/eventlog/acpi.c
> index bd757d836c5c..69533d0bfb51 100644
> --- a/drivers/char/tpm/eventlog/acpi.c
> +++ b/drivers/char/tpm/eventlog/acpi.c
> @@ -142,7 +142,6 @@ int tpm_read_log_acpi(struct tpm_chip *chip)
>  
>  	log->bios_event_log_end = log->bios_event_log + len;
>  
> -	ret = -EIO;
>  	virt = acpi_os_map_iomem(start, len);
>  	if (!virt) {
>  		dev_warn(&chip->dev, "%s: Failed to map ACPI memory\n", __func__);


Thanks!

Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

BR, Jarkko
diff mbox series

Patch

diff --git a/drivers/char/tpm/eventlog/acpi.c b/drivers/char/tpm/eventlog/acpi.c
index bd757d836c5c..69533d0bfb51 100644
--- a/drivers/char/tpm/eventlog/acpi.c
+++ b/drivers/char/tpm/eventlog/acpi.c
@@ -142,7 +142,6 @@  int tpm_read_log_acpi(struct tpm_chip *chip)
 
 	log->bios_event_log_end = log->bios_event_log + len;
 
-	ret = -EIO;
 	virt = acpi_os_map_iomem(start, len);
 	if (!virt) {
 		dev_warn(&chip->dev, "%s: Failed to map ACPI memory\n", __func__);