Re: [PATCH] drm/amdgpu: allocate large structures dynamically
From: Joe Perches
Date: Thu May 07 2020 - 02:55:35 EST
On Thu, 2020-05-07 at 08:42 +0200, Christian König wrote:
> Am 06.05.20 um 21:01 schrieb Joe Perches:
[]
> > And trivia:
> >
> > The !! uses with bool seem unnecessary and it's probably better
> > to make amdgpu_ras_is_feature_enabled to return bool.
[]
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
[]
> > @@ -560,7 +560,7 @@ static int __amdgpu_ras_feature_enable(struct amdgpu_device *adev,
> > */
> > if (!amdgpu_ras_is_feature_allowed(adev, head))
> > return 0;
> > - if (!(!!enable ^ !!amdgpu_ras_is_feature_enabled(adev, head)))
> > + if (!(enable ^ amdgpu_ras_is_feature_enabled(adev, head)))
>
> And while we are at improving coding style I think that writing this as
> "if (enabled == amdgpu_ras_is_feature_enabled(adev, head))" would be
> much more readable.
<blink, chuckle> that's decidedly true...