From: Steven Price <steven.price@arm.com>
To: Dan Carpenter <dan.carpenter@linaro.org>,
Boris Brezillon <boris.brezillon@collabora.com>
Cc: Liviu Dudau <liviu.dudau@arm.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] drm/panthor: clean up some types in panthor_sched_suspend()
Date: Mon, 8 Apr 2024 13:27:17 +0100 [thread overview]
Message-ID: <effb8ca8-9d45-45d1-afab-467d0ac20fbd@arm.com> (raw)
In-Reply-To: <85356b15-4840-4e64-8c75-922cdd6a5fef@moroto.mountain>
On 08/04/2024 08:36, Dan Carpenter wrote:
> These variables should be u32 instead of u64 because they're only
> storing u32 values. Also static checkers complain when we do:
>
> suspended_slots &= ~upd_ctx.timedout_mask;
>
> In this code "suspended_slots" is a u64 and "upd_ctx.timedout_mask". The
> mask clears out the top 32 bits which would likely be a bug if anything
> were stored there.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Steven Price <steven.price@arm.com>
If you fancy a bit more clean-up then I think faulty_slots is completely
redundant as a separate variable. In particular in the "if
(suspended_slots)" section it's updated but that updated value is never
used... otherwise I'll put it on my list for cleaning up later.
> ---
> drivers/gpu/drm/panthor/panthor_sched.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index d4bc652b34d5..b3a51a6de523 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -2546,7 +2546,7 @@ void panthor_sched_suspend(struct panthor_device *ptdev)
> {
> struct panthor_scheduler *sched = ptdev->scheduler;
> struct panthor_csg_slots_upd_ctx upd_ctx;
> - u64 suspended_slots, faulty_slots;
> + u32 suspended_slots, faulty_slots;
> struct panthor_group *group;
> u32 i;
>
next prev parent reply other threads:[~2024-04-08 12:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-08 7:36 Dan Carpenter
2024-04-08 12:27 ` Steven Price [this message]
2024-04-17 9:29 ` Boris Brezillon
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=effb8ca8-9d45-45d1-afab-467d0ac20fbd@arm.com \
--to=steven.price@arm.com \
--cc=airlied@gmail.com \
--cc=boris.brezillon@collabora.com \
--cc=dan.carpenter@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/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®