From: Thorsten Blum <thorsten.blum@linux.dev>
To: Leon Romanovsky <leon@kernel.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] RDMA/mlx5: Use clamp() in _mlx5r_umr_zap_mkey()
Date: Tue, 10 Mar 2026 20:30:02 +0100 [thread overview]
Message-ID: <8CF104A4-D411-4C7E-8379-F41055B0EBD9@linux.dev> (raw)
In-Reply-To: <20260310184744.GI12611@unreal>
On 10. Mar 2026, at 19:47, Leon Romanovsky wrote:
> On Tue, Mar 10, 2026 at 03:57:28PM +0100, Thorsten Blum wrote:
>> Replace min(max()) with clamp(). No functional change.
>
> Are you certain about that?
> For the values to match, page_shift must be guaranteed to remain
> less or equal than max_log_size.
Yeah sorry, I didn't realize this conversion isn't straightforward.
I also just realized that clamp() is defined with if/else semantics in
linux/minmax.h, but uses min(max()) in tools/include/linux/kernel.h,
which seems confusing to me.
Nonetheless, in this case it doesn't seem safe to replace min(max())
with clamp(), and I've learned something today. Thanks for catching it,
and please drop this patch.
next prev parent reply other threads:[~2026-03-10 19:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 14:57 Thorsten Blum
2026-03-10 18:47 ` Leon Romanovsky
2026-03-10 19:30 ` Thorsten Blum [this message]
2026-03-10 21:24 ` David Laight
2026-03-11 8:32 ` Leon Romanovsky
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=8CF104A4-D411-4C7E-8379-F41055B0EBD9@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
/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
all inboxes | Powered by JetHome®