From: Marco Nenciarini <mnencia@kcore.it>
To: andriy.shevchenko@linux.intel.com
Cc: sakari.ailus@linux.intel.com, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] media: intel/ipu6: Improve DWC PHY HSFREQRANGE band selection for overlapping ranges
Date: Thu, 2 Apr 2026 11:35:43 +0200 [thread overview]
Message-ID: <ac44b9UAjbSbi8-4@spark.kcore.it> (raw)
In-Reply-To: <ac4uvf_a-4-fLBPV@ashevche-desk.local>
On 02-Apr-26 11:54, Andy Shevchenko wrote:
> Below just a couple of remarks, no need to be addressed, JFYI.
Thanks for the review.
> > + if (mbps > freqranges[i].max)
> > + continue;
> > +
> > + if (mbps < freqranges[i].min)
> > + break;
>
> Wondering if this can use bsearch() algo or any linear ranges.
The overlapping ranges and the multi-criteria selection (osc_freq_target
first, then closest default_mbps) make it hard to fit into a single
comparator. The forward scan with early break seemed like the most
straightforward approach.
> > + abs((int)mbps - (int)freqranges[i].default_mbps) <
> > + abs((int)mbps - (int)freqranges[best].default_mbps)))
>
> Note, abs(INT_MIN) is UB, I hope this won't be the case IRL in this code.
Good point. The values here are well within range, but an unsigned
abs_diff() helper would be cleaner. I will address it if a v4 is needed
for other reasons.
Marco
next prev parent reply other threads:[~2026-04-02 9:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 16:25 [PATCH v3] media: intel/ipu6: Improve DWC PHY HSFREQRANGE band selection for overlapping ranges Marco Nenciarini
2026-04-02 8:54 ` Andy Shevchenko
2026-04-02 9:35 ` Marco Nenciarini [this message]
2026-04-07 19:12 ` Marco Nenciarini
2026-04-08 19:33 ` Sakari Ailus
2026-05-05 12:19 ` Marco Nenciarini
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=ac44b9UAjbSbi8-4@spark.kcore.it \
--to=mnencia@kcore.it \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.