Skip to content

Commit

Permalink
net: rtl8192cu: Fix off-by-one warning
Browse files Browse the repository at this point in the history
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c: In function ‘PHY_RFShadowRefresh’:
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c:1020:37: warning: iteration 63 invokes undefined behavior [-Waggressive-loop-optimizations]
    RF_Shadow[eRFPath][Offset].Value = 0;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
../drivers/net/wireless/realtek/rtl8192cu/hal/rtl8192c/rtl8192c_rf6052.c:1018:3: note: within this loop
   for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
   ^~~

Signed-off-by: Marc Kleine-Budde <[email protected]>
Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
marckleinebudde authored and nathanchance committed Mar 5, 2018
1 parent 7a18831 commit 9db27f3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ PHY_RFShadowRefresh(

for (eRFPath = 0; eRFPath < RF6052_MAX_PATH; eRFPath++)
{
for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
for (Offset = 0; Offset < RF6052_MAX_REG; Offset++)
{
RF_Shadow[eRFPath][Offset].Value = 0;
RF_Shadow[eRFPath][Offset].Compare = _FALSE;
Expand Down

0 comments on commit 9db27f3

Please sign in to comment.