From deab857b1b393e2ff5f7c20ea26ac9890c01b0c8 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Tue, 13 Nov 2018 15:29:53 -0800 Subject: [PATCH] qcacld-3.0: Change hdd_we_set_11d_state() signature One of the HDD functions with the highest cyclomatic complexity is __iw_setint_getnone(). In order to reduce the complexity there is a plan to replace the existing switch with a vtable. As part of that goal update hdd_we_set_11d_state() to conform with a consistent int()(adapter, value) signature. Change-Id: I96a7424630ffc9fd3a8713d980fe6efad4a7be05 CRs-Fixed: 2350071 --- core/hdd/src/wlan_hdd_wext.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 655403e4b12c..0e3e2ec4562a 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -4075,8 +4075,9 @@ free_config: return errno; } -static int hdd_we_set_11d_state(struct hdd_context *hdd_ctx, int state_11d) +static int hdd_we_set_11d_state(struct hdd_adapter *adapter, int state_11d) { + struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter); tSmeConfigParams *sme_config; bool enable_11d; mac_handle_t mac_handle = hdd_ctx->mac_handle; @@ -5173,7 +5174,6 @@ static int __iw_setint_getnone(struct net_device *dev, union iwreq_data *wrqu, char *extra) { struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev); - mac_handle_t mac_handle; struct hdd_context *hdd_ctx; int *value = (int *)extra; int sub_cmd = value[0]; @@ -5191,10 +5191,9 @@ static int __iw_setint_getnone(struct net_device *dev, if (ret) return ret; - mac_handle = hdd_ctx->mac_handle; switch (sub_cmd) { case WE_SET_11D_STATE: - ret = hdd_we_set_11d_state(hdd_ctx, set_value); + ret = hdd_we_set_11d_state(adapter, set_value); break; case WE_SET_POWER: