* [PATCH] hwrng: amd: remove redundant initialization of variable err
@ 2021-04-29 11:32 Colin King
2021-05-14 11:35 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-04-29 11:32 UTC (permalink / raw)
To: Matt Mackall, Herbert Xu, linux-crypto; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable err is being initialized with a value that is
never read and it is being updated later with a new value. The
initialization is redundant and can be removed
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/char/hw_random/amd-rng.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/hw_random/amd-rng.c b/drivers/char/hw_random/amd-rng.c
index 9959c762da2f..d8d4ef5214a1 100644
--- a/drivers/char/hw_random/amd-rng.c
+++ b/drivers/char/hw_random/amd-rng.c
@@ -126,7 +126,7 @@ static struct hwrng amd_rng = {
static int __init mod_init(void)
{
- int err = -ENODEV;
+ int err;
struct pci_dev *pdev = NULL;
const struct pci_device_id *ent;
u32 pmbase;
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hwrng: amd: remove redundant initialization of variable err
2021-04-29 11:32 [PATCH] hwrng: amd: remove redundant initialization of variable err Colin King
@ 2021-05-14 11:35 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2021-05-14 11:35 UTC (permalink / raw)
To: Colin King; +Cc: Matt Mackall, linux-crypto, kernel-janitors, linux-kernel
On Thu, Apr 29, 2021 at 12:32:53PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable err is being initialized with a value that is
> never read and it is being updated later with a new value. The
> initialization is redundant and can be removed
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/char/hw_random/amd-rng.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-14 11:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29 11:32 [PATCH] hwrng: amd: remove redundant initialization of variable err Colin King
2021-05-14 11:35 ` Herbert Xu
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 NNTP newsgroup(s).