From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8ABC6395D85 for ; Mon, 23 Mar 2026 11:07:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774264052; cv=none; b=lZ9G0Zl+RuULUUC2HqQkf8y1DQTRgocaGGfiqnmdTd45pwDsecIlW5YasWG4sVy2Eo4yB5JKsmbjugCNHizEN3Jcfq7L3UigJu2zJo+WZM40HKf0ttHlMncGKwtahpvMhJ9OW53SfRqUAJP4fKhFxH8ANRZBG7xI/9NkE6UwFV4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774264052; c=relaxed/simple; bh=WDighDaD4KT0IuNZ8FdNHXLv2+dX8hCdCwnZFgPWteA=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Amh7KW+KPzomel83PAOMmunog6FIzqexEvQgw+ro48gS5TxFrwIdL83iVbQSEzErx3rG25Sv0T6oRxeWHKFF5oJTVIR+LIV85EXTK67ZiuG0tI827DCb/A1vWDjGPKqjf8g/UTukrdq0R2EKPDCk8cZG9GSsLV5MmRmSK3znrjs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ls1c0+4o; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ls1c0+4o" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-486fb14227cso42871215e9.3 for ; Mon, 23 Mar 2026 04:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1774264050; x=1774868850; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=WDighDaD4KT0IuNZ8FdNHXLv2+dX8hCdCwnZFgPWteA=; b=Ls1c0+4oZCFouqTGrS9o8f2n/lWNVUqFhG3eWrawaEqq93OgqqBAsNpTXgwLzk3jv7 85BKO5yxqmR7VXvunOUId8G+T/oROHH+t1ml4IWjS7yQ5p28ozcAdd2jzmB9tMQ7/tSi jkWQmi4wnAUHlNv3yfq7L2z5lUn+/y/eYE1UCBI5m43egM+zxKkYYUlRxY8X0RsWdYC7 Vm/PognTFPtvyoikBrvuBiTOWUSc7As8jT2jARMBhYEqxZmklp7UUYzpqqY3W2fUYKXP Nuqw7q6MvuC8EE+JxbEBtZ8+Bx/50hnfM/OpxUHF9n/ZVUURSwt3+/lHWCSGIHsuShrK qhtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774264050; x=1774868850; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WDighDaD4KT0IuNZ8FdNHXLv2+dX8hCdCwnZFgPWteA=; b=Axs2VjFMLsXPrXC2oMBPeYnQkGmm1fg7wT7bwid2OIVnLhPagRwN6raHNG9T2kypGb dMhO7fZCwptfvYcN9NN5NaIXMfSZgsxQika2OukDc7Vl7L+d9DrVGBvR1CSkanW66WV6 JvI08H6DtTF+XCJ/eGNAndGbAdkE9ThrB9RrZVGsvM0tP6zoM0HayIF7K0EXU1fxILLy qyA8dFTIRBDz6++97pHkNnrswu8HH51H/1tXUfkDM6NKf8QZMpfuMaKVC8Rgf4mKc36l VF5MQ/cPqOBSibE94RerxDJ/z3yZI5970LoPVti0MzhYXIAqy6BzrehapmmSC1TGmYzN /EEg== X-Forwarded-Encrypted: i=1; AJvYcCX2EpV4iylIRvgydrOubzo1gmI9a+9IX94iyVw6nhxPFsfCnJHZNJDHMQvsu8AXD9LkR+av4JJjk7gmx+A=@vger.kernel.org X-Gm-Message-State: AOJu0YzyAhVbnkO2PNqhm8d6fGDBACYWOx5xIe5jWejhB7hr0roXnbQF cSdkCF+uehLx6LEdcgKWgg+atfzuxe8NBkI+RCwl3w+TxoJ0UCjiHsbz X-Gm-Gg: ATEYQzzZM/7FJQPAjFYyH+A+dOoODKOIxA3ngpn4tmBDu74eryIlByK9WSOsNoD5I6X jsOUcwEQQq068jLG8NVfV2gqqA4fFyEH+H2bxW51SkQbugvFlxa9WdvhNqZeDxo780TfCImAojo vnDTnyUzENX1MylSiMtzY4J5UxfbVPgRNAIZV0bMWWak6vJgpeVjnt8btaFGsR1tLYA5X1+dbUE AEbkCE0NsWsPY3gabLXzCnxsMO1gVbrZ9WE36yqVxv9VsVVgy05TRekSOF9ERGZZA6x9Gfgh+Pm eusdlfBqy7RAK54Nh9PDDVs2QblkVvzgtO4Mtqbm3nIrCh2y9vW2J2cDOzb15EUm1Z2UYC+jlQT slkxHb1mph5gI+/CCmX3c7PfdsBktRjtuvOuJjfwgGPm336W9vdleEEJZxy3IFr/ZBE5s9Wmcnw 22m8w8g/IlIcnu0XOuzmcuiR27FlxK+Zc= X-Received: by 2002:a05:600c:4707:b0:480:20f1:7aa6 with SMTP id 5b1f17b1804b1-486fee231cdmr156767535e9.21.1774264049736; Mon, 23 Mar 2026 04:07:29 -0700 (PDT) Received: from [192.168.1.187] ([148.63.225.166]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43b647120a1sm29662569f8f.30.2026.03.23.04.07.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2026 04:07:29 -0700 (PDT) Message-ID: <920aba2275ff1da033214293a603ef1e215d3dcb.camel@gmail.com> Subject: Re: [PATCH v2] iio: frequency: adf4350: replace loop with fls_long() From: Nuno =?ISO-8859-1?Q?S=E1?= To: Andy Shevchenko , David Laight Cc: Neel Bullywon , lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 23 Mar 2026 11:08:15 +0000 In-Reply-To: References: <20260311020115.56321-1-neelb2403@gmail.com> <20260314172006.69744-1-neelb2403@gmail.com> <20260316135151.309207ae@pumpkin> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.58.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2026-03-16 at 16:07 +0200, Andy Shevchenko wrote: > On Mon, Mar 16, 2026 at 01:51:51PM +0000, David Laight wrote: > > On Sat, 14 Mar 2026 13:20:06 -0400 > > Neel Bullywon wrote: > >=20 > > > Address the TODO in adf4350_set_freq() by replacing the iterative > > > power-of-2 shift loop with a constant-time bitwise calculation. > > >=20 > > > By comparing the highest set bits of the target constant and freq > > > using fls_long(), we can calculate the required RF divider selection > > > in a single step without relying on expensive 64-bit division. > >=20 > > Where is the 64bit division? > > (apart from in v1) > > Indeed where are the 64bit values at all. > > If this code is used on 32bit it has to work with a 32bit long. > > Which makes be think that the 'freq' variable should be u32 (or possibl= y u64 > > if frequencies above 4GHz are likely - which I doubt). >=20 > I don't know about _this_ device, but before looking into datasheet I wou= ldn't > put a low probability on the frequencies higher than 4.3GHz. We have (or = going > to have) devices that work with up to 26GHz frequencies in this folder. Yes, it goes up to 4.4GHz. - Nuno S=C3=A1 >=20 > > In any case this looks like initialisation code and the existing loop > > has the advantage of being 'obviously correct' and small.