diff mbox series

drivers: bcma: remove set but not used variable `addrh` and `sizeh`

Message ID 20200721083935.13306-1-zhengyongjun3@huawei.com (mailing list archive)
State Accepted
Commit 92d26d1abf8e4b563bb8d98ce1bf31681364e4a8
Delegated to: Kalle Valo
Headers show
Series drivers: bcma: remove set but not used variable `addrh` and `sizeh` | expand

Commit Message

Zheng Yongjun July 21, 2020, 8:39 a.m. UTC
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/bcma/scan.c: In function 'bcma_erom_get_addr_desc':
drivers/bcma/scan.c:219 warning:
variable `addrh` and `sizeh` set but not used [-Wunused-but-set-variable]

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/bcma/scan.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Kalle Valo Aug. 2, 2020, 3:26 p.m. UTC | #1
Zheng Yongjun <zhengyongjun3@huawei.com> wrote:

> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/bcma/scan.c: In function 'bcma_erom_get_addr_desc':
> drivers/bcma/scan.c:219 warning:
> variable `addrh` and `sizeh` set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>

Patch applied to wireless-drivers-next.git, thanks.

92d26d1abf8e drivers: bcma: remove set but not used variable `addrh` and `sizeh`
diff mbox series

Patch

diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
index 1a942f734188..d49e7c0de2b6 100644
--- a/drivers/bcma/scan.c
+++ b/drivers/bcma/scan.c
@@ -219,7 +219,7 @@  static s32 bcma_erom_get_mst_port(struct bcma_bus *bus, u32 __iomem **eromptr)
 static u32 bcma_erom_get_addr_desc(struct bcma_bus *bus, u32 __iomem **eromptr,
 				  u32 type, u8 port)
 {
-	u32 addrl, addrh, sizeh = 0;
+	u32 addrl;
 	u32 size;
 
 	u32 ent = bcma_erom_get_ent(bus, eromptr);
@@ -233,14 +233,12 @@  static u32 bcma_erom_get_addr_desc(struct bcma_bus *bus, u32 __iomem **eromptr,
 
 	addrl = ent & SCAN_ADDR_ADDR;
 	if (ent & SCAN_ADDR_AG32)
-		addrh = bcma_erom_get_ent(bus, eromptr);
-	else
-		addrh = 0;
+		bcma_erom_get_ent(bus, eromptr);
 
 	if ((ent & SCAN_ADDR_SZ) == SCAN_ADDR_SZ_SZD) {
 		size = bcma_erom_get_ent(bus, eromptr);
 		if (size & SCAN_SIZE_SG32)
-			sizeh = bcma_erom_get_ent(bus, eromptr);
+			bcma_erom_get_ent(bus, eromptr);
 	}
 
 	return addrl;