Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp720964imw; Fri, 8 Jul 2022 10:26:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sAaW3FhaQYCxc5HqnPw2hVzrhgLA3llyIKOJrDdWDaDA9fGUM6CdRDIupQyU+Dnh8sg6XM X-Received: by 2002:a17:903:32c4:b0:16a:4201:45e4 with SMTP id i4-20020a17090332c400b0016a420145e4mr4822557plr.108.1657301218968; Fri, 08 Jul 2022 10:26:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657301218; cv=none; d=google.com; s=arc-20160816; b=JE0/JQOQREyh4DhXgYHckiYZITM3kzsuJSuqQsvwHuKwh7sJb+UQODCmVQrUnPWIQW S4yX6lFyYXKx4aP0ak6gN7pgEyfYWKqgvC0YC4uxrY3+mL27jdEc41N1MvbUODLTCXnX uUI87SdqbkwMb2G+SWij7motb7NNMLCfQBRrv+SRgkQpuFP8VrSPStKhSenIuSPF/lm0 3GFR58fNIGbVLxzNkg0Zk15+hn9ndhGFXkBQRqn8eFzNRHOMnc8NK/z3YWTypBn8nUFs MuH2mrFF0ie1vJwWegIYBuJAk7xpu2pWsHfnehQCM0Ixm+Xk29OJyRNWVX8BmCPAnGsz n0iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GC+NjArXCJZqErO0kPXAsJHyZH/x60vWzhzzAxN8T3Y=; b=cbdDVvhfn6mMo29QDhWoZXVNrn1wD6mloz0sTVz2cXmn4wp80lNgGUNW47dyLWFD2X XOsMPF+2kMtDHn9Gs3SAuI0fda8NxGZtjxwp4vzV1wyv3pHKt/wP/qewZZHtYhWd7RYL Qbk0mC9+iTni4lmmGWfmgJRU4T9Kc6aAIX7b7xoKrIA4639IRHL5lgFojKf/rMLJvlIR B2uciYdpSemUmbztJ/cNOIE37vnBCsrOTD2+VFBcWPG5ikt6r8JD5JCrBj5oesfOCpSp 7nebs+ZcpDgVa9adjOr4YIvv/QydIqc/eCMBZfJDVtFuhAXnVs6SucFhxCbRNXF7eswg 9/Rw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b2-20020a17090a990200b001e8927db60bsi3018201pjp.73.2022.07.08.10.26.46; Fri, 08 Jul 2022 10:26:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238200AbiGHQrn (ORCPT + 99 others); Fri, 8 Jul 2022 12:47:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238732AbiGHQrl (ORCPT ); Fri, 8 Jul 2022 12:47:41 -0400 Received: from smtp.smtpout.orange.fr (smtp06.smtpout.orange.fr [80.12.242.128]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E84E73920 for ; Fri, 8 Jul 2022 09:47:41 -0700 (PDT) Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id 9r8kojI1ym7vs9r8loGHRC; Fri, 08 Jul 2022 18:47:39 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Fri, 08 Jul 2022 18:47:39 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: "Md. Haris Iqbal" , Jack Wang , Jason Gunthorpe , Leon Romanovsky Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-rdma@vger.kernel.org Subject: [PATCH 2/2] RDMA/rtrs-clt: Use bitmap_empty() Date: Fri, 8 Jul 2022 18:47:37 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00, RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use bitmap_empty() instead of hand-writing them. Signed-off-by: Christophe JAILLET --- 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