[PATCH 05/74] staging: rtl8723au: Fix up some random bit-flag handling
From: Jes Sorensen jes.soren...@redhat.com Randomly mixing true/false/_FAIL/0/1 is a recipe for disaster Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- drivers/staging/rtl8723au/core/rtw_cmd.c | 2 +- drivers/staging/rtl8723au/core/rtw_mlme.c | 5 ++--- drivers/staging/rtl8723au/core/rtw_pwrctrl.c | 2 +- drivers/staging/rtl8723au/core/rtw_recv.c | 12 ++-- drivers/staging/rtl8723au/core/rtw_security.c | 4 ++-- drivers/staging/rtl8723au/core/rtw_xmit.c | 6 +++--- drivers/staging/rtl8723au/include/rtw_security.h | 9 - drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 14 +++--- drivers/staging/rtl8723au/os_dep/os_intfs.c | 2 +- 9 files changed, 27 insertions(+), 29 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_cmd.c b/drivers/staging/rtl8723au/core/rtw_cmd.c index b28afb1..5abe936 100644 --- a/drivers/staging/rtl8723au/core/rtw_cmd.c +++ b/drivers/staging/rtl8723au/core/rtw_cmd.c @@ -755,7 +755,7 @@ int rtw_setstakey_cmd23a(struct rtw_adapter *padapter, u8 *psta, u8 unicast_key) } /* jeff: set this becasue at least sw key is ready */ - padapter-securitypriv.busetkipkey = true; + padapter-securitypriv.busetkipkey = 1; res = rtw_enqueue_cmd23a(pcmdpriv, ph2c); diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index b912d09..8c6b094 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -1027,9 +1027,8 @@ rtw_joinbss_update_stainfo(struct rtw_adapter *padapter, /* security related */ if (padapter-securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { - padapter-securitypriv.binstallGrpkey = false; - padapter-securitypriv.busetkipkey = false; - padapter-securitypriv.bgrpkey_handshake = false; + padapter-securitypriv.binstallGrpkey = 0; + padapter-securitypriv.busetkipkey = 0; psta-ieee8021x_blocked = true; psta-dot118021XPrivacy = diff --git a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c index 96337a8..707b5cc 100644 --- a/drivers/staging/rtl8723au/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8723au/core/rtw_pwrctrl.c @@ -306,7 +306,7 @@ static u8 PS_RDY_CHECK(struct rtw_adapter * padapter) if (pwrpriv-bInSuspend) return false; if (padapter-securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X - padapter-securitypriv.binstallGrpkey == false) { + !padapter-securitypriv.binstallGrpkey) { DBG_8723A(Group handshake still in progress !!!\n); return false; } diff --git a/drivers/staging/rtl8723au/core/rtw_recv.c b/drivers/staging/rtl8723au/core/rtw_recv.c index eda495a..84e6a18 100644 --- a/drivers/staging/rtl8723au/core/rtw_recv.c +++ b/drivers/staging/rtl8723au/core/rtw_recv.c @@ -313,7 +313,7 @@ int recvframe_chkmic(struct rtw_adapter *adapter, RT_TRACE(_module_rtl871x_recv_c_, _drv_info_, (\n recvframe_chkmic: bcmc key\n)); - if (psecuritypriv-binstallGrpkey == false) { + if (!psecuritypriv-binstallGrpkey) { res = _FAIL; RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, @@ -442,9 +442,9 @@ int recvframe_chkmic(struct rtw_adapter *adapter, res = _FAIL; } else { /* mic checked ok */ - if ((psecuritypriv-bcheck_grpkey == false) - (is_multicast_ether_addr(prxattrib-ra))) { - psecuritypriv-bcheck_grpkey = true; + if (!psecuritypriv-bcheck_grpkey + is_multicast_ether_addr(prxattrib-ra)) { + psecuritypriv-bcheck_grpkey = 1; RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, (psecuritypriv-bcheck_grp @@ -507,7 +507,7 @@ struct recv_frame *decryptor(struct rtw_adapter *padapter, } if ((prxattrib-encrypt 0) ((prxattrib-bdecrypted == 0))) { - psecuritypriv-hw_decrypted = false; + psecuritypriv-hw_decrypted = 0; switch (prxattrib-encrypt) { case _WEP40_: case _WEP104_: @@ -525,7 +525,7 @@ struct recv_frame *decryptor(struct rtw_adapter *padapter,
Re: [PATCH 05/74] staging: rtl8723au: Fix up some random bit-flag handling
On Wed, May 21, 2014 at 09:37:29AM +0200, jes.soren...@redhat.com wrote: diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index b912d09..8c6b094 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -1027,9 +1027,8 @@ rtw_joinbss_update_stainfo(struct rtw_adapter *padapter, /* security related */ if (padapter-securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { - padapter-securitypriv.binstallGrpkey = false; - padapter-securitypriv.busetkipkey = false; - padapter-securitypriv.bgrpkey_handshake = false; + padapter-securitypriv.binstallGrpkey = 0; + padapter-securitypriv.busetkipkey = 0; You remove -bgrpkey_handshake in this patch. That's fine because it is a write-only variable. But that's should be in a separate patch and described in the changelog next time. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 05/74] staging: rtl8723au: Fix up some random bit-flag handling
Dan Carpenter dan.carpen...@oracle.com writes: On Wed, May 21, 2014 at 09:37:29AM +0200, jes.soren...@redhat.com wrote: diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index b912d09..8c6b094 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -1027,9 +1027,8 @@ rtw_joinbss_update_stainfo(struct rtw_adapter *padapter, /* security related */ if (padapter-securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { -padapter-securitypriv.binstallGrpkey = false; -padapter-securitypriv.busetkipkey = false; -padapter-securitypriv.bgrpkey_handshake = false; +padapter-securitypriv.binstallGrpkey = 0; +padapter-securitypriv.busetkipkey = 0; You remove -bgrpkey_handshake in this patch. That's fine because it is a write-only variable. But that's should be in a separate patch and described in the changelog next time. Dan, When cleaning up the mess of this driver, things happen. I can figure out when to submit things and when not to. If you find bugs, I certainly appreciate the reports but this is just -ENITPICK. Jes ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 05/74] staging: rtl8723au: Fix up some random bit-flag handling
On Wed, May 21, 2014 at 10:49:55AM +0200, Jes Sorensen wrote: Dan Carpenter dan.carpen...@oracle.com writes: On Wed, May 21, 2014 at 09:37:29AM +0200, jes.soren...@redhat.com wrote: diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c index b912d09..8c6b094 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme.c @@ -1027,9 +1027,8 @@ rtw_joinbss_update_stainfo(struct rtw_adapter *padapter, /* security related */ if (padapter-securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { - padapter-securitypriv.binstallGrpkey = false; - padapter-securitypriv.busetkipkey = false; - padapter-securitypriv.bgrpkey_handshake = false; + padapter-securitypriv.binstallGrpkey = 0; + padapter-securitypriv.busetkipkey = 0; You remove -bgrpkey_handshake in this patch. That's fine because it is a write-only variable. But that's should be in a separate patch and described in the changelog next time. Dan, When cleaning up the mess of this driver, things happen. Yes. I understand. Appology accepted. :P I can figure out when to submit things and when not to. You are definitely awesome. :) If you find bugs, I certainly appreciate the reports but this is just -ENITPICK. Don't get your drawers in a twist. I'm not saying you should redo the patch. These are just mechanical comments I send to everyone so that you will do it correctly next time. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel