From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DA97C7619A for ; Wed, 5 Apr 2023 05:41:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236851AbjDEFlF (ORCPT ); Wed, 5 Apr 2023 01:41:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236386AbjDEFlD (ORCPT ); Wed, 5 Apr 2023 01:41:03 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A494421F; Tue, 4 Apr 2023 22:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tUw6fLkEufjZAV2DxCfgThpnp199F0064DabhqHL5gY=; b=CtwY0kfoOx7fpitUqNyr2agKf5 Cwc+0wCG3Oxocf/8h3JXDkzFPp5B0vdMeQwuolA/yIbAGfRHelbWKdHE4Rv3eDXhv5HPMRlvLZSwo MGZmh6BIvUqNjIatQ+Eq4PULjw+uH3Rwlvm4Se76CfTDMBHlMjTKTwrLh7jW4u/OYbUY8g0DHq34H /gyv+aBD8abMtGVudmOa5kyQrTlTF+4OH/VJkTOx167a26hE7ueNoimzIZGVJVfYlKSYJWxaQ1UcL chWvg9htMHVrIE+BMGgs8ybczCztsE/FRZC17U0pmMIaB9Wl0OZAQvNtnX5T9xy7E3VdRbmcLs3xc ANsBEzkg==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pjvtA-003Pme-1h; Wed, 05 Apr 2023 05:40:56 +0000 Date: Tue, 4 Apr 2023 22:40:56 -0700 From: Christoph Hellwig To: wuchi Cc: tytso@mit.edu, adilger.kernel@dilger.ca, ojaswin@linux.ibm.com, ritesh.list@gmail.com, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ext4: simplify 32bit calculation of lblk Message-ID: References: <20230403135304.19858-1-wuchi.zero@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230403135304.19858-1-wuchi.zero@gmail.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 03, 2023 at 09:53:04PM +0800, wuchi wrote: > - if (block > ext_block) > - return ext_pblk + (block - ext_block); > - else > - return ext_pblk - (ext_block - block); > + return ext_pblk + ((signed long long)block - (signed long long)ext_block); And what exactly is the value add here, except for turning an easy to parse statement into a complex expression using casts?