Message ID | 20230401075303.45206-1-wuchi.zero@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1091871vqo; Sat, 1 Apr 2023 01:24:21 -0700 (PDT) X-Google-Smtp-Source: AK7set+vjPEgJVlRrXlOnuB+H3N6jfb0rtBkzGK9rQE9vwlZ6bq1LcP79W5zPNO5Sd0WV/aIbR2o X-Received: by 2002:a05:6a20:4b04:b0:da:feb5:1829 with SMTP id fp4-20020a056a204b0400b000dafeb51829mr20440590pzb.56.1680337460916; Sat, 01 Apr 2023 01:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680337460; cv=none; d=google.com; s=arc-20160816; b=y0P8SfXTXa5mLUceUG0OCf5sNB3TVabyqu5CoU7puF3vGQ9jnGgwC6OLj3uOnDGxrr vxEOsNyZmN0omPiKPb/6idraBesycwpREH3EDBzVGrLqiAc6jEU/b3nyoIC6KRRFIM0r EWuNSL8pNs2X6xvWg6LlBEpLU/2NtIg+xSLUYwlDm34jHGY7FlPd2H8k4ArdgSrDlaDs b55uTmd9Wg6Gxj6umcChhFYnzw1xUxw1/mrOsIsEmTedmeuqgLnos+OxLPi/10/T+PZq BQmro5h/Y4D9RQeolS1QRq5DVV5m33akhxf0DktXpzhispr3pQfuR4GR9JLzxiC8R++E Rb/A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=MvJ3b6Levpe3XaT1CiLfjcCIFyOXFlee6v0CyxBXTyw=; b=rNTIPv49qhWz8or1M7lR8G7SmcV4p2m5jIstfxdX8F+2h5RjtPzvnqvL/n3bQf73Au vUKdZudZCW8I7DzKL8BJyUStimeQazMXpi3KerkuAQNIdH2M38oCqzsbWYUEQhMAhqN1 eC+CZ11GfkGz9rshaxcEdvxP2oh5rDbT+GkJIDibTlGvqsGWi1N5Zc9k4psq6s4YMlXU lvOU0PbWMY6fmWv5qWRTMkI6zyKu5NI0T4fsnppW9bt21O+AC3cs6zUpGcHWK1YPbF+e ZRKQkqP3MrLQ9GR5DzoY12V7KeglDzdX+9ymT/WJyU3UJzbNWMg1iMaIcbO3i/Z4vNIc SkeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VYSCbPDX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020aa79589000000b00627f6643c07si4503683pfj.185.2023.04.01.01.24.03; Sat, 01 Apr 2023 01:24:20 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VYSCbPDX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233538AbjDAHxL (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Sat, 1 Apr 2023 03:53:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230092AbjDAHxJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 1 Apr 2023 03:53:09 -0400 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC9A9E042; Sat, 1 Apr 2023 00:53:08 -0700 (PDT) Received: by mail-pj1-x1032.google.com with SMTP id r7-20020a17090b050700b002404be7920aso23878840pjz.5; Sat, 01 Apr 2023 00:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680335588; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MvJ3b6Levpe3XaT1CiLfjcCIFyOXFlee6v0CyxBXTyw=; b=VYSCbPDXA6zq911VWx1Egu9LWOPU6qWuqAX74/cOCkcfBGRtjTY3EsbHACCWBKU5ok TmciVQlornTo0sWctWHoS1or7IDaWo+n2/av7YWHGuqb1HmcbXLYb2v7qVdBWICGgbZm uHOBESd5+abCXaXi3ZTvNqgVrCYR0Q/GNGqOZlA3G0hKokm18QL3eEwlcZRiq0W2x0ls 3On0cyToAlHIg+vTRbRZQe1mXRvmngIi7sVMXP7AM3f9xnUzHxirmpjSR3hY379e6JT+ g19RQ8PinbgOwOg/7AYd1xzfvFvJROrxYbKtH1QpLQQpwW1avYGq+dd+lnI4dLpKQYnT LlCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680335588; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MvJ3b6Levpe3XaT1CiLfjcCIFyOXFlee6v0CyxBXTyw=; b=col58ZwnD9x8h27DCc0NeG+zeX6lNDOTf3eOwu7N7jwNBBxGYbqb7pfyai3fOzhqof qmGcGqU8YUthEhmjqM+9IrTBb/7aov0J1QLQQg09B/KFvFpoU+pPr9cYZBYT3Rri9Ojt 5pjOtlCbSy0PCv/n2XbeZhXQg3gZGxvFAlilhvZ/P8UhGqcO3ArwCQPXUGUBR1gs7D+X gdPuAADlDzcNau+F+KhCCTqXsIIOq8Ouy2RMZfgN9dJRsuZsiECRRBzDyN1DLzFgsLwm 6uPoMQKOhz59qESncWauDy+dZlVmkZrKAudVsqdxO6ieAT00KMtqvf68K/765l0Q9OpH lZUA== X-Gm-Message-State: AAQBX9fWL79o7ELBgt6ymhKKtDum4Izm3Ts+0cK7HjQxBl2HEiFrFDGB m951kHV2C+WyT2fVQgzC1AM= X-Received: by 2002:a17:902:e5d1:b0:19e:4bc3:b1ef with SMTP id u17-20020a170902e5d100b0019e4bc3b1efmr37151846plf.64.1680335588249; Sat, 01 Apr 2023 00:53:08 -0700 (PDT) Received: from C02FG34WMD6R.bytedance.net ([61.213.176.10]) by smtp.gmail.com with ESMTPSA id i11-20020a170902eb4b00b001a0432ca99csm2752266pli.269.2023.04.01.00.53.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Apr 2023 00:53:07 -0700 (PDT) From: wuchi <wuchi.zero@gmail.com> To: tytso@mit.edu, adilger.kernel@dilger.ca Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ext4: remove useless conditional branch code Date: Sat, 1 Apr 2023 15:53:03 +0800 Message-Id: <20230401075303.45206-1-wuchi.zero@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761961533656362020?= X-GMAIL-MSGID: =?utf-8?q?1761961533656362020?= |
Series |
ext4: remove useless conditional branch code
|
|
Commit Message
wuchi
April 1, 2023, 7:53 a.m. UTC
It's ok because the code will be optimized by the compiler, just
try to simple the code.
Signed-off-by: wuchi <wuchi.zero@gmail.com>
---
fs/ext4/bitmap.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
Comments
On Sat 01-04-23 15:53:03, wuchi wrote: > It's ok because the code will be optimized by the compiler, just > try to simple the code. > > Signed-off-by: wuchi <wuchi.zero@gmail.com> Sure. Feel free to add: Reviewed-by: Jan Kara <jack@suse.cz> Honza > > diff --git a/fs/ext4/bitmap.c b/fs/ext4/bitmap.c > index 87c1c8ae9298..cd725bebe69e 100644 > --- a/fs/ext4/bitmap.c > +++ b/fs/ext4/bitmap.c > @@ -74,10 +74,7 @@ int ext4_block_bitmap_csum_verify(struct super_block *sb, > } else > calculated &= 0xFFFF; > > - if (provided == calculated) > - return 1; > - > - return 0; > + return provided == calculated; > } > > void ext4_block_bitmap_csum_set(struct super_block *sb, > -- > 2.20.1 >
On Sat, 01 Apr 2023 15:53:03 +0800, wuchi wrote: > It's ok because the code will be optimized by the compiler, just > try to simple the code. > > Applied, thanks! [1/1] ext4: remove useless conditional branch code commit: 17809d3cf801374d7c23101800770ea34951f3c8 Best regards,
diff --git a/fs/ext4/bitmap.c b/fs/ext4/bitmap.c index 87c1c8ae9298..cd725bebe69e 100644 --- a/fs/ext4/bitmap.c +++ b/fs/ext4/bitmap.c @@ -74,10 +74,7 @@ int ext4_block_bitmap_csum_verify(struct super_block *sb, } else calculated &= 0xFFFF; - if (provided == calculated) - return 1; - - return 0; + return provided == calculated; } void ext4_block_bitmap_csum_set(struct super_block *sb,