staging: style cleanups for sm750fb and rtl8723bs
cover staging: style cleanups for sm750fb and rtl8723bs
This patch series performs various style cleanups in the staging directory to resolve warnings reported by checkpatch.pl.
The changes include:
- Fixing 'static const char * const' declarations in sm750fb.
- Removing trailing whitespace in rtw_mlme.c.
- Simplifying boolean expressions by removing unnecessary parentheses and explicit comparisons to 'true'.
All patches have been checked with checkpatch.pl and the modified files have been verified to compile correctly.
Lorenzo Simonelli (3):
staging: sm750fb: fix static const char array warning
staging: rtl8723bs: remove trailing whitespace
staging: rtl8723bs: remove unnecessary parentheses and true comparisons
drivers/staging/rtl8723bs/core/rtw_mlme.c | 14 +++++++------- drivers/staging/sm750fb/sm750.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-)
Signature · 1 line
2.52.0
PATCH 1/3 staging: sm750fb: fix static const char array warning
Fix the checkpatch.pl warning: "static const char * array should probably be static const char * const" by adding the missing const modifier.
--- drivers/staging/sm750fb/sm750.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/sm750fb/sm750.c +1 -1
@@ -33,7 +33,7 @@static int g_hwcursor =1 ;static int g_noaccel;static int g_nomtrr; -static const char *g_fbmode[] = {NULL ,NULL }; +static const char *const g_fbmode[] = {NULL ,NULL };static const char *g_def_fbmode ="1024x768-32@60" ;static char *g_settings;static int g_dualview;
Signature · 1 line
2.52.0
Greg KH
maintainerRe: [PATCH 1/3] staging: sm750fb: fix static const char array warning
Quoted 25 lines · Lorenzo Simonelli
Fix the checkpatch.pl warning: "static const char * array should probably be static const char * const" by adding the missing const modifier.
Signed-off-by Lorenzo Simonelli <[email protected]>--- drivers/staging/sm750fb/sm750.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/sm750fb/sm750.c +1
-1@@ -33,7 +33,7 @@static int g_hwcursor =1 ;static int g_noaccel;static int g_nomtrr; -static const char *g_fbmode[] = {NULL ,NULL }; +static const char *const g_fbmode[] = {NULL ,NULL };static const char *g_def_fbmode ="1024x768-32@60" ;static char *g_settings;static int g_dualview;Signature · 1 line
2.52.0
Please ALWAYS test-build your patches before sending them out. That way you catch obvious bugs like the one that this change introduces :(
thanks,
greg k-h
PATCH 2/3 staging: rtl8723bs: remove trailing whitespace
In reply to Lorenzo SimonelliRemove a trailing whitespace found by checkpatch.pl in rtw_mlme.c at line 2021.
--- drivers/staging/rtl8723bs/core/rtw_mlme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8723bs/core/rtw_mlme.c +1 -1
@@ -2018,7 +2018,7 @@ int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_return ielength; } -/* Ported from 8185: IsInPreAuthKeyList(). +/* Ported from 8185: IsInPreAuthKeyList(). * (Renamed from SecIsInPreAuthKeyList(), 2006-10-13.) * Added by Annie, 2006-05-07. *
Signature · 1 line
2.52.0
PATCH 3/3 staging: rtl8723bs: remove unnecessary parentheses and true comparisons
In reply to Lorenzo SimonelliClean up unnecessary double parentheses and explicit comparisons to true in rtw_mlme.c. This improves readability and adheres to the Linux kernel coding style
--- drivers/staging/rtl8723bs/core/rtw_mlme.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/rtl8723bs/core/rtw_mlme.c +6 -6
@@ -468,11 +468,11 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex &pmlmepriv->cur_network.network, &pmlmepriv->cur_network.network, &pmlmepriv->cur_network.network); - -if ((check_fwstate (pmlmepriv, _FW_LINKED) == true) && (is_same_network (&pmlmepriv->cur_network.network, pnetwork,0 ))) { +if ((check_fwstate (pmlmepriv, _FW_LINKED) == true) && + (is_same_network (&pmlmepriv->cur_network.network, pnetwork,0 ))) {update_network (&pmlmepriv->cur_network.network, pnetwork, adapter, true);rtw_update_protection (adapter, (pmlmepriv->cur_network.network.ies) +sizeof (struct ndis_802_11_fix_ie ), - pmlmepriv->cur_network.network.ie_length); + pmlmepriv->cur_network.network.ie_length); } }
@@ -710,7 +710,7 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)rtw_set_signal_stat_timer (&adapter->recvpriv);if (pmlmepriv->to_join) { -if ((check_fwstate (pmlmepriv,WIFI_ADHOC_STATE ) == true)) { +if (check_fwstate (pmlmepriv,WIFI_ADHOC_STATE )) {if (check_fwstate (pmlmepriv, _FW_LINKED) == false) {set_fwstate (pmlmepriv, _FW_UNDER_LINKING);
@@ -1386,8 +1386,8 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)spin_lock_bh (&pmlmepriv->lock); -if ((check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ) == true) || - (check_fwstate (pmlmepriv,WIFI_ADHOC_STATE ) == true)) { +if (check_fwstate (pmlmepriv,WIFI_ADHOC_MASTER_STATE ) || +check_fwstate (pmlmepriv,WIFI_ADHOC_STATE )) {if (adapter->stapriv.asoc_sta_count ==2 ) {spin_lock_bh (&pmlmepriv->scanned_queue.lock); ptarget_wlan =rtw_find_network (&pmlmepriv->scanned_queue, cur_network->network.mac_address);
Signature · 1 line
2.52.0