IB/mthca: Use bitmap_zalloc() when applicable
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Wed, 24 Nov 2021 20:40:51 +0000 (21:40 +0100)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 25 Nov 2021 17:29:05 +0000 (13:29 -0400)
commit12d1e2f3c5762df4ad72c75b2464a5b538f12aa9
tree72f759886f675eb62beb76da6a4a92c6fbaef224
parent9c3631d17054a8766dbdc1abf8d29306260e7c7f
IB/mthca: Use bitmap_zalloc() when applicable

Use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid
some open-coded arithmetic in allocator arguments.

Using the 'zalloc' version of the allocator also saves a now useless
'bitmap_zero()' call.

Also change the corresponding 'kfree()' into 'bitmap_free()' to keep
consistency.

Link: https://lore.kernel.org/r/ea9031e28f453bc179033740f66f0c19293fcf0b.1637785902.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/mthca/mthca_allocator.c
drivers/infiniband/hw/mthca/mthca_mr.c