From 0dd687eda059c75d5c59ff4ed27ed6e8a3541137 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 16 Nov 2018 20:11:27 -0800 Subject: [PATCH] qcacld-3.0: Use vtable for reorder timeout One of the HDD functions with the highest cyclomatic complexity is __wlan_hdd_cfg80211_wifi_configuration_set(). In order to reduce the complexity there is a plan to replace the inline attribute handling with a vtable-based approach. As part of that goal update the signature of the following function and add that function to the vtable: - wlan_hdd_cfg80211_wifi_set_reorder_timeout() Change-Id: Ia9c160eb81358b91feecb35b1cb8c097f90979cc CRs-Fixed: 2371593 --- core/hdd/src/wlan_hdd_cfg80211.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index d0f186d66b43..855f0fc59bbd 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -5458,16 +5458,17 @@ static int wlan_hdd_handle_restrict_offchan_config(struct hdd_adapter *adapter, } /** - * wlan_hdd_cfg80211_wifi_set_reorder_timeout - set reorder timeout - * @hdd_ctx: hdd context + * wlan_hdd_cfg80211_wifi_set_reorder_timeout() - set reorder timeout + * @adapter: Pointer to HDD adapter * @tb: array of pointer to struct nlattr * * Return: 0 on success; error number otherwise */ static -int wlan_hdd_cfg80211_wifi_set_reorder_timeout(struct hdd_context *hdd_ctx, +int wlan_hdd_cfg80211_wifi_set_reorder_timeout(struct hdd_adapter *adapter, struct nlattr *tb[]) { + struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); int ret_val = 0; QDF_STATUS qdf_status; struct sir_set_rx_reorder_timeout_val reorder_timeout; @@ -6521,6 +6522,7 @@ static const interdependent_setter_fn interdependent_setters[] = { hdd_config_mpdu_aggregation, hdd_config_ant_div_period, hdd_config_ant_div_snr_weight, + wlan_hdd_cfg80211_wifi_set_reorder_timeout, }; /** @@ -6609,11 +6611,6 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, /* return errno here when all attributes have been refactored */ - ret_val = - wlan_hdd_cfg80211_wifi_set_reorder_timeout(hdd_ctx, tb); - if (ret_val != 0) - return ret_val; - ret_val = wlan_hdd_cfg80211_wifi_set_rx_blocksize(hdd_ctx, adapter, tb); if (ret_val != 0)