Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10628330rwp; Fri, 21 Jul 2023 02:14:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlG9uvh8afbBoevBERK8/Ek+pM10hgEyGOp6NEyX54rcmJTtBvqqf8OxM1x0XbVoWNQ61XV8 X-Received: by 2002:a17:906:224c:b0:96f:8666:5fc4 with SMTP id 12-20020a170906224c00b0096f86665fc4mr1250999ejr.50.1689930851021; Fri, 21 Jul 2023 02:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689930851; cv=none; d=google.com; s=arc-20160816; b=DmK2vGGdXQzoVXKnKFNwQ+2YChU/5ntLSXcvILP6BVdgXC4H7+k7FupBXtmusLssjJ 30UKrgDLqCuGH1TE6VuKbBrTq9gPyiyUvApT1A6+vXQZhw0Xfv7MqkveXIi8ABt27iVL aARYPgNHn6ZHCMOllGtfAYmKNMKSiF4hpu0TyxyOYB4MAqpMNvwPVm353Zurc8Un002i +j8ooFQ22/3f4BfPwQuSIOTGa75JQRHWzzgqvYWRKWeRE+jfv8/lC0QkMO5j7apb4ufO 61vbwQt2krw8BgwtzBDU+63/UbsQI2bx2BFczdV1O6Yh2J73kx4YTwPUf9dHjcOaHhO/ x5ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Z6KxAWVM1q+OTanohiuVuMarMnbUF16ttguRbBDzNfA=; fh=MlGqaUnvBjpXmiP990bdf+mzv9VjPrVaE5OVdv29XYE=; b=RX0g1uuY/K8D0zvvI5MgNf+L/xL658DxD6rn1/TTj4O0FmHV/YWZIubihUrJxgTkc/ p+CLf01EjsQWMb8P0anFHz721Ct7uQOhpbk+BXf+A9aG/zcyPvAR5MJ2KcJyldC+b1aq +4gVHOf3jmE15qWNcwJ+B8RFqAb/gt5sWHMmXmYykvRz7GKdFxPcc3uzJCnGL7c1qMje YECnvclFMyGiZWtF1xqQflsEot/tbph8XyF0nvanoUVA8Lk1QZaexwVxee7lVxX/tksD B0g8J6RnFIu8Fqob2CwNXqudSLeiU8wMAPrlVKZiZ3TlGlRW27aTH5q6ogr/sDgZ2ddQ sS8Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oy11-20020a170907104b00b00992d263099dsi1972602ejb.10.2023.07.21.02.13.47; Fri, 21 Jul 2023 02:14:11 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231319AbjGUJJt (ORCPT + 99 others); Fri, 21 Jul 2023 05:09:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231379AbjGUJJm (ORCPT ); Fri, 21 Jul 2023 05:09:42 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F33F730C7; Fri, 21 Jul 2023 02:09:41 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4R6kJx5yGSz4f3n6L; Fri, 21 Jul 2023 17:09:37 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.124.27]) by APP4 (Coremail) with SMTP id gCh0CgAHvrFPS7pkqi7fOQ--.527S8; Fri, 21 Jul 2023 17:09:38 +0800 (CST) From: Kemeng Shi To: tytso@mit.edu, adilger.kernel@dilger.ca, ritesh.list@gmail.com, ojaswin@linux.ibm.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Cc: shikemeng@huaweicloud.com Subject: [PATCH 06/10] ext4: replace the traditional ternary conditional operator with with max()/min() Date: Sat, 22 Jul 2023 01:10:03 +0800 Message-Id: <20230721171007.2065423-7-shikemeng@huaweicloud.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20230721171007.2065423-1-shikemeng@huaweicloud.com> References: <20230721171007.2065423-1-shikemeng@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgAHvrFPS7pkqi7fOQ--.527S8 X-Coremail-Antispam: 1UD129KBjvdXoW7GF45XryfGw1kWFy3KFyxuFg_yoWDXFX_Ga 47Ary8Gry3GrWFkFy0vrsYvr409an5try5XrW5tFW8AFyUJ3y0vwnrZr4fGF4xuFWYyrsF ywn3WF97GF1SgjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbDkFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M28IrcIa0xkI8V A2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK 6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4 xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8 JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20V AGYxC7MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAF wI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc4 0Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AK xVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr 1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7sRiVbyDUU UUU== X-CM-SenderInfo: 5vklyvpphqwq5kxd4v5lfo033gof0z/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, KHOP_HELO_FCRDNS,MAY_BE_FORGED,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Replace the traditional ternary conditional operator with with max()/min() Signed-off-by: Kemeng Shi --- fs/ext4/mballoc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 78160bf5b533..412d335583fe 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -6699,8 +6699,7 @@ __releases(ext4_group_lock_ptr(sb, e4b->bd_group)) void *bitmap; bitmap = e4b->bd_bitmap; - start = (e4b->bd_info->bb_first_free > start) ? - e4b->bd_info->bb_first_free : start; + start = max(e4b->bd_info->bb_first_free, start); count = 0; free_count = 0; @@ -6917,8 +6916,7 @@ ext4_mballoc_query_range( ext4_lock_group(sb, group); - start = (e4b.bd_info->bb_first_free > start) ? - e4b.bd_info->bb_first_free : start; + start = max(e4b.bd_info->bb_first_free, start); if (end >= EXT4_CLUSTERS_PER_GROUP(sb)) end = EXT4_CLUSTERS_PER_GROUP(sb) - 1; -- 2.30.0