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>
 {
        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;
 
                                       &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: