From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751485AbcDOPOX (ORCPT ); Fri, 15 Apr 2016 11:14:23 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:38637 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751121AbcDOPOW convert rfc822-to-8bit (ORCPT ); Fri, 15 Apr 2016 11:14:22 -0400 MIME-Version: 1.0 In-Reply-To: References: <5710AA53.7070307@amd.com> Date: Fri, 15 Apr 2016 16:14:20 +0100 Message-ID: Subject: Re: [PATCH] drm/amdgpu: fix compare_const_fl.cocci warnings From: Emil Velikov To: Julia Lawall Cc: =?UTF-8?Q?Christian_K=C3=B6nig?= , Joe Perches , "Linux-Kernel@Vger. Kernel. Org" , ML dri-devel , kbuild-all@01.org, Alex Deucher , Dave Airlie Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15 April 2016 at 15:20, Julia Lawall 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 >> > Signed-off-by: Julia Lawall >> >> 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