Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp9320051rwi; Tue, 25 Oct 2022 18:37:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7sKXujRo+WERzuF5N1lCGEU/FmeCFVoxuZLQ3fo0brQHAOtSq+jXTi3KYvhbTFuPE9gjee X-Received: by 2002:a17:902:aa46:b0:178:9ee5:c7f1 with SMTP id c6-20020a170902aa4600b001789ee5c7f1mr42638003plr.69.1666748223924; Tue, 25 Oct 2022 18:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666748223; cv=none; d=google.com; s=arc-20160816; b=1HcN2qJONx+sE+aB0h0gaKq7FoovqmYk/kuJJ+XDgFpboGaZZgYY/k145Je2wSCvMA bzpindUXEZ2nMg3LTPcvZiuAOcrOfOKxNq8qZ5TlPmN+uUcLxERnKPJ0kVZXdp1l3gm5 c4AYF73XJf2O4gySGugH//mUKDMfxnpaQIvaS8wxamqkOEsTD0Z0xgwObR2xAGnT8GUx P7DXDJvcxojiQOEg1jcWqiqtGSZ4bbuHASXJK94iIwupgGmRSgrxKGfD7Q7UokDFmsIZ mCnBna+KnfuHEEcsfENqimp6Pf3Tyo5LIWxM+itnhC5ghKp+fxudUm2w/qkl6F8CAqvL ovtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=0R/zuogst9d/iMbwGJahqQyG29x6cKUoOmr+NFwHscw=; b=oqgsj3WohbGLme2wiRRzleWZ2PLaeSF9lF/Mrd8JyLroPOGZXFSY06sCyNFnEkCbpU pqlz1HlySZu0gKI0mrwAioAuvyKokjFF5sEPdjNfX7vunDyDkCNVX4ZcQFBmizbDzEut bDqcLCaXygPX+fxvOqO0JuEna46ilAsCG9Qik74HBqy3O7g9so9BfqZ/eFcRryRSi6wg VYVxd0pjJ42LDgFBNwwqq4jPhMkeJGE5MbFmoFTtk8A8ER80gpxdSuMtcwV22tpRYslL OZE0axgmqDQ604q1/GLAASFneGKISOOYeoZxq9ydCFlL191oCXhg9EbElYEF+2buJWEZ GLXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="CI1yQ/YQ"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a63ed49000000b0046e9fda730csi4669502pgk.363.2022.10.25.18.36.38; Tue, 25 Oct 2022 18:37:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="CI1yQ/YQ"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231476AbiJZBR5 (ORCPT + 99 others); Tue, 25 Oct 2022 21:17:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbiJZBR4 (ORCPT ); Tue, 25 Oct 2022 21:17:56 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FAD4C2CB5 for ; Tue, 25 Oct 2022 18:17:51 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id i3so13746028pfc.11 for ; Tue, 25 Oct 2022 18:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0R/zuogst9d/iMbwGJahqQyG29x6cKUoOmr+NFwHscw=; b=CI1yQ/YQ/tnZzmgve848XpigUhg8RfAlohpGXwTPlL1rtvw+cEuQkOOqNoe4cJ5Nmn wOKRSCOiCCIJxQdierMy2Bb+V59SGh4lVxTYrVx6LTmEqWGsLsTEPDReqGvaXHfBZ4sN QjhppDIvzcNeXJ+GjtJhhSM5sKqXtbq8P7Iis= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0R/zuogst9d/iMbwGJahqQyG29x6cKUoOmr+NFwHscw=; b=pJXvN+/RxeIsk6urSx2nGZi+zZOA+QTNbwwhb1f9OqvdtBUZoLD7NElJizS4+Xtea3 57H4OhEQYy+eIxjXdQ/2UfM3Xz97o2wG3+32l6CuqDqIAow7C4MpQZ90VOHhGobQQQKL YhtI873Z6ZGf7+0SlGIEjF4dQEvIt2TxiUVNoUZlpjV21ou+nv+7cVC98yOiuAKDs5ZS FQ3JH4YcN3h0Z3mMFvNgL+FWomleCyMp96t+DVlQ+mqWTVhRG6ky3rfhbuPeuqmZvmDZ YIW7WUxK2eiHcY4yMUmJGMXaKxct05/UXivQb/pdSit+DCtZ5osRjcNRUgDb3nd0OTXw FWpA== X-Gm-Message-State: ACrzQf2PM9bSFS8RVFdSyHNJLregyLXQvqJGz6TPlnHRw9FimrIEwxBN wibS5fET+B8K3tmpwcVT/S1eNw== X-Received: by 2002:a05:6a00:348b:b0:56c:35fb:8dab with SMTP id cp11-20020a056a00348b00b0056c35fb8dabmr4070124pfb.13.1666747071125; Tue, 25 Oct 2022 18:17:51 -0700 (PDT) Received: from google.com ([240f:75:7537:3187:faf6:e503:6cac:3b53]) by smtp.gmail.com with ESMTPSA id j18-20020a634a52000000b0042988a04bfdsm1840383pgl.9.2022.10.25.18.17.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 18:17:50 -0700 (PDT) Date: Wed, 26 Oct 2022 10:17:45 +0900 From: Sergey Senozhatsky To: wangkailong@jari.cn Cc: tytso@mit.edu, adilger.kernel@dilger.ca, linkinjeon@kernel.org, sfrench@samba.org, senozhatsky@chromium.org, tom@talpey.com, roman.gushchin@linux.dev, akpm@linux-foundation.org, willy@infradead.org, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cifs@vger.kernel.org Subject: Re: [PATCH] ext4: replace ternary operator with min() Message-ID: References: <5036013e.4.1840fa09d42.Coremail.wangkailong@jari.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5036013e.4.1840fa09d42.Coremail.wangkailong@jari.cn> X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On (22/10/25 22:51), wangkailong@jari.cn wrote: [..] > @@ -879,7 +879,7 @@ static int oplock_break(struct oplock_info *brk_opinfo, int req_op_level) > > err = oplock_break_pending(brk_opinfo, req_op_level); > if (err) > - return err < 0 ? err : 0; > + return min(err, 0); > > if (brk_opinfo->open_trunc) { > /* > @@ -913,7 +913,7 @@ static int oplock_break(struct oplock_info *brk_opinfo, int req_op_level) > } else { > err = oplock_break_pending(brk_opinfo, req_op_level); > if (err) > - return err < 0 ? err : 0; > + return min(err, 0); Honestly, I don't know. My personal preference would be to keep it as is. "return min(err, 0)" is a bit unusually looking code. Just my 2 cents.