mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 14:13:01 -04:00
qcacld-3.0: Introduce wma_validate_handle()
Introduce wma_validate_handle() with the caller function name embedded in it to validate the WMA handle and log incase of error. Calling functions can avoid logging in case wma_validate_handle() returns -EINVAL. This reduces logging and thereby memory foot print. Change-Id: If38436a590d8b950509bde40468b9ddc3cf33e8d CRs-Fixed: 2833040
This commit is contained in:
parent
31c63f8088
commit
28fe4a42b5
2 changed files with 20 additions and 0 deletions
|
|
@ -1040,6 +1040,16 @@ typedef struct {
|
|||
bool enable_tx_compl_tsf64;
|
||||
} t_wma_handle, *tp_wma_handle;
|
||||
|
||||
/**
|
||||
* wma_validate_handle() - Validate WMA handle
|
||||
* @wma_handle: wma handle
|
||||
*
|
||||
* Return: errno if WMA handle is NULL; 0 otherwise
|
||||
*/
|
||||
#define wma_validate_handle(wma_handle) \
|
||||
__wma_validate_handle(wma_handle, __func__)
|
||||
int __wma_validate_handle(tp_wma_handle wma_handle, const char *func);
|
||||
|
||||
/**
|
||||
* wma_vdev_nss_chain_params_send() - send vdev nss chain params to fw.
|
||||
* @vdev_id: vdev_id
|
||||
|
|
|
|||
|
|
@ -187,6 +187,16 @@ struct wma_ini_config *wma_get_ini_handle(tp_wma_handle wma)
|
|||
return &wma->ini_config;
|
||||
}
|
||||
|
||||
int __wma_validate_handle(tp_wma_handle wma_handle, const char *func)
|
||||
{
|
||||
if (!wma_handle) {
|
||||
wma_err("Invalid WMA handle (via %s)", func);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define MAX_SUPPORTED_PEERS_REV1_1 14
|
||||
#define MAX_SUPPORTED_PEERS_REV1_3 32
|
||||
#ifdef WLAN_MAX_CLIENTS_ALLOWED
|
||||
|
|
|
|||
Loading…
Reference in a new issue