From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752471AbcBFOyD (ORCPT ); Sat, 6 Feb 2016 09:54:03 -0500 Received: from mail-ob0-f178.google.com ([209.85.214.178]:34290 "EHLO mail-ob0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751485AbcBFOyA (ORCPT ); Sat, 6 Feb 2016 09:54:00 -0500 Subject: Re: [PATCH] staging: rtl8712: Fix Comparison with constant warning. To: Pinkesh Badjatiya , Greg Kroah-Hartman , Luis de Bethencourt , Aya Mahfouz , Shivani Bhardwaj , Punit Vara References: <20160206144111.GA86930@ubuntu> Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org From: Larry Finger Message-ID: <56B60905.4090206@lwfinger.net> Date: Sat, 6 Feb 2016 08:53:57 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160206144111.GA86930@ubuntu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/06/2016 08:41 AM, Pinkesh Badjatiya wrote: > Fix Comparisons with constant on the left side of the test. > Checkpatch.pl warning. > -- > WARNING: Comparisons should place the constant on the right side of the > test > 296: FILE: ./rtl8712_cmd.c:296: > while ((0 != r8712_read32(pAdapter, IOCMD_CTRL_REG)) && > > Signed-off-by: Pinkesh Badjatiya > --- > drivers/staging/rtl8712/rtl8712_cmd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) This is another case where the writers of checkpatch are forcing their ideas of style on the whole world. The problem is that if I reject your patch, it will be submitted by someone else. Thus, reluctantly Acked-by: Larry Finger > > diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c b/drivers/staging/rtl8712/rtl8712_cmd.c > index 9b91609..ce3f7da 100644 > --- a/drivers/staging/rtl8712/rtl8712_cmd.c > +++ b/drivers/staging/rtl8712/rtl8712_cmd.c > @@ -293,7 +293,7 @@ u8 r8712_fw_cmd(struct _adapter *pAdapter, u32 cmd) > > r8712_write32(pAdapter, IOCMD_CTRL_REG, cmd); > msleep(100); > - while ((0 != r8712_read32(pAdapter, IOCMD_CTRL_REG)) && > + while ((r8712_read32(pAdapter, IOCMD_CTRL_REG) != 0) && > (pollingcnts > 0)) { > pollingcnts--; > msleep(20); >