hwrng : cleanup initialization
diff mbox series

Message ID 20200809150423.31557-1-trix@redhat.com
State Accepted
Commit 3a61cdf43e670b99404436a5854aae993ef616ed
Headers show
Series
  • hwrng : cleanup initialization
Related show

Commit Message

Tom Rix Aug. 9, 2020, 3:04 p.m. UTC
From: Tom Rix <trix@redhat.com>

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.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/char/hw_random/intel-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu Aug. 21, 2020, 7:58 a.m. UTC | #1
On Sun, Aug 09, 2020 at 08:04:23AM -0700, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.com>
> 
> 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.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>  drivers/char/hw_random/intel-rng.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Patch applied.  Thanks.

Patch
diff mbox series

diff --git a/drivers/char/hw_random/intel-rng.c b/drivers/char/hw_random/intel-rng.c
index 9f205bd1acc0..eb7db27f9f19 100644
--- a/drivers/char/hw_random/intel-rng.c
+++ b/drivers/char/hw_random/intel-rng.c
@@ -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;