qcacmn: Introduce wmi_validate_handle()

Introduce wmi_validate_handle() with the caller function name
embedded in it to validate the WMI handle and log incase
of error. Calling functions can avoid logging in case
wmi_validate_handle() returns -EINVAL. This reduces logging and
thereby memory foot print.

Change-Id: Ie0a6a84ffad6e5cf2da8f547c7209dc77cdf5729
CRs-Fixed: 2838960
This commit is contained in:
Srinivas Girigowda
2020-12-15 11:02:16 -08:00
committed by snandini
parent 0e390d9bab
commit 7db601e3af
2 changed files with 23 additions and 0 deletions

View File

@@ -3639,3 +3639,13 @@ void wmi_pdev_id_conversion_enable(wmi_unified_t wmi_handle,
pdev_id_map,
size);
}
int __wmi_validate_handle(wmi_unified_t wmi_handle, const char *func)
{
if (!wmi_handle) {
wmi_err("Invalid WMI handle (via %s)", func);
return -EINVAL;
}
return 0;
}