Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99676f20 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Alex Deucher
Browse files

drm/amd/display/dc/core/dc_resource: use swap macro in rect_swap_helper



Make use of the swap macro instead of _manually_ swapping values
and remove unnecessary variable temp.

This makes the code easier to read and maintain.

This code was detected with the help of Coccinelle.

Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 5a16008f
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -426,15 +426,8 @@ static enum pixel_format convert_pixel_format_to_dalsurface(

static void rect_swap_helper(struct rect *rect)
{
	uint32_t temp = 0;

	temp = rect->height;
	rect->height = rect->width;
	rect->width = temp;

	temp = rect->x;
	rect->x = rect->y;
	rect->y = temp;
	swap(rect->height, rect->width);
	swap(rect->x, rect->y);
}

static void calculate_viewport(struct pipe_ctx *pipe_ctx)