The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Mark Brown <broonie@kernel.org>
Cc: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
	Richard Fitzgerald <rf@opensource.cirrus.com>,
	Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regcache: Use a consistent sort for defaults table
Date: Thu, 6 Aug 2026 09:46:46 +0100	[thread overview]
Message-ID: <anRJ9lkzScVpNTUe@opensource.cirrus.com> (raw)
In-Reply-To: <20260805-regmap-regcache-sort-v1-1-162186aad8b9@kernel.org>

On Wed, Aug 05, 2026 at 06:51:00PM +0100, Mark Brown wrote:
> When we look up registers in the defaults table we use a binary search,
> and we have a regcache_sort_defaults() API to help drivers that constuct
> their defaults tables on the fly.  Unfortunately the lookup and the sort
> don't use the same comparison function, and to make matters worse the
> comparison function used during lookups is written for signed register
> numbers rather than the unsigned ones we actually have so can produce
> suprising results when some of the addresses have the top bit set.
> 
> Standardise on the more explicitly coded function to ensure consistent
> results.
> 
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

  parent reply	other threads:[~2026-08-06  8:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-05 17:51 [PATCH] regcache: Use a consistent sort for defaults table Mark Brown
2026-08-06  8:23 ` Péter Ujfalusi
2026-08-06  8:46 ` Charles Keepax [this message]
2026-08-06 12:00 ` Mark Brown

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=anRJ9lkzScVpNTUe@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=rf@opensource.cirrus.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