From: Paul Menzel <pmenzel@molgen.mpg.de>
To: Aashish Sharma <shraash@google.com>,
Harry Wentland <harry.wentland@amd.com>,
Leo Li <sunpeng.li@amd.com>,
Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
Alex Deucher <alexander.deucher@amd.com>,
Pan Xinhui <Xinhui.Pan@amd.com>, David Airlie <airlied@linux.ie>,
Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>,
Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com>,
Jake Wang <haonan.wang2@amd.com>,
Anson Jacob <Anson.Jacob@amd.com>,
Guenter Roeck <groeck@chromium.org>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
amd-gfx@lists.freedesktop.org, Daniel Vetter <daniel@ffwll.ch>,
Wayne Lin <wayne.lin@amd.com>, Anthony Koo <Anthony.Koo@amd.com>
Subject: Re: [PATCH] drm/amd/display: Fixed the unused-but-set-variable warning
Date: Fri, 18 Mar 2022 06:58:25 +0100 [thread overview]
Message-ID: <f1ff7e95-c177-09dd-9393-d0156ce81387@molgen.mpg.de> (raw)
In-Reply-To: <20220317140115.541007-1-shraash@google.com>
Dear Aashish,
Am 17.03.22 um 15:01 schrieb Aashish Sharma:
Thank you for your patch. If you are going to send a v2, please use
imperative mood. Maybe:
drm/amd/display: Fix unused-but-set-variable warning
> Fixed this kernel test robot warning:
Maybe:
Fix the kernel test robot warning below:
> drivers/gpu/drm/amd/amdgpu/../display/dmub/inc/dmub_cmd.h:2893:12:
> warning: variable 'temp' set but not used [-Wunused-but-set-variable]
>
> Replaced the assignment to the unused temp variable with READ_ONCE()
> macro to flush the writes.
Replace …
Excuse my ignorance regarding `READ_ONCE()`, but is that the reason you
remove the volatile qualifier?
Some robots ask in their report to add a Found-by tag. If so, please add
one.
> Signed-off-by: Aashish Sharma <shraash@google.com>
> ---
> drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
> index 873ecd04e01d..b7981a781701 100644
> --- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
> +++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
> @@ -2913,13 +2913,12 @@ static inline void dmub_rb_flush_pending(const struct dmub_rb *rb)
> uint32_t wptr = rb->wrpt;
>
> while (rptr != wptr) {
> - uint64_t volatile *data = (uint64_t volatile *)((uint8_t *)(rb->base_address) + rptr);
> + uint64_t *data = (uint64_t volatile *)((uint8_t *)(rb->base_address) + rptr);
> //uint64_t volatile *p = (uint64_t volatile *)data;
> - uint64_t temp;
> uint8_t i;
>
> for (i = 0; i < DMUB_RB_CMD_SIZE / sizeof(uint64_t); i++)
> - temp = *data++;
> + (void)READ_ONCE(*data++);
Did you verify, that the generated code is the same now, or what the
differences are. If it’s different from before, you should document in
the commit message, that it’s wanted, as otherwise, it’s an invasive
change just to fix a warning.
> rptr += DMUB_RB_CMD_SIZE;
> if (rptr >= rb->capacity)
Kind regards,
Paul
next prev parent reply other threads:[~2022-03-18 5:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-17 14:01 Aashish Sharma
2022-03-17 14:25 ` Guenter Roeck
2022-03-18 5:58 ` Paul Menzel [this message]
2022-03-18 15:44 ` Guenter Roeck
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=f1ff7e95-c177-09dd-9393-d0156ce81387@molgen.mpg.de \
--to=pmenzel@molgen.mpg.de \
--cc=Anson.Jacob@amd.com \
--cc=Anthony.Koo@amd.com \
--cc=Rodrigo.Siqueira@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=groeck@chromium.org \
--cc=haonan.wang2@amd.com \
--cc=harry.wentland@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=meenakshikumar.somasundaram@amd.com \
--cc=nicholas.kazlauskas@amd.com \
--cc=shraash@google.com \
--cc=sunpeng.li@amd.com \
--cc=wayne.lin@amd.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®