[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACvgo518GDmQAvcfg_2HKQSkB7p1jEaqH2p9360xyAc5dZzFmA@mail.gmail.com>
Date: Fri, 15 Apr 2016 16:14:20 +0100
From: Emil Velikov <emil.l.velikov@...il.com>
To: Julia Lawall <julia.lawall@...6.fr>
Cc: Christian König <christian.koenig@....com>,
Joe Perches <joe@...ches.com>,
"Linux-Kernel@...r. Kernel. Org" <linux-kernel@...r.kernel.org>,
ML dri-devel <dri-devel@...ts.freedesktop.org>,
kbuild-all@...org, Alex Deucher <alexander.deucher@....com>,
Dave Airlie <airlied@...hat.com>
Subject: Re: [PATCH] drm/amdgpu: fix compare_const_fl.cocci warnings
On 15 April 2016 at 15:20, Julia Lawall <julia.lawall@...6.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@...el.com>
>> > Signed-off-by: Julia Lawall <julia.lawall@...6.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
Powered by blists - more mailing lists