[PATCH] staging: rtl8712: Fix Comparison with constant warning.
Fix Comparisons with constant on the left side of the test. Checkpatch.pl warning. -- WARNING: Comparisons should place the constant on the right side of the test 296: FILE: ./rtl8712_cmd.c:296: while ((0 != r8712_read32(pAdapter, IOCMD_CTRL_REG)) && Signed-off-by: Pinkesh Badjatiya --- drivers/staging/rtl8712/rtl8712_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c index 9b91609..ce3f7da 100644 --- a/drivers/staging/rtl8712/rtl8712_cmd.c +++ b/drivers/staging/rtl8712/rtl8712_cmd.c @@ -293,7 +293,7 @@ u8 r8712_fw_cmd(struct _adapter *pAdapter, u32 cmd) r8712_write32(pAdapter, IOCMD_CTRL_REG, cmd); msleep(100); - while ((0 != r8712_read32(pAdapter, IOCMD_CTRL_REG)) && + while ((r8712_read32(pAdapter, IOCMD_CTRL_REG) != 0) && (pollingcnts > 0)) { pollingcnts--; msleep(20); -- 1.9.1
[PATCH] staging: rtl8712: Fix Comparison with constant warning.
Fix Comparisons with constant on the left side of the test. Checkpatch.pl warning. -- WARNING: Comparisons should place the constant on the right side of the test 296: FILE: ./rtl8712_cmd.c:296: while ((0 != r8712_read32(pAdapter, IOCMD_CTRL_REG)) && Signed-off-by: Pinkesh Badjatiya <pinkeshbadjat...@gmail.com> --- drivers/staging/rtl8712/rtl8712_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c index 9b91609..ce3f7da 100644 --- a/drivers/staging/rtl8712/rtl8712_cmd.c +++ b/drivers/staging/rtl8712/rtl8712_cmd.c @@ -293,7 +293,7 @@ u8 r8712_fw_cmd(struct _adapter *pAdapter, u32 cmd) r8712_write32(pAdapter, IOCMD_CTRL_REG, cmd); msleep(100); - while ((0 != r8712_read32(pAdapter, IOCMD_CTRL_REG)) && + while ((r8712_read32(pAdapter, IOCMD_CTRL_REG) != 0) && (pollingcnts > 0)) { pollingcnts--; msleep(20); -- 1.9.1
[PATCH] Removed extra spaces, and error from checkpatch.pl
Removed trailing spaces. Fixed some errors from checkpatch.pl verification. No changes made to actual functional code. Signed-off-by: Pinkesh Badjatiya --- drivers/staging/rtl8723au/include/rtw_cmd.h | 162 ++-- 1 file changed, 80 insertions(+), 82 deletions(-) diff --git a/drivers/staging/rtl8723au/include/rtw_cmd.h b/drivers/staging/rtl8723au/include/rtw_cmd.h index d1fa95d..82e6411 100644 --- a/drivers/staging/rtl8723au/include/rtw_cmd.h +++ b/drivers/staging/rtl8723au/include/rtw_cmd.h @@ -60,10 +60,10 @@ struct evt_priv { do {\ pcmd->cmdcode = code;\ pcmd->parmbuf = (u8 *)(pparm);\ - pcmd->cmdsz = sizeof (*pparm);\ + pcmd->cmdsz = sizeof(*pparm);\ pcmd->rsp = NULL;\ pcmd->rspsz = 0;\ -} while(0) +} while (0) struct c2h_evt_hdr { u8 id:4; @@ -97,12 +97,11 @@ int rtw_cmd_thread23a(void *context); int rtw_init_cmd_priv23a(struct cmd_priv *pcmdpriv); -u32 rtw_init_evt_priv23a (struct evt_priv *pevtpriv); -void rtw_free_evt_priv23a (struct evt_priv *pevtpriv); +u32 rtw_init_evt_priv23a(struct evt_priv *pevtpriv); +void rtw_free_evt_priv23a(struct evt_priv *pevtpriv); void rtw_evt_notify_isr(struct evt_priv *pevtpriv); -enum rtw_drvextra_cmd_id -{ +enum rtw_drvextra_cmd_id { NONE_WK_CID, DYNAMIC_CHK_WK_CID, DM_CTRL_WK_CID, @@ -118,14 +117,13 @@ enum rtw_drvextra_cmd_id MAX_WK_CID }; -enum LPS_CTRL_TYPE -{ - LPS_CTRL_SCAN=0, - LPS_CTRL_JOINBSS=1, - LPS_CTRL_CONNECT=2, - LPS_CTRL_DISCONNECT=3, - LPS_CTRL_SPECIAL_PACKET=4, - LPS_CTRL_LEAVE=5, +enum LPS_CTRL_TYPE { + LPS_CTRL_SCAN = 0, + LPS_CTRL_JOINBSS = 1, + LPS_CTRL_CONNECT = 2, + LPS_CTRL_DISCONNECT = 3, + LPS_CTRL_SPECIAL_PACKET = 4, + LPS_CTRL_LEAVE = 5, }; enum RFINTFS { @@ -555,41 +553,41 @@ struct getratable_rsp { }; /* to get TX,RX retry count */ -struct gettxretrycnt_parm{ +struct gettxretrycnt_parm { unsigned int rsvd; }; -struct gettxretrycnt_rsp{ +struct gettxretrycnt_rsp { unsigned long tx_retrycnt; }; -struct getrxretrycnt_parm{ +struct getrxretrycnt_parm { unsigned int rsvd; }; -struct getrxretrycnt_rsp{ +struct getrxretrycnt_rsp { unsigned long rx_retrycnt; }; /* to get BCNOK,BCNERR count */ -struct getbcnokcnt_parm{ +struct getbcnokcnt_parm { unsigned int rsvd; }; -struct getbcnokcnt_rsp{ +struct getbcnokcnt_rsp { unsigned long bcnokcnt; }; -struct getbcnerrcnt_parm{ +struct getbcnerrcnt_parm { unsigned int rsvd; }; -struct getbcnerrcnt_rsp{ +struct getbcnerrcnt_rsp { unsigned long bcnerrcnt; }; /* to get current TX power level */ -struct getcurtxpwrlevel_parm{ +struct getcurtxpwrlevel_parm { unsigned int rsvd; }; -struct getcurtxpwrlevel_rsp{ +struct getcurtxpwrlevel_rsp { unsigned short tx_power; }; @@ -683,38 +681,38 @@ int rtw_createbss_cmd23a_ex(struct rtw_adapter *padapter, unsigned char *pbss, int rtw_setphy_cmd(struct rtw_adapter *padapter, u8 modem, u8 ch); int rtw_setstakey_cmd23a(struct rtw_adapter *padapter, u8 *psta, u8 unicast_key); int rtw_clearstakey_cmd23a(struct rtw_adapter *padapter, u8 *psta, u8 entry, u8 enqueue); -int rtw_joinbss_cmd23a(struct rtw_adapter *padapter, struct wlan_network* pnetwork); +int rtw_joinbss_cmd23a(struct rtw_adapter *padapter, struct wlan_network *pnetwork); int rtw_disassoc_cmd23a(struct rtw_adapter *padapter, u32 deauth_timeout_ms, bool enqueue); int rtw_setopmode_cmd23a(struct rtw_adapter *padapter, enum nl80211_iftype ifmode); -int rtw_setdatarate_cmd(struct rtw_adapter *padapter, u8 *rateset); -int rtw_setbasicrate_cmd(struct rtw_adapter *padapter, u8 *rateset); +int rtw_setdatarate_cmd(struct rtw_adapter *padapter, u8 *rateset); +int rtw_setbasicrate_cmd(struct rtw_adapter *padapter, u8 *rateset); int rtw_setbbreg_cmd(struct rtw_adapter *padapter, u8 offset, u8 val); int rtw_setrfreg_cmd(struct rtw_adapter *padapter, u8 offset, u32 val); int rtw_getbbreg_cmd(struct rtw_adapter *padapter, u8 offset, u8 *pval); int rtw_getrfreg_cmd(struct rtw_adapter *padapter, u8 offset, u8 *pval); -int rtw_setrfintfs_cmd(struct rtw_adapter *padapter, u8 mode); -int rtw_setrttbl_cmd(struct rtw_adapter *padapter, struct setratable_parm *prate_table); -int rtw_getrttbl_cmd(struct rtw_adapter *padapter, struct getratable_rsp *pval); +int rtw_setrfintfs_cmd(struct rtw_adapter *padapter, u8 mode); +int rtw_setrttbl_cmd(struct rtw_adapter *padapter, struct setratable_parm *prate_table); +int rtw_getrttbl_cmd(struct rtw_adapter *padapter, struct getratable_rsp *pval); -int rtw_gettssi_cmd(struct rtw_adapter *padapter, u8 offset, u8 *pval); -int rtw_setfwdig_cmd(struct rtw_adapter*padapter, u8 type); -int rtw_setfwra_cmd(struct rtw_adapter*padapter, u8 type); +int rtw_gettssi_cmd(struct rtw_adapter *padapter, u8 offset, u8 *pval); +int rtw_setfwdig_cmd(
[PATCH] Removed extra spaces, and error from checkpatch.pl
Removed trailing spaces. Fixed some errors from checkpatch.pl verification. No changes made to actual functional code. Signed-off-by: Pinkesh Badjatiya <pinkeshbadjat...@gmail.com> --- drivers/staging/rtl8723au/include/rtw_cmd.h | 162 ++-- 1 file changed, 80 insertions(+), 82 deletions(-) diff --git a/drivers/staging/rtl8723au/include/rtw_cmd.h b/drivers/staging/rtl8723au/include/rtw_cmd.h index d1fa95d..82e6411 100644 --- a/drivers/staging/rtl8723au/include/rtw_cmd.h +++ b/drivers/staging/rtl8723au/include/rtw_cmd.h @@ -60,10 +60,10 @@ struct evt_priv { do {\ pcmd->cmdcode = code;\ pcmd->parmbuf = (u8 *)(pparm);\ - pcmd->cmdsz = sizeof (*pparm);\ + pcmd->cmdsz = sizeof(*pparm);\ pcmd->rsp = NULL;\ pcmd->rspsz = 0;\ -} while(0) +} while (0) struct c2h_evt_hdr { u8 id:4; @@ -97,12 +97,11 @@ int rtw_cmd_thread23a(void *context); int rtw_init_cmd_priv23a(struct cmd_priv *pcmdpriv); -u32 rtw_init_evt_priv23a (struct evt_priv *pevtpriv); -void rtw_free_evt_priv23a (struct evt_priv *pevtpriv); +u32 rtw_init_evt_priv23a(struct evt_priv *pevtpriv); +void rtw_free_evt_priv23a(struct evt_priv *pevtpriv); void rtw_evt_notify_isr(struct evt_priv *pevtpriv); -enum rtw_drvextra_cmd_id -{ +enum rtw_drvextra_cmd_id { NONE_WK_CID, DYNAMIC_CHK_WK_CID, DM_CTRL_WK_CID, @@ -118,14 +117,13 @@ enum rtw_drvextra_cmd_id MAX_WK_CID }; -enum LPS_CTRL_TYPE -{ - LPS_CTRL_SCAN=0, - LPS_CTRL_JOINBSS=1, - LPS_CTRL_CONNECT=2, - LPS_CTRL_DISCONNECT=3, - LPS_CTRL_SPECIAL_PACKET=4, - LPS_CTRL_LEAVE=5, +enum LPS_CTRL_TYPE { + LPS_CTRL_SCAN = 0, + LPS_CTRL_JOINBSS = 1, + LPS_CTRL_CONNECT = 2, + LPS_CTRL_DISCONNECT = 3, + LPS_CTRL_SPECIAL_PACKET = 4, + LPS_CTRL_LEAVE = 5, }; enum RFINTFS { @@ -555,41 +553,41 @@ struct getratable_rsp { }; /* to get TX,RX retry count */ -struct gettxretrycnt_parm{ +struct gettxretrycnt_parm { unsigned int rsvd; }; -struct gettxretrycnt_rsp{ +struct gettxretrycnt_rsp { unsigned long tx_retrycnt; }; -struct getrxretrycnt_parm{ +struct getrxretrycnt_parm { unsigned int rsvd; }; -struct getrxretrycnt_rsp{ +struct getrxretrycnt_rsp { unsigned long rx_retrycnt; }; /* to get BCNOK,BCNERR count */ -struct getbcnokcnt_parm{ +struct getbcnokcnt_parm { unsigned int rsvd; }; -struct getbcnokcnt_rsp{ +struct getbcnokcnt_rsp { unsigned long bcnokcnt; }; -struct getbcnerrcnt_parm{ +struct getbcnerrcnt_parm { unsigned int rsvd; }; -struct getbcnerrcnt_rsp{ +struct getbcnerrcnt_rsp { unsigned long bcnerrcnt; }; /* to get current TX power level */ -struct getcurtxpwrlevel_parm{ +struct getcurtxpwrlevel_parm { unsigned int rsvd; }; -struct getcurtxpwrlevel_rsp{ +struct getcurtxpwrlevel_rsp { unsigned short tx_power; }; @@ -683,38 +681,38 @@ int rtw_createbss_cmd23a_ex(struct rtw_adapter *padapter, unsigned char *pbss, int rtw_setphy_cmd(struct rtw_adapter *padapter, u8 modem, u8 ch); int rtw_setstakey_cmd23a(struct rtw_adapter *padapter, u8 *psta, u8 unicast_key); int rtw_clearstakey_cmd23a(struct rtw_adapter *padapter, u8 *psta, u8 entry, u8 enqueue); -int rtw_joinbss_cmd23a(struct rtw_adapter *padapter, struct wlan_network* pnetwork); +int rtw_joinbss_cmd23a(struct rtw_adapter *padapter, struct wlan_network *pnetwork); int rtw_disassoc_cmd23a(struct rtw_adapter *padapter, u32 deauth_timeout_ms, bool enqueue); int rtw_setopmode_cmd23a(struct rtw_adapter *padapter, enum nl80211_iftype ifmode); -int rtw_setdatarate_cmd(struct rtw_adapter *padapter, u8 *rateset); -int rtw_setbasicrate_cmd(struct rtw_adapter *padapter, u8 *rateset); +int rtw_setdatarate_cmd(struct rtw_adapter *padapter, u8 *rateset); +int rtw_setbasicrate_cmd(struct rtw_adapter *padapter, u8 *rateset); int rtw_setbbreg_cmd(struct rtw_adapter *padapter, u8 offset, u8 val); int rtw_setrfreg_cmd(struct rtw_adapter *padapter, u8 offset, u32 val); int rtw_getbbreg_cmd(struct rtw_adapter *padapter, u8 offset, u8 *pval); int rtw_getrfreg_cmd(struct rtw_adapter *padapter, u8 offset, u8 *pval); -int rtw_setrfintfs_cmd(struct rtw_adapter *padapter, u8 mode); -int rtw_setrttbl_cmd(struct rtw_adapter *padapter, struct setratable_parm *prate_table); -int rtw_getrttbl_cmd(struct rtw_adapter *padapter, struct getratable_rsp *pval); +int rtw_setrfintfs_cmd(struct rtw_adapter *padapter, u8 mode); +int rtw_setrttbl_cmd(struct rtw_adapter *padapter, struct setratable_parm *prate_table); +int rtw_getrttbl_cmd(struct rtw_adapter *padapter, struct getratable_rsp *pval); -int rtw_gettssi_cmd(struct rtw_adapter *padapter, u8 offset, u8 *pval); -int rtw_setfwdig_cmd(struct rtw_adapter*padapter, u8 type); -int rtw_setfwra_cmd(struct rtw_adapter*padapter, u8 type); +int rtw_gettssi_cmd(struct rtw_adapter *padapter, u8