DCE-KMD: pm.c: Remove USE() usage

- We're using USE() to forcefully use a parameter to avoid
  compilation errors in HVRTOS.

- Add a validity check instead to such parameters. This will
  resolve unused varaiable errors as well as add meaningful
  checks, instead of forcefully using params.

JIRA TDS-16126

Change-Id: I4bad1b8fff8ebabc9eb3bd6edfe7cf1f1549e7ef
Signed-off-by: anupamg <anupamg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3225292
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Arun Swain <arswain@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mahesh Kumar <mahkumar@nvidia.com>
This commit is contained in:
anupamg
2024-10-07 21:49:39 +00:00
committed by Jon Hunter
parent 90a02e9ca3
commit 302458450a

View File

@@ -60,10 +60,12 @@ void dce_resume_work_fn(struct tegra_dce *d)
*/ */
int dce_pm_handle_sc7_enter_requested_event(struct tegra_dce *d, void *params) int dce_pm_handle_sc7_enter_requested_event(struct tegra_dce *d, void *params)
{ {
USE(params);
int ret = 0; int ret = 0;
struct dce_ipc_message *msg = NULL; struct dce_ipc_message *msg = NULL;
if (params != NULL)
dce_warn(d, "Params aren't expected in this function\n");
msg = dce_get_admin_msg_buffer(d); msg = dce_get_admin_msg_buffer(d);
if (!msg) { if (!msg) {
dce_err(d, "IPC msg allocation failed"); dce_err(d, "IPC msg allocation failed");
@@ -94,7 +96,9 @@ out:
*/ */
int dce_pm_handle_sc7_enter_received_event(struct tegra_dce *d, void *params) int dce_pm_handle_sc7_enter_received_event(struct tegra_dce *d, void *params)
{ {
USE(params); if (params != NULL)
dce_warn(d, "Params aren't expected in this function\n");
dce_wakeup_interruptible(d, DCE_WAIT_SC7_ENTER); dce_wakeup_interruptible(d, DCE_WAIT_SC7_ENTER);
return 0; return 0;
} }
@@ -110,7 +114,9 @@ int dce_pm_handle_sc7_enter_received_event(struct tegra_dce *d, void *params)
*/ */
int dce_pm_handle_sc7_exit_received_event(struct tegra_dce *d, void *params) int dce_pm_handle_sc7_exit_received_event(struct tegra_dce *d, void *params)
{ {
USE(params); if (params != NULL)
dce_warn(d, "Params aren't expected in this function\n");
dce_schedule_work(&d->dce_resume_work); dce_schedule_work(&d->dce_resume_work);
return 0; return 0;
} }
@@ -187,6 +193,8 @@ done:
void dce_pm_deinit(struct tegra_dce *d) void dce_pm_deinit(struct tegra_dce *d)
{ {
USE(d); if (d == NULL)
// Nothing to do. dce_warn(NULL, "DCE struct is expected to be valid.\n");
return;
} }