All of lore.kernel.org
 help / color / mirror / Atom feed
From: Emil Velikov <emil.l.velikov@gmail.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: "Christian König" <christian.koenig@amd.com>,
	"Joe Perches" <joe@perches.com>,
	"Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>,
	"ML dri-devel" <dri-devel@lists.freedesktop.org>,
	kbuild-all@01.org, "Alex Deucher" <alexander.deucher@amd.com>,
	"Dave Airlie" <airlied@redhat.com>
Subject: Re: [PATCH] drm/amdgpu: fix compare_const_fl.cocci warnings
Date: Fri, 15 Apr 2016 16:14:20 +0100	[thread overview]
Message-ID: <CACvgo518GDmQAvcfg_2HKQSkB7p1jEaqH2p9360xyAc5dZzFmA@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1604151617370.3050@hadrien>

On 15 April 2016 at 15:20, Julia Lawall <julia.lawall@lip6.fr> wrote:
> On Fri, 15 Apr 2016, Christian König wrote:
>> Am 15.04.2016 um 09:15 schrieb Julia Lawall:
>> > Move constants to the right of binary operators.
>> >
>> > Generated by: scripts/coccinelle/misc/compare_const_fl.cocci
>> >
>> > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
>> > Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
>>
>> In general the patch looks ok, but do we have a documented preference where to
>> place constants in the coding style docs?
>>
>> While it's not so much of a problem any more with modern compilers, some
>> people still prefer to have it on the left side to catch accidental value
>> assignments.
>
> I don't know if it is documented.  Joe Perches suggested that on the right
> was better in general - maybe he knows if this is written somewhere.
>
> There are 504 occurrences of NULL == in the kernel, and 19524 occurrences
> of == NULL.
>
To throw in some more numbers:

>From drivers/gpu/drm/amd/ - ~40 for "NULL *== *" and ~400 for " *== *NULL" ;-)

-Emil

WARNING: multiple messages have this Message-ID (diff)
From: Emil Velikov <emil.l.velikov@gmail.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: "Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>,
	"ML dri-devel" <dri-devel@lists.freedesktop.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	kbuild-all@01.org, "Joe Perches" <joe@perches.com>,
	"Dave Airlie" <airlied@redhat.com>,
	"Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH] drm/amdgpu: fix compare_const_fl.cocci warnings
Date: Fri, 15 Apr 2016 16:14:20 +0100	[thread overview]
Message-ID: <CACvgo518GDmQAvcfg_2HKQSkB7p1jEaqH2p9360xyAc5dZzFmA@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1604151617370.3050@hadrien>

On 15 April 2016 at 15:20, Julia Lawall <julia.lawall@lip6.fr> wrote:
> On Fri, 15 Apr 2016, Christian König wrote:
>> Am 15.04.2016 um 09:15 schrieb Julia Lawall:
>> > Move constants to the right of binary operators.
>> >
>> > Generated by: scripts/coccinelle/misc/compare_const_fl.cocci
>> >
>> > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
>> > Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
>>
>> In general the patch looks ok, but do we have a documented preference where to
>> place constants in the coding style docs?
>>
>> While it's not so much of a problem any more with modern compilers, some
>> people still prefer to have it on the left side to catch accidental value
>> assignments.
>
> I don't know if it is documented.  Joe Perches suggested that on the right
> was better in general - maybe he knows if this is written somewhere.
>
> There are 504 occurrences of NULL == in the kernel, and 19524 occurrences
> of == NULL.
>
To throw in some more numbers:

From drivers/gpu/drm/amd/ - ~40 for "NULL *== *" and ~400 for " *== *NULL" ;-)

-Emil
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-04-15 15:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15  7:15 [PATCH] drm/amdgpu: fix compare_const_fl.cocci warnings Julia Lawall
2016-04-15  7:15 ` Julia Lawall
2016-04-15  8:46 ` Christian König
2016-04-15  8:46   ` Christian König
2016-04-15 14:20   ` Julia Lawall
2016-04-15 14:20     ` Julia Lawall
2016-04-15 15:14     ` Emil Velikov [this message]
2016-04-15 15:14       ` Emil Velikov
2016-04-15 15:50     ` Joe Perches
2016-04-15 15:50       ` Joe Perches

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=CACvgo518GDmQAvcfg_2HKQSkB7p1jEaqH2p9360xyAc5dZzFmA@mail.gmail.com \
    --to=emil.l.velikov@gmail.com \
    --cc=airlied@redhat.com \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=joe@perches.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.