diff options
author | Shiraz Saleem <shiraz.saleem@intel.com> | 2017-12-22 16:46:55 +0100 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2017-12-22 21:37:51 +0100 |
commit | 8758768ad8aa9fc0d56417315dec65b610fc3a21 (patch) | |
tree | 1116f92251be999cd39cfc5e9dd856feabd02484 /drivers/infiniband/hw/i40iw/i40iw_cm.c | |
parent | i40iw: Set MAX_IRD_SIZE to 64 (diff) | |
download | linux-8758768ad8aa9fc0d56417315dec65b610fc3a21.tar.xz linux-8758768ad8aa9fc0d56417315dec65b610fc3a21.zip |
i40iw: Use utility function roundup_pow_of_two()
Consolidate all power of 2 round calculations to
use kernel utility function roundup_pow_of_two().
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/i40iw/i40iw_cm.c')
-rw-r--r-- | drivers/infiniband/hw/i40iw/i40iw_cm.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw_cm.c b/drivers/infiniband/hw/i40iw/i40iw_cm.c index 493d6ef3d2d5..03e6fc67d955 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_cm.c +++ b/drivers/infiniband/hw/i40iw/i40iw_cm.c @@ -92,14 +92,9 @@ void i40iw_free_sqbuf(struct i40iw_sc_vsi *vsi, void *bufp) static u8 i40iw_derive_hw_ird_setting(u16 cm_ird) { u8 encoded_ird_size; - u8 pof2_cm_ird = 1; - - /* round-off to next powerof2 */ - while (pof2_cm_ird < cm_ird) - pof2_cm_ird *= 2; /* ird_size field is encoded in qp_ctx */ - switch (pof2_cm_ird) { + switch (cm_ird ? roundup_pow_of_two(cm_ird) : 0) { case I40IW_HW_IRD_SETTING_64: encoded_ird_size = 3; break; |