public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Neel Bullywon <neelb2403@gmail.com>
To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org
Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Neel Bullywon <neelb2403@gmail.com>
Subject: [PATCH v3] iio: frequency: adf4350: replace TODO with NOTE in adf4350_set_freq()
Date: Mon, 23 Mar 2026 19:33:16 -0400	[thread overview]
Message-ID: <20260323233316.40047-1-neelb2403@gmail.com> (raw)

Replace the TODO comment in adf4350_set_freq() with a NOTE explaining
that a constant-time approach using fls_long() was attempted but deemed
more complex without meaningful benefit for initialization code.

Signed-off-by: Neel Bullywon <neelb2403@gmail.com>
---
Changes in v3:
  - Drop fls_long() replacement, keep original while loop (Andy Shevchenko,
    David Laight, Jonathan Cameron)
  - Simply replace TODO with NOTE explaining the prior attempt

Changes in v2:
  - Use fls_long() instead of order_base_2(DIV_ROUND_UP_ULL()) to avoid
    unnecessary 64-bit division (Andy Shevchenko)

Link: https://lore.kernel.org/linux-iio/20260314172006.69744-1-neelb2403@gmail.com/

 drivers/iio/frequency/adf4350.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
index 3883b63dcc3c..6bbb6a8dd9d0 100644
--- a/drivers/iio/frequency/adf4350.c
+++ b/drivers/iio/frequency/adf4350.c
@@ -152,10 +152,10 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq)
 	st->r4_rf_div_sel = 0;
 
 	/*
-	 * !\TODO: The below computation is making sure we get a power of 2
-	 * shift (st->r4_rf_div_sel) so that freq becomes higher or equal to
-	 * ADF4350_MIN_VCO_FREQ. This might be simplified with fls()/fls_long()
-	 * and friends.
+	 * NOTE: This iteratively shifts freq by a power of 2
+	 * (st->r4_rf_div_sel) to meet or exceed ADF4350_MIN_VCO_FREQ.
+	 * A constant-time approach using fls_long() was attempted but
+	 * deemed more complex without meaningful benefit for init code.
 	 */
 	while (freq < ADF4350_MIN_VCO_FREQ) {
 		freq <<= 1;
-- 
2.44.0


             reply	other threads:[~2026-03-23 23:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23 23:33 Neel Bullywon [this message]
2026-03-24 11:44 ` [PATCH v3] iio: frequency: adf4350: replace TODO with NOTE in adf4350_set_freq() Andy Shevchenko
2026-03-25 20:20   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260323233316.40047-1-neelb2403@gmail.com \
    --to=neelb2403@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox