[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5f875f84e6014d2bb5b78f71dc2831a2@bfs.de>
Date: Mon, 24 Feb 2020 11:07:55 +0000
From: Walter Harms <wharms@....de>
To: Colin King <colin.king@...onical.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>
CC: "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: AW: [PATCH] staging: rtl8723bs: core: remove redundant zero'ing of
counter variable k
________________________________________
Von: kernel-janitors-owner@...r.kernel.org <kernel-janitors-owner@...r.kernel.org> im Auftrag von Colin King <colin.king@...onical.com>
Gesendet: Sonntag, 23. Februar 2020 16:28
An: Greg Kroah-Hartman; devel@...verdev.osuosl.org
Cc: kernel-janitors@...r.kernel.org; linux-kernel@...r.kernel.org
Betreff: [PATCH] staging: rtl8723bs: core: remove redundant zero'ing of counter variable k
From: Colin Ian King <colin.king@...onical.com>
The zero'ing of counter variable k is redundant as it is never read
after breaking out of the while loop. Remove it.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
drivers/staging/rtl8723bs/core/rtw_efuse.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_efuse.c b/drivers/staging/rtl8723bs/core/rtw_efuse.c
index 3b8848182221..bdb6ff8aab7d 100644
--- a/drivers/staging/rtl8723bs/core/rtw_efuse.c
+++ b/drivers/staging/rtl8723bs/core/rtw_efuse.c
@@ -244,10 +244,8 @@ u16 Address)
while (!(Bytetemp & 0x80)) {
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
k++;
- if (k == 1000) {
- k = 0;
+ if (k == 1000)
break;
- }
IMHO this is confusing to read, i suggest:
for(k=0;k<1000;k++) {
Bytetemp = rtw_read8(Adapter, EFUSE_CTRL+3);
if ( Bytetemp & 0x80 )
break;
}
NTL is am wondering what will happen if k==1000
and Bytetemp is still invalid. Will rtw_read8() fail or
simply return invalid data ?
ym2c,
re,
wh
}
return rtw_read8(Adapter, EFUSE_CTRL);
} else
--
2.25.0
Powered by blists - more mailing lists