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:

committed by
snandini

parent
006d2531ef
commit
328cdc189c
@@ -1040,6 +1040,16 @@ typedef struct {
|
|||||||
bool enable_tx_compl_tsf64;
|
bool enable_tx_compl_tsf64;
|
||||||
} t_wma_handle, *tp_wma_handle;
|
} 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.
|
* wma_vdev_nss_chain_params_send() - send vdev nss chain params to fw.
|
||||||
* @vdev_id: vdev_id
|
* @vdev_id: vdev_id
|
||||||
|
@@ -177,6 +177,16 @@ struct wma_ini_config *wma_get_ini_handle(tp_wma_handle wma)
|
|||||||
return &wma->ini_config;
|
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_1 14
|
||||||
#define MAX_SUPPORTED_PEERS_REV1_3 32
|
#define MAX_SUPPORTED_PEERS_REV1_3 32
|
||||||
#ifdef WLAN_MAX_CLIENTS_ALLOWED
|
#ifdef WLAN_MAX_CLIENTS_ALLOWED
|
||||||
|
Reference in New Issue
Block a user