Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp512815lqh; Fri, 31 May 2024 08:08:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJmZlnuZelkGBq3oGzbvLJ6Q+gdT1sEAhItltVixoufvSK9OjefOl+79sap2wnsvjz0yUg7vDzOKk8UMcG77Yq6voscIX0mtPThYDJ4Q== X-Google-Smtp-Source: AGHT+IFAPzRp8bBpKnbaguZFOQy0gRdW9lpVPC5d7ontAJnJWF44pxlzk8JylY6rcdcN4JD9USaR X-Received: by 2002:a17:906:a098:b0:a65:36cd:c7b7 with SMTP id a640c23a62f3a-a682198281dmr144055766b.56.1717168081203; Fri, 31 May 2024 08:08:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717168081; cv=pass; d=google.com; s=arc-20160816; b=dG3ypkU49Poxy/0xmeMZZ/0k3NYn2bTWSsCQ+6IVYzn4dok852SsAaSU0NNaLIe3n/ mSkZPFkqlwtsQbYcfEGcblnFwd+LA+thhhwbtY7QB1BuffwdTAVFbhVugJbrFUfrJ/HX N3HcBoCBK9HBvcRXm+Iabo4MiP+OPX0bkVZT0YpqyOmrUAnQAvMwGCnx7HGNHCll9d/i 79ag8CcNmt4m13oClJkyfTcRAdXrLlGbqwK9xOXcXvibYlQ5Cd+hQcV1vLUZ57yCdPF6 Xau8DUWqIwim1I7wGRK0aSvqVMcfO4YrKvfQ17pighljyjzHW6joGo9dPgtDpFdUxtuL In+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hCUBcBU9tMIwZo+oglgi14e5xQXMY22P2t0qolDTyYc=; fh=sPKrtYcvfYrx0SMCKkPItgREgastrob9cURc2UNAf8I=; b=v8tCIbIixtWljbgbQMcY/6fV9UgXWzr8cIPu1IWTKBCVj0h5T2PRH+kew/uEUPIJ0a 2B7YLQ52cWjUH/US3syKlUl0o2Z3n3yYG4+3gGHkd920nor8vzuoiplhVLx0ByoU/pNv WAzg7ovn5+qFHHAt8SpsXk+Dbub1u5MpMvdTbka207mU4FWaQG0DWR/qnAYD7x8CCyHO 6SNbY9IhQ9rQnsBnwD1d90HKQbieqjva77sz/Atxe1hwAiuXJDyTTosLebhZN7dqv6ox hN31KI7utwik7hOeG2ghhiaI5JEuc9/sQA7P43VNecyNfW3rYKmimlQf8B4rd6BBIrA+ HQCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=0XkRMDd6; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-196801-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196801-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a683b349116si82574566b.1029.2024.05.31.08.08.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 08:08:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-196801-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=0XkRMDd6; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-196801-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-196801-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9A84D1F2691B for ; Fri, 31 May 2024 12:39:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8B5D17CA04; Fri, 31 May 2024 12:35:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="0XkRMDd6" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B8B016C680; Fri, 31 May 2024 12:35:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717158939; cv=none; b=In1CuTPNUcfJcH8ES6oF3N2CI4vfTQ2jC6AkA9kX1oB6qvEV5vJYc+SiuAAyIms3w9SHNt6Cm6hOWV6y5ALrfYxyj/V9xCftCpkbMZcjVV/B8S8cTX2dnapHSSm9vAzKB67ypZlqlUjUpErAQEONtM/UfUjMePOYP4PWNdw9eQc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717158939; c=relaxed/simple; bh=yz0H5jPIazi1cJgufbtsx3CWCOgn9qXqHlp9sIKzMAg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Wd7xUaX7W0Df5ehQ5ECp4UkafBCaEgfFasK9ERGwlYI56OXOmByf4XevoD2uZHoj7xQdyaQG2fJhfetZEs6raPkwH50quXyfC85FaaeKJO0Yz36KrnqWyH6JoKKPOxLw/o9OjUSXP8xpn0JNF4IJ0K8+yW/fNqoX7Fl+DJ/wKQ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=0XkRMDd6; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org 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=hCUBcBU9tMIwZo+oglgi14e5xQXMY22P2t0qolDTyYc=; b=0XkRMDd62JE2zhC9qnAtfp6g2+ PSz0tgR2r5VjwygMtuBtv4T7eAANbpbxY/6zxEwmlNSUOok5Zy0rpfiPqX1EjicPKJSh3E7JnIwiQ pyJBd97tTshKl68lRKVYcYYq+ZSFPMqG9EKLZwQ8XBGzpukaIyZ9UgCzbfEDH2UDDxzAn7FStqShU DvxyLG5Pi1amvu2TAY78PKUrps622e6/a9ZX1n8TuCgEEk8Y7cizJdVpMEIC6HUGtA4GurCJsiwzm AGTqf4ROBMH/EcQ2R3sJrpiCg9o6YKkyGGUsmst6nJgSJ0mWSVyOaN1/qtuQUMMa5fzDgvxbgY/WM wcA8+LTQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD1Tr-0000000AD65-43gx; Fri, 31 May 2024 12:35:35 +0000 Date: Fri, 31 May 2024 05:35:35 -0700 From: Christoph Hellwig To: Zhang Yi Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, djwong@kernel.org, hch@infradead.org, brauner@kernel.org, david@fromorbit.com, chandanbabu@kernel.org, jack@suse.cz, willy@infradead.org, yi.zhang@huawei.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: Re: [RFC PATCH v4 2/8] math64: add rem_u64() to just return the remainder Message-ID: References: <20240529095206.2568162-1-yi.zhang@huaweicloud.com> <20240529095206.2568162-3-yi.zhang@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240529095206.2568162-3-yi.zhang@huaweicloud.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html > +#ifndef rem_u64 > +static inline u32 rem_u64(u64 dividend, u32 divisor) > +{ > + if (is_power_of_2(divisor)) > + return dividend & (divisor - 1); > + return do_div(dividend, divisor); > +} > +#endif This ifndef seems superflous. Otherwise looks good: Reviewed-by: Christoph Hellwig