Skip to contentSkip to conversation

hwrng : cleanup initialization

PATCH In review [email protected] 2 participants 2 messages Aug 9, 2020 – Aug 21, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwrng : cleanup initialization

From: Tom Rix <[email protected]>

clang static analysis reports this problem

intel-rng.c:333:2: warning: Assigned value is garbage or undefined

        void __iomem *mem = mem;
        ^~~~~~~~~~~~~~~~~   ~~~

Because mem is assigned before it is used, this is not a real problem. But the initialization is strange and not needed, so remove it.

---
 drivers/char/hw_random/intel-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/hw_random/intel-rng.c +1 -1
index 9f205bd1acc0..eb7db27f9f19 100644
@@ -330,7 +330,7 @@ static int __init mod_init(void)
 	int err = -ENODEV;
 	int i;
 	struct pci_dev *dev = NULL;
-	void __iomem *mem = mem;
+	void __iomem *mem;
 	u8 hw_status;
 	struct intel_rng_hw *intel_rng_hw;
 
Signature · 1 line
2.18.1
maintainer
#1 lore raw
Quoted 8 lines · On Sun, Aug 09, 2020 at 08:04:23AM -0700, [email protected] wrote:

From: Tom Rix <[email protected]>

clang static analysis reports this problem

intel-rng.c:333:2: warning: Assigned value is garbage or undefined

        void __iomem *mem = mem;
        ^~~~~~~~~~~~~~~~~   ~~~
Quoted 8 lines

Because mem is assigned before it is used, this is not a real problem. But the initialization is strange and not needed, so remove it.

---
 drivers/char/hw_random/intel-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt