]> www.infradead.org Git - users/hch/misc.git/commit
nvmet: replace max(a, min(b, c)) by clamp(val, lo, hi)
authorLi Haoran <li.haoran7@zte.com.cn>
Thu, 20 Mar 2025 07:53:00 +0000 (15:53 +0800)
committerKeith Busch <kbusch@kernel.org>
Thu, 20 Mar 2025 23:53:56 +0000 (16:53 -0700)
commit64ea88e3afa8c5b6c3f9c477da304b7a56149612
tree56d4491bad015f9a0ee11389921b6285ad323cfe
parent1be52169c3488ef98582ed553ab35cefa3978817
nvmet: replace max(a, min(b, c)) by clamp(val, lo, hi)

This patch replaces max(a, min(b, c)) by clamp(val, lo, hi) in the nvme
driver. The clamp() macro explicitly expresses the intent of constraining
a value within bounds, improving code readability.

Signed-off-by: Li Haoran <li.haoran7@zte.com.cn>
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/target/nvmet.h