The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: christian.koenig@amd.com, Arnd Bergmann <arnd@arndb.de>,
	Alex Deucher <alexander.deucher@amd.com>,
	"David (ChunMing) Zhou" <David1.Zhou@amd.com>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Hawking Zhang <Hawking.Zhang@amd.com>,
	John Clements <john.clements@amd.com>
Cc: Guchun Chen <guchun.chen@amd.com>, Tao Zhou <tao.zhou1@amd.com>,
	linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, Dennis Li <Dennis.Li@amd.com>
Subject: Re: [PATCH] drm/amdgpu: allocate large structures dynamically
Date: Wed, 06 May 2020 23:55:30 -0700	[thread overview]
Message-ID: <777550697e44478c46768db5265dcdda094932f4.camel@perches.com> (raw)
In-Reply-To: <845a2e12-538c-fb6d-db80-78e8adf1413f@gmail.com>

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



      reply	other threads:[~2020-05-07  6:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 14:01 [PATCH] drm/amdgpu: allocate large structures dynamically Arnd Bergmann
2020-05-05 14:07 ` Christian König
2020-05-05 15:34   ` Alex Deucher
2020-05-06 19:01 ` Joe Perches
2020-05-07  6:42   ` Christian König
2020-05-07  6:55     ` Joe Perches [this message]

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=777550697e44478c46768db5265dcdda094932f4.camel@perches.com \
    --to=joe@perches.com \
    --cc=David1.Zhou@amd.com \
    --cc=Dennis.Li@amd.com \
    --cc=Hawking.Zhang@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=arnd@arndb.de \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=guchun.chen@amd.com \
    --cc=john.clements@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tao.zhou1@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