wifi: mac80211_hwsim: code cleanup patches
Subsystems (2)
cover wifi: mac80211_hwsim: code cleanup patches
Fix all open checkpatch errors for the mac80211_hwsim module. Patches can be applied in any sequence.
Amol Dhamale (4):
wifi: mac80211_hwsim: remove explicit initialization of statics to
false
wifi: mac80211_hwsim: fix coding style issue by adding whitespaces
wifi: mac80211_hwsim: add sufficient parantheses to complex macro
wifi: mac80211_hwsim: use more restrictive permissions on debugfs
files
drivers/net/wireless/virtual/mac80211_hwsim.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-)
Signature · 1 line
2.43.0
PATCH 1/4 wifi: mac80211_hwsim: remove explicit initialization of statics to false
Adhere to Linux kernel coding style.
Reported by checkpatch:
ERROR: do not initialise statics to false
--- drivers/net/wireless/virtual/mac80211_hwsim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/virtual/mac80211_hwsim.c +2 -2
@@ -53,11 +53,11 @@ static int channels = 1;module_param (channels, int,0444 );MODULE_PARM_DESC (channels,"Number of concurrent channels" ); -static bool paged_rx = false; +static bool paged_rx;module_param (paged_rx, bool,0644 );MODULE_PARM_DESC (paged_rx,"Use paged SKBs for RX instead of linear ones" ); -static bool rctbl = false; +static bool rctbl;module_param (rctbl, bool,0444 );MODULE_PARM_DESC (rctbl,"Handle rate control table" );
Signature · 1 line
2.43.0
PATCH 2/4 wifi: mac80211_hwsim: fix coding style issue by adding whitespaces
In reply to Amol DhamaleAdhere to Linux kernel coding style.
Reported by checkpatch:
ERROR: space required after that ',' (ctx:VxV)
ERROR: space required before the open brace '{'
ERROR: space required after that ',' (ctx:VxV)
--- drivers/net/wireless/virtual/mac80211_hwsim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/virtual/mac80211_hwsim.c +3 -3
@@ -2504,7 +2504,7 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, int radio_idx,static void mac80211_hwsim_configure_filter (struct ieee80211_hw *hw,unsigned int changed_flags, -unsigned int *total_flags,u64 multicast) +unsigned int *total_flags,u64 multicast) {struct mac80211_hwsim_data *data = hw->priv;
@@ -5710,7 +5710,7 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,continue ; } -if (band !=NL80211_BAND_6GHZ ){ +if (band !=NL80211_BAND_6GHZ ) { sband->ht_cap.ht_supported = true; sband->ht_cap.cap =IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_GRN_FLD |
@@ -6398,7 +6398,7 @@ static int hwsim_new_radio_nl(struct sk_buff *msg, struct genl_info *info)if (info->attrs[HWSIM_ATTR_PERM_ADDR ]) {if (!is_valid_ether_addr (nla_data (info->attrs[HWSIM_ATTR_PERM_ADDR ]))) { -GENL_SET_ERR_MSG (info,"MAC is no valid source addr" ); +GENL_SET_ERR_MSG (info,"MAC is no valid source addr" );NL_SET_BAD_ATTR (info->extack, info->attrs[HWSIM_ATTR_PERM_ADDR ]);return -EINVAL ;
Signature · 1 line
2.43.0
PATCH 3/4 wifi: mac80211_hwsim: add sufficient parantheses to complex macro
In reply to Amol DhamaleAdhere to Linux kernel coding style.
Reported by checkpatch:
ERROR: Macros with complex values should be enclosed in parentheses
--- drivers/net/wireless/virtual/mac80211_hwsim.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/virtual/mac80211_hwsim.c +4 -4
@@ -5357,10 +5357,10 @@ static const u8 iftypes_ext_capa_ap[] = { };#define MAC80211_HWSIM_MLD_CAPA_OPS \ - FIELD_PREP_CONST(IEEE80211_MLD_CAP_OP_TID_TO_LINK_MAP_NEG_SUPP, \ - IEEE80211_MLD_CAP_OP_TID_TO_LINK_MAP_NEG_SUPP_SAME) | \ - FIELD_PREP_CONST(IEEE80211_MLD_CAP_OP_MAX_SIMUL_LINKS, \ - IEEE80211_MLD_MAX_NUM_LINKS - 1) + ((FIELD_PREP_CONST(IEEE80211_MLD_CAP_OP_TID_TO_LINK_MAP_NEG_SUPP, \ + IEEE80211_MLD_CAP_OP_TID_TO_LINK_MAP_NEG_SUPP_SAME)) | \ + (FIELD_PREP_CONST(IEEE80211_MLD_CAP_OP_MAX_SIMUL_LINKS, \ + IEEE80211_MLD_MAX_NUM_LINKS - 1)))static const struct wiphy_iftype_ext_capab mac80211_hwsim_iftypes_ext_capa[] = { {
Signature · 1 line
2.43.0
PATCH 4/4 wifi: mac80211_hwsim: use more restrictive permissions on debugfs files
In reply to Amol DhamaleAdhere to Linux kernel coding style.
Reported by checkpatch:
ERROR: Exporting writable files is usually an error. Consider more restrictive permissions.
--- drivers/net/wireless/virtual/mac80211_hwsim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/virtual/mac80211_hwsim.c +3 -3
@@ -5816,10 +5816,10 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, } data->debugfs =debugfs_create_dir ("hwsim" , hw->wiphy->debugfsdir); -debugfs_create_file ("ps" ,0666 , data->debugfs, data, &hwsim_fops_ps); -debugfs_create_file ("group" ,0666 , data->debugfs, data, +debugfs_create_file ("ps" ,0644 , data->debugfs, data, &hwsim_fops_ps); +debugfs_create_file ("group" ,0644 , data->debugfs, data, &hwsim_fops_group); -debugfs_create_file ("rx_rssi" ,0666 , data->debugfs, data, +debugfs_create_file ("rx_rssi" ,0644 , data->debugfs, data, &hwsim_fops_rx_rssi);if (!data->use_chanctx) debugfs_create_file("dfs_simulate_radar", 0222,
Signature · 1 line
2.43.0
Johannes Berg
maintainerQuoted 3 lines · Amol Dhamale
Fix all open checkpatch errors for the
mac80211_hwsimmodule. Patches can be applied in any sequence.
Please go play with staing or something instead, there's no reason to do random checkpatch cleanups on this.
johannes