summaryrefslogtreecommitdiff
path: root/drivers/media/platform/sti
diff options
context:
space:
mode:
authorGustavo A. R. Silva <garsilva@embeddedor.com>2017-10-30 07:18:47 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-10-31 14:30:21 +0300
commit3fa013be95bb046490d3b11d546bf06d73c7e0e3 (patch)
tree6e068b18251d63df422cd43528214f20744fda2f /drivers/media/platform/sti
parentd7ca1c9c15e309344e8dcd19826434359dff33b7 (diff)
downloadlinux-3fa013be95bb046490d3b11d546bf06d73c7e0e3.tar.xz
media: st-hva: hva-h264: use swap macro in hva_h264_encode
Make use of the swap macro and remove unnecessary variable tmp_frame. This makes the code easier to read and maintain. This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/sti')
-rw-r--r--drivers/media/platform/sti/hva/hva-h264.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/media/platform/sti/hva/hva-h264.c b/drivers/media/platform/sti/hva/hva-h264.c
index e6f247a983c7..a7e5eed17ada 100644
--- a/drivers/media/platform/sti/hva/hva-h264.c
+++ b/drivers/media/platform/sti/hva/hva-h264.c
@@ -999,7 +999,6 @@ static int hva_h264_encode(struct hva_ctx *pctx, struct hva_frame *frame,
{
struct hva_h264_ctx *ctx = (struct hva_h264_ctx *)pctx->priv;
struct hva_h264_task *task = (struct hva_h264_task *)ctx->task->vaddr;
- struct hva_buffer *tmp_frame;
u32 stuffing_bytes = 0;
int ret = 0;
@@ -1023,9 +1022,7 @@ static int hva_h264_encode(struct hva_ctx *pctx, struct hva_frame *frame,
&stream->bytesused);
/* switch reference & reconstructed frame */
- tmp_frame = ctx->ref_frame;
- ctx->ref_frame = ctx->rec_frame;
- ctx->rec_frame = tmp_frame;
+ swap(ctx->ref_frame, ctx->rec_frame);
return 0;
err: