From: "Christian König" <christian.koenig@amd.com>
To: zhaoxiao <zhaoxiao@uniontech.com>, airlied@linux.ie, daniel@ffwll.ch
Cc: alexander.deucher@amd.com, Xinhui.Pan@amd.com,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/radeon:WARNING opportunity for max()
Date: Tue, 16 Nov 2021 08:22:58 +0100 [thread overview]
Message-ID: <3dafeeed-dfab-a7c0-315d-62f74f90d839@amd.com> (raw)
In-Reply-To: <20211116055031.31621-1-zhaoxiao@uniontech.com>
Am 16.11.21 um 06:50 schrieb zhaoxiao:
> Fix following coccicheck warning:
> drivers/gpu/drm/radeon/r100.c:3450:26-27: WARNING opportunity for max()
> drivers/gpu/drm/radeon/r100.c:2812:23-24: WARNING opportunity for max()
>
> Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
In general feel free to add my Acked-by, but I'm not sure if we want
such cleanups in a driver which is only in maintenance mode.
If you do this as part of a general and automated cleanup then it is
probably ok.
Regards,
Christian.
> ---
> drivers/gpu/drm/radeon/r100.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
> index 2dd85ba1faa2..c65ee6f44af2 100644
> --- a/drivers/gpu/drm/radeon/r100.c
> +++ b/drivers/gpu/drm/radeon/r100.c
> @@ -2809,10 +2809,7 @@ void r100_vram_init_sizes(struct radeon_device *rdev)
> if (rdev->mc.aper_size > config_aper_size)
> config_aper_size = rdev->mc.aper_size;
>
> - if (config_aper_size > rdev->mc.real_vram_size)
> - rdev->mc.mc_vram_size = config_aper_size;
> - else
> - rdev->mc.mc_vram_size = rdev->mc.real_vram_size;
> + rdev->mc.mc_vram_size = max(config_aper_size, rdev->mc.real_vram_size);
> }
> }
>
> @@ -3447,10 +3444,7 @@ void r100_bandwidth_update(struct radeon_device *rdev)
> mc_latency_mclk.full += disp_latency_overhead.full + cur_latency_mclk.full;
> mc_latency_sclk.full += disp_latency_overhead.full + cur_latency_sclk.full;
>
> - if (mc_latency_mclk.full > mc_latency_sclk.full)
> - disp_latency.full = mc_latency_mclk.full;
> - else
> - disp_latency.full = mc_latency_sclk.full;
> + disp_latency.full = max(mc_latency_mclk.full, mc_latency_sclk.full);
>
> /* setup Max GRPH_STOP_REQ default value */
> if (ASIC_IS_RV100(rdev))
next prev parent reply other threads:[~2021-11-16 7:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 5:50 zhaoxiao
2021-11-16 7:22 ` Christian König [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-11-16 5:48 zhaoxiao
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=3dafeeed-dfab-a7c0-315d-62f74f90d839@amd.com \
--to=christian.koenig@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zhaoxiao@uniontech.com \
/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
all inboxes | Powered by JetHome®