drm/amd/display/dc/dce110/dce110_mem_input_v: use swap macro in program_size_and_rotation
Subsystems (3)
PATCH 1/1 drm/amd/display/dc/dce110/dce110_mem_input_v: use swap macro in program_size_and_rotation
Make use of the swap macro instead of _manually_ swapping values and remove unnecessary variable swap.
This makes the code easier to read and maintain.
This code was detected with the help of Coccinelle.
--- .../drm/amd/display/dc/dce110/dce110_mem_input_v.c | 28 +++++++--------------- 1 file changed, 8 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c +8 -20
@@ -237,26 +237,14 @@ static void program_size_and_rotation(if (rotation ==ROTATION_ANGLE_90 || rotation ==ROTATION_ANGLE_270 ) { -uint32_t swap; - swap = local_size.video.luma_size.x; - local_size.video.luma_size.x = - local_size.video.luma_size.y; - local_size.video.luma_size.y = swap; - - swap = local_size.video.luma_size.width; - local_size.video.luma_size.width = - local_size.video.luma_size.height; - local_size.video.luma_size.height = swap; - - swap = local_size.video.chroma_size.x; - local_size.video.chroma_size.x = - local_size.video.chroma_size.y; - local_size.video.chroma_size.y = swap; - - swap = local_size.video.chroma_size.width; - local_size.video.chroma_size.width = - local_size.video.chroma_size.height; - local_size.video.chroma_size.height = swap; +swap (local_size.video.luma_size.x, + local_size.video.luma_size.y); +swap (local_size.video.luma_size.width, + local_size.video.luma_size.height); +swap (local_size.video.chroma_size.x, + local_size.video.chroma_size.y); +swap (local_size.video.chroma_size.width, + local_size.video.chroma_size.height); } value =0 ;
Signature · 1 line
2.7.4
Quoted 8 lines · Gustavo A. R. Silva
Make use of the swap macro instead of _manually_ swapping values and remove unnecessary variable swap.
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 <[email protected]>
Harry
Quoted 34 lines
--- .../drm/amd/display/dc/dce110/dce110_mem_input_v.c | 28 +++++++--------------- 1 file changed, 8 insertions(+), 20 deletions(-)drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c +1
-20@@ -237,26 +237,14 @@ static void program_size_and_rotation(if (rotation ==ROTATION_ANGLE_90 || rotation ==ROTATION_ANGLE_270 ) { -uint32_t swap; - swap = local_size.video.luma_size.x; - local_size.video.luma_size.x = - local_size.video.luma_size.y; - local_size.video.luma_size.y = swap; - - swap = local_size.video.luma_size.width; - local_size.video.luma_size.width = - local_size.video.luma_size.height; - local_size.video.luma_size.height = swap; - - swap = local_size.video.chroma_size.x; - local_size.video.chroma_size.x = - local_size.video.chroma_size.y; - local_size.video.chroma_size.y = swap; - - swap = local_size.video.chroma_size.width; - local_size.video.chroma_size.width = - local_size.video.chroma_size.height; - local_size.video.chroma_size.height = swap; + swap(local_size.video.luma_size.x,
drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c static void program_size_and_rotation( · line 250
Quoted 10 lines
drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c +7
-0+ local_size.video.luma_size.y); +swap (local_size.video.luma_size.width, + local_size.video.luma_size.height); +swap (local_size.video.chroma_size.x, + local_size.video.chroma_size.y); +swap (local_size.video.chroma_size.width, + local_size.video.chroma_size.height); } value =0 ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoting Harry Wentland <[email protected]>:
Quoted 12 lines · Gustavo A. R. Silva
Quoted 8 lines
Make use of the swap macro instead of _manually_ swapping values and remove unnecessary variable swap.
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 <[email protected]>Reviewed-by Harry Wentland <[email protected]>
Thank you, Harry.
--
Gustavo A. R. Silva