[PATCH] drm/amdgpu/gfx10: remove redundant repeated null checks
Alex Deucher
alexdeucher at gmail.com
Mon Aug 4 15:08:57 UTC 2025
On Mon, Aug 4, 2025 at 10:49 AM Dan Carpenter <dan.carpenter at linaro.org> wrote:
>
> On Mon, Aug 04, 2025 at 10:32:43AM -0400, Alex Deucher wrote:
> > On Sat, Aug 2, 2025 at 4:22 AM Ethan Carter Edwards
> > <ethan at ethancedwards.com> wrote:
> > >
> > > The repeated checks on grbm_soft_reset are unnecessary. Remove them.
> > >
> >
> > These are not NULL checks and they are necessary. The code is
> > checking if any bits are set in that register. If not, then we can
> > skip that code as there is nothing to do.
> >
>
> It's not a null check, but it is a nested check and it's a local
> variable so the patch is correct enough. At this point we know that
> grbm_soft_reset can't be zero.
It can be 0 as far as I can see. If none of the GRBM_STATUS bits are
set, then we never set any of the bits in grbm_soft_reset.
Alex
>
> regards,
> dan carpenter
>
More information about the amd-gfx
mailing list