Kernel-Janitors Archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] tpm/eventlog: remove redundant assignment to variabel ret
@ 2024-04-11  8:49 Colin Ian King
  2024-04-13 21:39 ` Jarkko Sakkinen
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2024-04-11  8:49 UTC (permalink / raw
  To: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, linux-integrity
  Cc: kernel-janitors, linux-kernel

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__);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] tpm/eventlog: remove redundant assignment to variabel ret
  2024-04-11  8:49 [PATCH][next] tpm/eventlog: remove redundant assignment to variabel ret Colin Ian King
@ 2024-04-13 21:39 ` Jarkko Sakkinen
  0 siblings, 0 replies; 2+ messages in thread
From: Jarkko Sakkinen @ 2024-04-13 21:39 UTC (permalink / raw
  To: Colin Ian King, Peter Huewe, Jason Gunthorpe, linux-integrity
  Cc: kernel-janitors, linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-13 21:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-11  8:49 [PATCH][next] tpm/eventlog: remove redundant assignment to variabel ret Colin Ian King
2024-04-13 21:39 ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).