Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4001489ybg; Sun, 7 Jun 2020 18:04:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCok/ENX7iBAFYIsmyI7qZjB6AmIOL3ihJpBUJ3t+cpKrvjV3WGZTm3+02YU6fbd8aQf3V X-Received: by 2002:a50:e881:: with SMTP id f1mr19129947edn.98.1591578296048; Sun, 07 Jun 2020 18:04:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591578296; cv=none; d=google.com; s=arc-20160816; b=XK7BebLLT4eOsff9fGg/EHat0LFXqzh/FcFQVTCmwY5quIowV14P9yp+VbrkZE0WsE anwxzO+beFLO7F5XPG7/vNACJd6jKufbvcl2JAtn7yeI0y81+/duKwMztCZMZ77y2dCg zTOHrwVnuznNDCUD9ChpOKM9wo3ZtxcPHWfbN/aBUztDLiPyfM05n1YFxi2x6X4PO+0m fSkQf0xResTo+JEkZvYSXBuc1ntQVqfhtGCD1oT/w6uDuPZKKFqpPujmPNce5upOWtXZ wQZ5OX1573HYIH+o37gh7YvR0Ygts39viVMqZoB68ptIC7WV/kI0KEH9T7aHsC9YmMj7 ub0g== 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=KnDEC/qw5SZUF4Aq4+tjwQcD1Vf1zhO4hiKeB8JvYDc=; b=Ynmyia8kudYDAHI++eWr3seKROlz3Gcu2u24g0LoEIyfk4Yn49TjVNwxML6bfm6spn 5dR1+9NdhAcx3GJzPn1U4aa6Dv7kzCaq7eqosFuxUbd7j3PC8KYf9hoys0ysokrjv1Ac Ku9NzkKF++TKJL+pJ/fYv3gpasBPmitx99llB6K0AE92z3NB/Lh71EU147TNabGGKCPg Wh0R+ZmPwlGWyO9hiSXgYh6qXUkjl7rLUWiysLn6XOqSryV8vJy8r4eHZKL9KyWKVmx+ QYCzucdKjumGQA3mChJtC00JaOxoVAeIzsnwbYgkQ25dFK4fCB5dYECY7ktACPy9O3bx lKWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n93si4091010edc.552.2020.06.07.18.04.34; Sun, 07 Jun 2020 18:04:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728143AbgFHBCs (ORCPT + 99 others); Sun, 7 Jun 2020 21:02:48 -0400 Received: from smtprelay0113.hostedemail.com ([216.40.44.113]:33036 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727999AbgFHBCs (ORCPT ); Sun, 7 Jun 2020 21:02:48 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id 1784B1808E84C; Mon, 8 Jun 2020 01:02:47 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1978:1981:2194:2199:2393:2559:2562:2692:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3874:4321:5007:8957:10004:10400:10848:11232:11658:11914:12114:12295:12296:12297:12438:12555:12740:12760:12895:12986:13069:13311:13357:13439:14096:14097:14180:14659:14721:21060:21080:21212:21451:21627:21660:30012:30041:30054:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: love83_601194f26db5 X-Filterd-Recvd-Size: 2236 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf03.hostedemail.com (Postfix) with ESMTPA; Mon, 8 Jun 2020 01:02:45 +0000 (UTC) Message-ID: <3bf931c6ea0cae3e23f3485801986859851b4f04.camel@perches.com> Subject: Re: [PATCH] lib/lz4: smatch warning in LZ4_decompress_generic() From: Joe Perches To: Yann Collet , Vasily Averin , Gao Xiang Cc: "linux-kernel@vger.kernel.org" , Andrew Morton , Gao Xiang Date: Sun, 07 Jun 2020 18:02:44 -0700 In-Reply-To: References: <20200606143646.GB10839.ref@hsiangkao-HP-ZHAN-66-Pro-G1> <20200606143646.GB10839@hsiangkao-HP-ZHAN-66-Pro-G1> <330eccf1-6d4b-07dd-4e55-ffe3a179e4b8@virtuozzo.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.2-0ubuntu1 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 Mon, 2020-06-08 at 00:40 +0000, Yann Collet wrote: > Hi Vasily > > > If I do understand the discussion, the question is about usage of `&` instead of `&&`, > and the speculation that it might be an error. > > It's not an error. Unfortunately, explaining the reasoning behind this decision is a bit long. Likely better to add a comment around the use so that another patch like this doesn't get submitted again. Perhaps something like: --- lib/lz4/lz4_decompress.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/lz4/lz4_decompress.c b/lib/lz4/lz4_decompress.c index 0c9d3ad17e0f..5371dab6b481 100644 --- a/lib/lz4/lz4_decompress.c +++ b/lib/lz4/lz4_decompress.c @@ -141,6 +141,9 @@ static FORCE_INLINE int LZ4_decompress_generic( * space in the output for those 18 bytes earlier, upon * entering the shortcut (in other words, there is a * combined check for both stages). + * + * The & in the likely() below is intentionally not && so that + * some compilers can produce better parallelized runtime code */ if ((endOnInput ? length != RUN_MASK : length <= 8) /*