qcacld-3.0: Refine iw_get_oem_data_cap()

The current implementaton of iw_get_oem_data_cap() has a few issues:
- It has identifiers with mixed-case and Hungarian notation
- It performs an unnecessary data copy

So refine the function to address these issues.

Change-Id: I3d445ea4024e072d66c3d59e8773d0ad72eb6178
CRs-Fixed: 2413669
This commit is contained in:
Jeff Johnson
2019-03-10 16:15:33 -07:00
committad av nshrivas
förälder 8f656c64b5
incheckning 03f3452478

Visa fil

@@ -146,29 +146,25 @@ int iw_get_oem_data_cap(struct net_device *dev,
struct iw_request_info *info, struct iw_request_info *info,
union iwreq_data *wrqu, char *extra) union iwreq_data *wrqu, char *extra)
{ {
int status; struct oem_data_cap *oem_data_cap = (void *)extra;
struct oem_data_cap oemDataCap = { {0} }; struct hdd_adapter *adapter = netdev_priv(dev);
struct oem_data_cap *pHddOemDataCap; struct hdd_context *hdd_ctx;
struct hdd_adapter *adapter = (netdev_priv(dev)); int errno;
struct hdd_context *pHddContext;
int ret;
hdd_enter(); hdd_enter();
pHddContext = WLAN_HDD_GET_CTX(adapter); hdd_ctx = WLAN_HDD_GET_CTX(adapter);
ret = wlan_hdd_validate_context(pHddContext); errno = wlan_hdd_validate_context(hdd_ctx);
if (0 != ret) if (errno)
return ret; return errno;
status = populate_oem_data_cap(adapter, &oemDataCap); qdf_mem_zero(oem_data_cap, sizeof(*oem_data_cap));
if (0 != status) { errno = populate_oem_data_cap(adapter, oem_data_cap);
if (errno) {
hdd_err("Failed to populate oem data capabilities"); hdd_err("Failed to populate oem data capabilities");
return status; return errno;
} }
pHddOemDataCap = (struct oem_data_cap *) (extra);
*pHddOemDataCap = oemDataCap;
hdd_exit(); hdd_exit();
return 0; return 0;
} }