ntb_hw_switchtec: Fix bug with more than 32 partitions
authorWesley Sheng <wesley.sheng@microchip.com>
Fri, 24 Dec 2021 01:23:30 +0000 (17:23 -0800)
committerJon Mason <jdmason@kudzu.us>
Tue, 11 Jan 2022 20:38:59 +0000 (15:38 -0500)
commit7ff351c86b6b258f387502ab2c9b9d04f82c1c3d
tree97c7b1303c10e88cfbe110b4c7df15fe1e8e1258
parent32c3d375b0ed84b6acb51ae5ebef35ff0d649d85
ntb_hw_switchtec: Fix bug with more than 32 partitions

Switchtec could support as mush as 48 partitions, but ffs & fls are
for 32 bit argument, in case of partition index larger than 31, the
current code could not parse the peer partition index correctly.
Change to the 64 bit version __ffs64 & fls64 accordingly to fix this
bug.

Fixes: 3df54c870f52 ("ntb_hw_switchtec: Allow using Switchtec NTB in multi-partition setups")
Signed-off-by: Wesley Sheng <wesley.sheng@microchip.com>
Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/hw/mscc/ntb_hw_switchtec.c