From: Colin King <hidden> Date: 2019-09-20 12:54:21
From: Colin Ian King <redacted>
Currently the zero check on val to break out of a loop
is a little obscure. Replace the val is zero and break check
with a loop while value is non-zero.
Signed-off-by: Colin Ian King <redacted>
---
drivers/net/wireless/mediatek/mt7601u/phy.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
@@ -213,9 +213,7 @@ int mt7601u_wait_bbp_ready(struct mt7601u_dev *dev)do{val=mt7601u_bbp_rr(dev,MT_BBP_REG_VERSION);-if(val&&~val)-break;-}while(--i);+}while(val&&--i);if(!i){dev_err(dev->dev,"Error: BBP is not ready\n");
From: Robin Murphy <robin.murphy@arm.com> Date: 2019-09-20 13:25:28
On 20/09/2019 13:54, Colin King wrote:
quoted hunk
From: Colin Ian King <redacted>
Currently the zero check on val to break out of a loop
is a little obscure. Replace the val is zero and break check
with a loop while value is non-zero.
Signed-off-by: Colin Ian King <redacted>
---
drivers/net/wireless/mediatek/mt7601u/phy.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
From: Lorenzo Bianconi <hidden> Date: 2019-09-20 13:58:25
quoted hunk
From: Colin Ian King <redacted>
Currently the zero check on val to break out of a loop
is a little obscure. Replace the val is zero and break check
with a loop while value is non-zero.
Signed-off-by: Colin Ian King <redacted>
---
drivers/net/wireless/mediatek/mt7601u/phy.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
@@ -213,9 +213,7 @@ int mt7601u_wait_bbp_ready(struct mt7601u_dev *dev)do{val=mt7601u_bbp_rr(dev,MT_BBP_REG_VERSION);-if(val&&~val)-break;
I think this is not correct since (not considering the cast) we should break
from the loop if val != 0 and val != 0xff, so the right approach I guess is:
From: Jakub Kicinski <hidden> Date: 2019-09-20 18:52:27
On Fri, 20 Sep 2019 15:58:17 +0200, Lorenzo Bianconi wrote:
quoted hunk
I think this is not correct since (not considering the cast) we should break
from the loop if val != 0 and val != 0xff, so the right approach I guess is: