ntb: ntb_hw_switchtec: Fix shift-out-of-bounds for 0 mw lut

[ Upstream commit 186615f885 ]

Number of MW LUTs depends on NTB configuration and can be set to zero,
in such scenario rounddown_pow_of_two will cause undefined behaviour and
should not be performed.
This patch ensures that rounddown_pow_of_two is called on valid value.

Signed-off-by: Maciej Grochowski <Maciej.Grochowski@sony.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Maciej Grochowski 2025-02-13 14:53:17 -08:00 • committed by Sasha Levin
commit 2e4d5e8d86