From patchwork Sat Oct 29 14:49:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: KaiLong Wang X-Patchwork-Id: 12729 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1394576wru; Sat, 29 Oct 2022 08:22:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM71KlIjuy496TySMXArJdpYEzkRyVNfC1pF7jQCnI0tF2nz8Ts6Hw2qG1Xuo7MasTtoZCjp X-Received: by 2002:a17:902:e74f:b0:186:a962:8f92 with SMTP id p15-20020a170902e74f00b00186a9628f92mr4883113plf.41.1667056939759; Sat, 29 Oct 2022 08:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667056939; cv=none; d=google.com; s=arc-20160816; b=odnrrnvv0RsBsGbVTRZObs9H765b6ylkrVXs5/8Lf6cpdm3X2x1y0helrSbcNKNh+A Gdpz5er5qDgSuDChhpqDNCOXljLiVGOdEcVskvD9S+CAtXHBMIIdWuL7jLvcz6EfwfJg uDKBv6Op0cDh4Pir9VhrKicQ5HPoyaIbBV70foXGRRsDCxDeI3s088IojompTnpb8wg6 NliXokI57b67sRocTRrpB9u1vnsnt0lBCj3OnW9utvAJj/5ko838NP4k8v1MIDusY4uA iaEeAoZs4O1zAB3oVOiGJlCu7FQmSDwtj6FkbaWmVb5zgUT0Q/Fujl9LMw00CVpwpWBY mBfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=AbHY9yLTxHn2TNb9fLdoLL18ztSy3mhImVErewlpdhc=; b=XHOp3EjVzIqQyYgzF3xpSR8ymMXO+74tKrSAHIFUEirWr/+oejDc0zn7QR1me/Boy+ oh6akUdyTef4NXK3Y+C6s+gNmKfjoAVYRbsHTr9p/HdemaRi01/Eqc08WYH6njMecrL9 a4f7UzYR+lhO4vQPI6RBnECD/g62CCu08iITGr2pghzye57Q/KqQbrV4pSD+zwWYFBd3 xtBAGMmLANtiQ1kdrnUmIXx6SgjhgvDVOCaU0JxCpjM3BgQlnWH7/wdhJxa38muguKSw lUTZp9wD55+I5/qM/DoI7CLbRsQSGzjVz+zgRSfwL6XYHRfHtiNpMmeC9ADdjcDZyCLf 0QzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e68-20020a636947000000b0046040a8be4esi2170248pgc.754.2022.10.29.08.22.05; Sat, 29 Oct 2022 08:22:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229940AbiJ2Oya (ORCPT + 99 others); Sat, 29 Oct 2022 10:54:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229497AbiJ2Oy2 (ORCPT ); Sat, 29 Oct 2022 10:54:28 -0400 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 143CF317D8 for ; Sat, 29 Oct 2022 07:54:17 -0700 (PDT) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sat, 29 Oct 2022 22:49:30 +0800 (GMT+08:00) X-Originating-IP: [182.148.13.81] Date: Sat, 29 Oct 2022 22:49:30 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: wangkailong@jari.cn To: jaegeuk@kernel.org, chao@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: replace ternary operator with max() X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn MIME-Version: 1.0 Message-ID: <44b06118.3c.18424382765.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwCnu+F6PV1j+d0AAA--.25W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQAKB2FEYx0AVwAJsJ X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VWxJw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00,RCVD_IN_PBL,RDNS_NONE, T_SPF_HELO_PERMERROR,T_SPF_TEMPERROR,XPRIO autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748035897794056294?= X-GMAIL-MSGID: =?utf-8?q?1748035897794056294?= Fix the following coccicheck warning: ./fs/f2fs/segment.c:877:24-25: WARNING opportunity for max() Signed-off-by: KaiLong Wang Reviewed-by: Chao Yu --- fs/f2fs/segment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index ada21e83d279..6da92518328c 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -874,7 +874,7 @@ block_t f2fs_get_unusable_blocks(struct f2fs_sb_info *sbi) } mutex_unlock(&dirty_i->seglist_lock); - unusable = holes[DATA] > holes[NODE] ? holes[DATA] : holes[NODE]; + unusable = max(holes[DATA], holes[NODE]); if (unusable > ovp_holes) return unusable - ovp_holes; return 0;