From: Harry Wentland <harry.wentland@amd.com>
To: "Gustavo A. R. Silva" <garsilva@embeddedor.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Airlie" <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amd/display/dc/dce110/dce110_mem_input_v: use swap macro in program_size_and_rotation
Date: Fri, 17 Nov 2017 10:45:29 -0500 [thread overview]
Message-ID: <fc996517-7d2b-a35a-1a2d-930037668dac@amd.com> (raw)
In-Reply-To: <20171110223109.GA31549@embeddedor.com>
On 2017-11-10 05:31 PM, Gustavo A. R. Silva wrote:
> 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 <garsilva@embeddedor.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> .../drm/amd/display/dc/dce110/dce110_mem_input_v.c | 28 +++++++---------------
> 1 file changed, 8 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c
> index a06c602..7bab8c6 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c
> @@ -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;
>
next prev parent reply other threads:[~2017-11-17 15:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-10 22:31 Gustavo A. R. Silva
2017-11-17 15:45 ` Harry Wentland [this message]
2017-11-20 5:25 ` Gustavo A. R. Silva
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fc996517-7d2b-a35a-1a2d-930037668dac@amd.com \
--to=harry.wentland@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=garsilva@embeddedor.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome