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: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
 
 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)