Message ID | 20220409061318.GB5447@kili (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Kalle Valo |
Headers | show |
Series | rtw89: pci: reversed conditions in rtw89_write16_mdio_mask() | expand |
On Sat, 2022-04-09 at 09:13 +0300, Dan Carpenter wrote: > These if conditions are reversed so it will just return success without > writing. > > Fixes: 740c431c22fe ("rtw89: pci: add register definition to rtw89_pci_info to generalize pci > code") > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> > --- > drivers/net/wireless/realtek/rtw89/pci.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c > index dcf907b81cff..ecb419010f0c 100644 > --- a/drivers/net/wireless/realtek/rtw89/pci.c > +++ b/drivers/net/wireless/realtek/rtw89/pci.c > @@ -1522,7 +1522,7 @@ rtw89_write16_mdio_mask(struct rtw89_dev *rtwdev, u8 addr, u16 mask, u16 > data, u > u16 val; > > ret = rtw89_read16_mdio(rtwdev, addr, speed, &val); > - if (!ret) > + if (ret) > return ret; > > shift = __ffs(mask); > @@ -1530,7 +1530,7 @@ rtw89_write16_mdio_mask(struct rtw89_dev *rtwdev, u8 addr, u16 mask, u16 > data, u > val |= ((data << shift) & mask); > > ret = rtw89_write16_mdio(rtwdev, addr, val, speed); > - if (!ret) > + if (ret) > return ret; > > return 0; I have found and sent a patch to fix this: https://lore.kernel.org/linux-wireless/20220408001353.17188-14-pkshih@realtek.com/T/#u Thank you Ping-Ke
diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c index dcf907b81cff..ecb419010f0c 100644 --- a/drivers/net/wireless/realtek/rtw89/pci.c +++ b/drivers/net/wireless/realtek/rtw89/pci.c @@ -1522,7 +1522,7 @@ rtw89_write16_mdio_mask(struct rtw89_dev *rtwdev, u8 addr, u16 mask, u16 data, u u16 val; ret = rtw89_read16_mdio(rtwdev, addr, speed, &val); - if (!ret) + if (ret) return ret; shift = __ffs(mask); @@ -1530,7 +1530,7 @@ rtw89_write16_mdio_mask(struct rtw89_dev *rtwdev, u8 addr, u16 mask, u16 data, u val |= ((data << shift) & mask); ret = rtw89_write16_mdio(rtwdev, addr, val, speed); - if (!ret) + if (ret) return ret; return 0;
These if conditions are reversed so it will just return success without writing. Fixes: 740c431c22fe ("rtw89: pci: add register definition to rtw89_pci_info to generalize pci code") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- drivers/net/wireless/realtek/rtw89/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)