[PATCH 35/35] media: venus: Refator return path

Ricardo Ribalda
2024-04-15T19:35:08Z

This is a nop, but let cocci now that this is not a good candidate for
min()

drivers/media/platform/qcom/venus/venc.c:611:12-13: WARNING opportunity for min()
drivers/media/platform/qcom/venus/venc.c:651:12-13: WARNING opportunity for min()
drivers/media/platform/qcom/venus/venc.c:629:12-13: WARNING opportunity for min()

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
drivers/media/platform/qcom/venus/venc.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index de06e1712d09..285bc1b4d888 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -608,7 +608,9 @@ static int venc_pm_get(struct venus_inst *inst)
ret = pm_runtime_resume_and_get(dev);
mutex_unlock(&core->pm_lock);

- return ret < 0 ? ret : 0;
+ if (ret < 0)
+ return ret;
+ return 0;
}

static int venc_pm_put(struct venus_inst *inst, bool autosuspend)
@@ -626,7 +628,9 @@ static int venc_pm_put(struct venus_inst *inst, bool autosuspend)

mutex_unlock(&core->pm_lock);

- return ret < 0 ? ret : 0;
+ if (ret < 0)
+ return ret;
+ return 0;
}

static int venc_pm_get_put(struct venus_inst *inst)
@@ -648,7 +652,9 @@ static int venc_pm_get_put(struct venus_inst *inst)
error:
mutex_unlock(&core->pm_lock);

- return ret < 0 ? ret : 0;
+ if (ret < 0)
+ return ret;
+ return 0;
}

static void venc_pm_touch(struct venus_inst *inst)

--
2.44.0.683.g7961c838ac-goog