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 1C0FDC433F5 for ; Wed, 18 May 2022 08:45:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233374AbiERIpf (ORCPT ); Wed, 18 May 2022 04:45:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230513AbiERIpe (ORCPT ); Wed, 18 May 2022 04:45:34 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0119521E2C for ; Wed, 18 May 2022 01:45:32 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 3BBD068AFE; Wed, 18 May 2022 10:45:30 +0200 (CEST) Date: Wed, 18 May 2022 10:45:29 +0200 From: Christoph Hellwig To: Johannes Thumshirn Cc: Christoph Hellwig , Chris Mason , Josef Bacik , David Sterba , Qu Wenruo , "linux-btrfs@vger.kernel.org" Subject: Re: [PATCH 09/15] btrfs: factor out a btrfs_csum_ptr helper Message-ID: <20220518084529.GC6933@lst.de> References: <20220517145039.3202184-1-hch@lst.de> <20220517145039.3202184-10-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Tue, May 17, 2022 at 03:24:26PM +0000, Johannes Thumshirn wrote: > On 17/05/2022 16:52, Christoph Hellwig wrote: > > +static inline u8 *btrfs_csum_ptr(struct btrfs_fs_info *fs_info, u8 *csums, > > + u64 offset) > > +{ > > + return csums + > > + ((offset >> fs_info->sectorsize_bits) * fs_info->csum_size); > > I guess a local variable for holding 'offset >> fs_info->sectorsize_bits' > wouldn't have hurt readability and the compiler would've optimized it away, > but that's just me nitpicking. I can do that if there is a strong opinion, but I'm not sure it would help readability at all.