lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240417112950.6873ebc4@collabora.com>
Date: Wed, 17 Apr 2024 11:29:50 +0200
From: Boris Brezillon <boris.brezillon@...labora.com>
To: Steven Price <steven.price@....com>
Cc: Dan Carpenter <dan.carpenter@...aro.org>, Liviu Dudau
 <liviu.dudau@....com>, Maarten Lankhorst
 <maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>,
 Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
 Daniel Vetter <daniel@...ll.ch>, dri-devel@...ts.freedesktop.org,
 linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] drm/panthor: clean up some types in
 panthor_sched_suspend()

On Mon, 8 Apr 2024 13:27:17 +0100
Steven Price <steven.price@....com> wrote:

> 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

                                            'and "upd_ctx.timedout_mask" an u32.'?

> > 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@...aro.org>  
> 
> Reviewed-by: Steven Price <steven.price@....com>

Reviewed-by: Boris Brezillon <boris.brezillon@...labora.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.

Yeah, I think this variable predates the upd_ctx stuff and is now useless.
I you post such a patch, please add my R-b directly.

Thanks,

Boris

> 
> > ---
> >  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;
> >    
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ