iio: frequency: adf4350: replace TODO with NOTE in adf4350_set_freq()
Subsystems (2)
PATCH v3 1/1 iio: frequency: adf4350: replace TODO with NOTE in adf4350_set_freq()
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.
---
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)
drivers/iio/frequency/adf4350.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/iio/frequency/adf4350.c +4 -4
@@ -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 ;
Signature · 1 line
2.44.0
Quoted 3 lines · Neel Bullywon
Replace the TODO comment in
adf4350_set_freq()with a NOTE explaining that a constant-time approach usingfls_long()was attempted but deemed more complex without meaningful benefit for initialization code.
Good enough, thanks,
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 8 lines · On Tue, 24 Mar 2026 13:44:11 +0200 Andy Shevchenko…
Quoted 3 lines · Neel Bullywon
Replace the TODO comment in
adf4350_set_freq()with a NOTE explaining that a constant-time approach usingfls_long()was attempted but deemed more complex without meaningful benefit for initialization code.Good enough, thanks,
Reviewed-by Andy Shevchenko <[email protected]>
Applied. Thanks,