Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1368060lqa; Mon, 29 Apr 2024 06:48:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUvRV4Nw+657MhDFfLPREdTPgOTby8PFMQrQt2r5cnUtT/Bdfmpjt0SwdWUKuA7QKuid5KizUs3wRoZIdEkaKlGsZQ+IJ7gFrXUbMIIhA== X-Google-Smtp-Source: AGHT+IE99AE/YalIuLBsNnzJaN8d45cbzbJl58z+qCjtzNUaP3xY+7oNewwf5TyTSrKRFvVDZc8z X-Received: by 2002:a17:906:ff52:b0:a58:8864:b3e9 with SMTP id zo18-20020a170906ff5200b00a588864b3e9mr6866919ejb.30.1714398530226; Mon, 29 Apr 2024 06:48:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714398530; cv=pass; d=google.com; s=arc-20160816; b=GWZVTFnSnVeloRc8TP1GoOjE9cjIO0XymCOUdaiKV/zOoTSWvIJ8+2lM15QAoOf9Bd jbsGq49dXNRoCviD475d9OBnSKldylCWT4i9LuHTs4ZUAkt2qPRisZqTTJQY8S4gUdo9 Q4CJsEgJ3XB05WF6jXRP2DUFVJ/dZWKNEATAKcmHCdeNRTO0l8ic/kLKn06gDTsYu0FR FNtCztpuUj6h/vEffFqNVvLHiikVcGhi/z1k5HYPB42NAZTJ5x1xRT0frKYrkFpJjGA9 qr4ZmWI35B0E9L39BXou6+ONBu0bGy1YNLWJWGts8FQnafzINLHnR0PmlQwzRRojV/AL 4BVg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:in-reply-to :references:from:cc:subject:to:message-id:date:dkim-signature; bh=YTDBu7i4Qm3uWNrBtZ6iNRK3KTpA55FXccHlI6B3vMM=; fh=8ECq8mSayrirnBdWghxPLryYdFzK4TFB0KFASjcRRwE=; b=GAsy/HAz+50Dahu9TPfb0v2jwPR1hIF1P4sIUHOz9s9qRwdpXrRJCyASzvTgzrP1Fe CsuyFbud1CmU1KYcEw4/d2x++CFmKLkTcSR+rOMmpHhVWD0/ch78NMowJ6CwiInumyoe Ty1XIr7vmj2cE1dbUu2R/CywsUUm/PrCFr+zjAZ4sAq0nrJHELbdFMOn87SvXkawVEFZ imze4he3Npbo1mtOAv4O9IWoXTi2ImkYWxszYRShaV0psqOFf0NQ/2LzTXVPSGJAsatj QGGDhj1cGV4n1WWN10fXf2vDkIOl5VUrg/N91KNzv9LL4FxGucbNMLumt6Xwl0HImW0r XPJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xv72g4Gl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162388-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162388-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 mb25-20020a170906eb1900b00a58ce276bf3si4327547ejb.679.2024.04.29.06.48.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 06:48:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162388-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=@kernel.org header.s=k20201202 header.b=Xv72g4Gl; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162388-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162388-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 DCB2A1F23250 for ; Mon, 29 Apr 2024 13:48:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6217479950; Mon, 29 Apr 2024 13:47:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Xv72g4Gl" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8DF2C745C5 for ; Mon, 29 Apr 2024 13:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714398456; cv=none; b=lNZjrw7ADjIVrqv/EdlRUkpgaD7P38QBKOcO49qEG40AJKepAsHz98tXGAXFwUB0IxZYjj/Guxtg5+EuUfhltH9l6F0UyVXRp4pMRTEEDDzVhleDYc35vN+cBEkfrT2Nbcb/MUvBugf5Dcoiy2TzgRrAXAGse5NNNp4qO0rPKTg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714398456; c=relaxed/simple; bh=YTDBu7i4Qm3uWNrBtZ6iNRK3KTpA55FXccHlI6B3vMM=; h=Content-Type:Date:Message-Id:To:Subject:Cc:From:References: In-Reply-To; b=St0WXCRYU6gvtmITLPrPebtwYFPtLCydqS97hj31v4Tjy97LCOyxacNiBrGDSJxiN0xzKduP7Ej0sjhziFuK4QjNLXR9g3ZWr8NZh+8jGoSaMg/lbg2Q23dDu9ENvlXvoB6Dtj8bg0kCQAK2Nw0CfTbYjao2hHGfPR7fQO1WyvE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Xv72g4Gl; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4A29C4AF19; Mon, 29 Apr 2024 13:47:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714398456; bh=YTDBu7i4Qm3uWNrBtZ6iNRK3KTpA55FXccHlI6B3vMM=; h=Date:To:Subject:Cc:From:References:In-Reply-To:From; b=Xv72g4GlaEdk3wBng8Z5HiexlLCD8loaMEjgufAWr7g/rzguM8zgkXjP2Fvhf0W20 380Us1/2fnsnNAemrg0MlTNuE65w1ocXpnyyfiOl0kkndIS7NAruS5J8auWZdw3Z+y o1nY4Go5/KENX23/KTMwixIjLdlVVinVGvWKPy1MvF+cYDB4jAdJT5MMEgYKXM2E4a XYXVFEaTxcih5FnogwMYiq6RBhloy1E/y1BpYA/Bdmx+SMFK54oddp1pOlQvnMpJNR OQs/fn7d7rlkRru4/xBUW34o6dcF05Bvu1YnVkaMyRnEDqBFFdqeFBqzBrePWoownx dqsqHedEUh2QQ== Content-Type: multipart/signed; boundary=835c43056ed51c66bddab6950631070232af469583daba94213c5b42a3fe; micalg=pgp-sha384; protocol="application/pgp-signature" Date: Mon, 29 Apr 2024 15:47:13 +0200 Message-Id: To: "Pratyush Yadav" Subject: Re: [PATCH] mtd: spi-nor: replace unnecessary div64_u64() with div_u64() Cc: "Tudor Ambarus" , "Miquel Raynal" , "Richard Weinberger" , "Vignesh Raghavendra" , "Dan Carpenter" , , From: "Michael Walle" X-Mailer: aerc 0.16.0 References: <20240429121113.803703-1-mwalle@kernel.org> In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: --835c43056ed51c66bddab6950631070232af469583daba94213c5b42a3fe Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Hi, On Mon Apr 29, 2024 at 3:27 PM CEST, Pratyush Yadav wrote: > On Mon, Apr 29 2024, Michael Walle wrote: > > > Both occurences of div64_u64() just have a u8 or u32 divisor. Use > > div_u64() instead. > > Does this improve performance or is this only for correctness? See function doc for div_u64(): * This is the most common 64bit divide and should be used if possible, * as many 32bit archs can optimize this variant better than a full 64bit * divide. > Patch LGTM otherwise. > > Reviewed-by: Pratyush Yadav > > BTW, I also noticed that there is a do_div() call in spi_nor_write() > that also uses a u64 dividend and u32 divisor. I was wondering why it > uses do_div() and not div_u64() (I am not sure what the difference > between the two is) but I suppose it doesn't matter much since your > spring cleaning series will delete that code anyway. do_div() is a macro and is modifying the dividend in place, whereas div_u64() will return it. do_div() is using u32 for the divisor anyway. -michael --835c43056ed51c66bddab6950631070232af469583daba94213c5b42a3fe Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iKgEABMJADAWIQTIVZIcOo5wfU/AngkSJzzuPgIf+AUCZi+k4hIcbXdhbGxlQGtl cm5lbC5vcmcACgkQEic87j4CH/hNLgF+LlPVrs+XYNoNPY3HJktt+35X6xG0B4sa 6xZL8RX95pozeOpjBoMygK1kDKUwqFOMAYDKZIyCD1kN0n0Wj7tiRpY/YCRQJjxd yZfQNMubH2WhzSpI0oA45LJLEfYadWaoCqg= =2oCk -----END PGP SIGNATURE----- --835c43056ed51c66bddab6950631070232af469583daba94213c5b42a3fe--