Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753306AbcD0Obu (ORCPT ); Wed, 27 Apr 2016 10:31:50 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36540 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753260AbcD0Obq (ORCPT ); Wed, 27 Apr 2016 10:31:46 -0400 Date: Wed, 27 Apr 2016 10:31:43 -0400 From: YU Bo To: Dan Carpenter Cc: Patard , Kroah-Hartman , Sim , Goyal , Barnes , Sachdeva , Frederick , Ravichandran , yuzibode@126.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging:xgifb: Fix Comparisons should place the constant on the right side of the test warning Message-ID: <20160427143141.GB19115@yubo-2> References: <20160427132736.GA19002@yubo-2> <20160427135836.GM4298@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: <20160427135836.GM4298@mwanda> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1188 Lines: 32 On Wed, Apr 27, 2016 at 04:58:36PM +0300, Dan Carpenter wrote: >On Wed, Apr 27, 2016 at 09:27:39AM -0400, YU Bo wrote: >> Fixed checkpatch.pl's warning 'Comparisons should place the constant on >> the right side of the test' >> >> Signed-off-by: YU Bo >> --- >> drivers/staging/xgifb/vb_setmode.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/staging/xgifb/vb_setmode.c b/drivers/staging/xgifb/vb_setmode.c >> index 50c8ea4f5ab7..8bf253c224ad 100644 >> --- a/drivers/staging/xgifb/vb_setmode.c >> +++ b/drivers/staging/xgifb/vb_setmode.c >> @@ -1208,7 +1208,7 @@ static void const *XGI_GetLcdPtr(struct XGI330_LCDDataTablStruct const *table, >> if (pVBInfo->LCDInfo & EnableScalingLCD) >> tempdx &= (~PanelResInfo); >> >> - if (table[i].PANELID == tempdx) { >> + if (tempdx == table[i].PANELID) { > >I don't understand why checkpatch is complaining about this one... It >seems like a false positive. Maybe it's because .PANELID is a rubbish >variable name. Here, it seems like to notice upper case identifier on the left. https://lkml.org/lkml/diff/2015/8/27/469/1 Best Regards, > >regards, >dan carpetner >