From 74696bbda0e115fc8e345114f8c70c20fc13e3e6 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Tue, 13 Nov 2018 13:30:36 -0800 Subject: [PATCH] qcacld-3.0: Refactor WE_SET_11AX_RATE ioctl processing 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 refactor the WE_SET_11AX_RATE ioctl handling into a separate function with a consistent int()(adapter, value) signature. Change-Id: Iaaba30073d59f96faddcb9f9baaabc60b8e58ee5 CRs-Fixed: 2350070 --- core/hdd/src/wlan_hdd_wext.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 1ba36e666932..1c1e1398bbe5 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -5134,6 +5134,11 @@ static int hdd_we_set_conc_system_pref(struct hdd_adapter *adapter, return 0; } +static int hdd_we_set_11ax_rate(struct hdd_adapter *adapter, int rate) +{ + return hdd_set_11ax_rate(adapter, rate, NULL); +} + /** * iw_setint_getnone() - Generic "set integer" private ioctl handler * @dev: device upon which the ioctl was received @@ -5506,7 +5511,7 @@ static int __iw_setint_getnone(struct net_device *dev, break; case WE_SET_11AX_RATE: - ret = hdd_set_11ax_rate(adapter, set_value, NULL); + ret = hdd_we_set_11ax_rate(adapter, set_value); break; case WE_SET_DCM: