Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp382264ybp; Thu, 10 Oct 2019 20:24:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqymKs4YrlFpUT7swKPLv/MrUuWDEyAXVxnHSaDXRQkJBboYS8nPVWisEkkSzsLQ+G7Gz44Z X-Received: by 2002:aa7:de1a:: with SMTP id h26mr11414264edv.289.1570764286192; Thu, 10 Oct 2019 20:24:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570764286; cv=none; d=google.com; s=arc-20160816; b=ZSo5bHcSRgQ8WjXv9vy+YwbuFvPEUblyrLWM1YJDC4g7JkoZHOjezgySf3S4fToiIU 0vcYo+G5n0xwp+X0gnrF8FLF/2vtT2iaOSNu1lNsm9sYA716uLNB1Mu5Nz2Lp7QnGSjn Nve1Es3zCafJXkyDD3xFR4Jls5Vm5SDK4qkgDor0u5JR5Y5w6229gSE+MccK5ssG2mXc btJo9TWXs0E6JyuCHdEyRQfzJq8hs1lnQC8HEEXwe4PtXQDfNSZrhZ5QokecXp8ZCeP3 nqtDawGK3XnvVT9YshedWpNiYO+mPJygmCZLrb/VTU9HL2V0O8N5V5dRVIPICUSTyVBf NCXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=MSn9CRoRQTQ3leKhw+rSOpdo/dw8A5vjFpoL+/P8Vz4=; b=PHsidwZy48fkMefvh2MxQw17Ef1ep1zAPX3AuCPGNrorqRmr7VdO093G3w7w0j0OTa IJny/2NVG3+K3KyrgmLOE+NYfgdo1pDRoWKAsAqBt701mqqPbVCZbP/4HKVNlU2lLd4l tFhODRZWRi+JSii5GfZzmjcrJdq50aWWlE/EK6KTW0qkhcGmSnJ8fdytQUiN+Cw2/iwT HkL7YYhVEuzqg+oCFDM7u0Fns9AbeSQjQI0ia24hn1u8mmjX6KSbr2ZUEYpDghz10YEf s/JhaEwRMKsfLJWxd8p4K1iPyji/RfHn+2uahc3W2aWxrQsrWd+SWAdRr6fZ5CxbVZoB PD8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l16si2907127ejq.188.2019.10.10.20.24.11; Thu, 10 Oct 2019 20:24:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726692AbfJKDXv (ORCPT + 99 others); Thu, 10 Oct 2019 23:23:51 -0400 Received: from smtprelay0153.hostedemail.com ([216.40.44.153]:60053 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726423AbfJKDXv (ORCPT ); Thu, 10 Oct 2019 23:23:51 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 6C2C6181D33FC; Fri, 11 Oct 2019 03:23:49 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::,RULES_HIT:41:355:379:599:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2110:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:5007:10004:10400:10450:10455:10848:11026:11232:11473:11658:11914:12296:12297:12663:12740:12760:12895:13069:13071:13095:13160:13181:13229:13311:13357:13439:14096:14097:14180:14659:14721:19904:19999:21060:21067:21080:21433:21451:21627:30012:30029:30054:30070:30091,0,RBL:47.151.152.152:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:65,LUA_SUMMARY:none X-HE-Tag: fire16_2146810e4a71c X-Filterd-Recvd-Size: 1756 Received: from XPS-9350.home (unknown [47.151.152.152]) (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA; Fri, 11 Oct 2019 03:23:48 +0000 (UTC) Message-ID: <8720b5d432ca5ba5e128c241efee22674e012af8.camel@perches.com> Subject: Re: checkpatch: comparisons with a constant on the left From: Joe Perches To: Sergey Senozhatsky Cc: Sergey Senozhatsky , linux-kernel@vger.kernel.org Date: Thu, 10 Oct 2019 20:23:47 -0700 In-Reply-To: <20191011015225.GA27495@jagdpanzerIV> References: <20191011015225.GA27495@jagdpanzerIV> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.32.1-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2019-10-11 at 10:52 +0900, Sergey Senozhatsky wrote: > Hi Joe, Hi Sergey. > I noticed that this code > > #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) > > triggers checkpatch's warning: > > "WARNING: Comparisons should place the constant on > the right side of the test" > > Both LINUX_VERSION_CODE and KERNEL_VERSION are constants, so > I'm wondering if it's worth it to improve that check a tiny > bit. Probably not. My preference is for people to ignore checkpatch message bleats when they don't make overall sense. checkpatch thinks anything that uses a form like "name()" is a function. > I'm sure you'll have a better idea. I suggest reversing the test if it really bothers you. # if KERNEL_VERSION(4.18.0) < LINUX_VERSION_CODE but then again just using LINUX_VERSION_CODE emits a warning message, so it's better to remove whatever is in the block anyway... cheers, Joe