Re: [PATCH 2/2] RDMA/rtrs-clt: Use bitmap_empty()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 8, 2022 at 6:47 PM Christophe JAILLET
<christophe.jaillet@xxxxxxxxxx> wrote:
>
> Use bitmap_empty() instead of hand-writing them.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Acked-by: Jack Wang <jinpu.wang@xxxxxxxxx>
Thx!
> ---
>  drivers/infiniband/ulp/rtrs/rtrs-clt.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> index 06c27a3d83f5..8441f0965b56 100644
> --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> @@ -1433,12 +1433,10 @@ static int alloc_permits(struct rtrs_clt_sess *clt)
>
>  static void free_permits(struct rtrs_clt_sess *clt)
>  {
> -       if (clt->permits_map) {
> -               size_t sz = clt->queue_depth;
> -
> +       if (clt->permits_map)
>                 wait_event(clt->permits_wait,
> -                          find_first_bit(clt->permits_map, sz) >= sz);
> -       }
> +                          bitmap_empty(clt->permits_map, clt->queue_depth));
> +
>         bitmap_free(clt->permits_map);
>         clt->permits_map = NULL;
>         kfree(clt->permits);
> --
> 2.34.1
>



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux