summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@chromium.org>2019-06-14 03:56:21 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-06-21 17:09:30 -0400
commit86aed3f519312ee86bf6c618687aa1be08dd9ca4 (patch)
tree27c6727d4f566fa84fd21a21a48475860c8e17f3 /drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
parentd13b3cdcbacbeb31c0a4b5b3a63e855b4511fd85 (diff)
downloadlinux-86aed3f519312ee86bf6c618687aa1be08dd9ca4.tar.bz2
media: mtk-vcodec: avoid unneeded pointer-to-long conversions
The interface used to communicate with the firmware casts pointers into unsigned longs and back again in order to store private references, all of this for pointers that remain purely in the kernel. Replace these unsigned longs with void pointers to make the code a bit sturdier and easier to follow. Also simplify some interfaces by removing arguments that could be infered from others. Signed-off-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: fix checkpatch alignment warning] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c')
-rw-r--r--drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
index 81f87f6ec435..3787e75ca902 100644
--- a/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
+++ b/drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c
@@ -323,7 +323,7 @@ static int vp8_enc_encode_frame(struct venc_vp8_inst *inst,
return ret;
}
-static int vp8_enc_init(struct mtk_vcodec_ctx *ctx, unsigned long *handle)
+static int vp8_enc_init(struct mtk_vcodec_ctx *ctx)
{
int ret = 0;
struct venc_vp8_inst *inst;
@@ -349,12 +349,12 @@ static int vp8_enc_init(struct mtk_vcodec_ctx *ctx, unsigned long *handle)
if (ret)
kfree(inst);
else
- (*handle) = (unsigned long)inst;
+ ctx->drv_handle = inst;
return ret;
}
-static int vp8_enc_encode(unsigned long handle,
+static int vp8_enc_encode(void *handle,
enum venc_start_opt opt,
struct venc_frm_buf *frm_buf,
struct mtk_vcodec_mem *bs_buf,
@@ -391,7 +391,7 @@ encode_err:
return ret;
}
-static int vp8_enc_set_param(unsigned long handle,
+static int vp8_enc_set_param(void *handle,
enum venc_set_param_type type,
struct venc_enc_param *enc_prm)
{
@@ -442,7 +442,7 @@ static int vp8_enc_set_param(unsigned long handle,
return ret;
}
-static int vp8_enc_deinit(unsigned long handle)
+static int vp8_enc_deinit(void *handle)
{
int ret = 0;
struct venc_vp8_inst *inst = (struct venc_vp8_inst *)handle;