irdma: Use round{up,down}_pow_of_two

Use roundup_pow_of_two and rounddown_pow_of_two in place of expressions.

Reviewed by:	alc, markj
Differential Revision:	https://reviews.freebsd.org/D45536
This commit is contained in:
Doug Moore 2024-06-24 02:20:49 -05:00
parent 5fc42387d7
commit 87177ce3aa

View File

@ -4939,7 +4939,7 @@ irdma_cfg_fpm_val(struct irdma_sc_dev *dev, u32 qp_count)
qpwanted = min(qp_count, hmc_info->hmc_obj[IRDMA_HMC_IW_QP].max_cnt);
if (qpwanted != 0)
qpwanted = 1 << ilog2(qpwanted);
qpwanted = rounddown_pow_of_two(qpwanted);
mrwanted = hmc_info->hmc_obj[IRDMA_HMC_IW_MR].max_cnt;
pblewanted = hmc_info->hmc_obj[IRDMA_HMC_IW_PBLE].max_cnt;
@ -4982,7 +4982,7 @@ irdma_cfg_fpm_val(struct irdma_sc_dev *dev, u32 qp_count)
hmc_info->hmc_obj[IRDMA_HMC_IW_MR].cnt = mrwanted;
hte = round_up(qpwanted + hmc_info->hmc_obj[IRDMA_HMC_IW_FSIMC].cnt, 512);
hte = hte == 0 ? 1 : 1 << fls(hte - 1);
hte = roundup_pow_of_two(hte);
hmc_info->hmc_obj[IRDMA_HMC_IW_HTE].cnt =
hte * hmc_fpm_misc->ht_multiplier;
if (dev->hw_attrs.uk_attrs.hw_rev == IRDMA_GEN_1)