Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp60865imk; Sat, 2 Jul 2022 11:49:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1txyeQ/eQM9j50PD6yWkloWmh3i7pkpipxM2NAtTy9NqYo7Y+aaTHN+JL6+dOyL6FZ6tzkQ X-Received: by 2002:a17:906:1c5:b0:715:7c69:870e with SMTP id 5-20020a17090601c500b007157c69870emr20626704ejj.348.1656787749412; Sat, 02 Jul 2022 11:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656787749; cv=none; d=google.com; s=arc-20160816; b=Whq8Ekd7BFw4ASyDzPje+4JsB8S1uK+WtI+rIfVvmtjKesgk4/6JHMwibapHLiNJB1 qQRkZFuR/c9QNpj5yzBsWvKntQ7j+xuNi/XXAqNnQl0UR1Qkdw69EV99plJI7PkyyAsH MZn1SvIyZ9XI5agimQi/1xbf0rtQVwdEpmTLXJX7867nLzZLwZbvT6PSHvF6GguusiD/ Dfbti1OdffiPGB1/IWmtDLCujrmbnKmB8uLppk8tJFEEEFha+UzNurc2FvGj80nAH2k4 aLzS/9ZlihAgmi2kKiv1gn8mkEBy63ZLujlcvcTXFg4GcUkN98y3jpuY03o0SJ1UdmV8 fuTQ== 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=JpnOI5OUTVvNtD6GZsJ4yYH6888UZ+ZoOzd4bxVVX1c=; b=qtIQdn6Tscn+ozwg56O4w2xEkvae/VPKGB+7jhTRObKzxDIF0Z4ltjE8ColFi6RRrY j8mSmwNwDZUi3T8pGqosJgmpY/Z/tMVeBvNnNAYnbI4CrDMbQjZhhSqSPZOqh3R68EXJ 1GIPdJ/fPxa6BTS+ZT52txbsAnreLXxA0y7Gm7y26j4SoFRBER5vXIHNf8qxDqflKs+A 9gnBGJ3F6rw5ZgE18ZvsPaUUoos7jlqqqzKlpXK07HH2CWDwOM5tJFb7MTPPWpafv6B+ Q1NhleKK2Lx3DBt6i65jezPUWZC8hzJI0MwxSqnLeIGzta2rzrTCC8u6hJAC453SzmNl Xt3Q== 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 jw7-20020a17090776a700b006fea42b2e6fsi16284275ejc.642.2022.07.02.11.48.31; Sat, 02 Jul 2022 11:49:09 -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 S232542AbiGBS3v (ORCPT + 99 others); Sat, 2 Jul 2022 14:29:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232540AbiGBS3t (ORCPT ); Sat, 2 Jul 2022 14:29:49 -0400 Received: from smtp.smtpout.orange.fr (smtp03.smtpout.orange.fr [80.12.242.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70C69DED2 for ; Sat, 2 Jul 2022 11:29:48 -0700 (PDT) Received: from pop-os.home ([90.11.190.129]) by smtp.orange.fr with ESMTPA id 7hsIoTjZy4Ltq7hsIonixx; Sat, 02 Jul 2022 20:29:46 +0200 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sat, 02 Jul 2022 20:29:46 +0200 X-ME-IP: 90.11.190.129 From: Christophe JAILLET To: agk@redhat.com, snitzer@kernel.org, dm-devel@redhat.com, vneethv@linux.ibm.com, oberpar@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, almaz.alexandrovich@paragon-software.com, yury.norov@gmail.com, andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk Cc: linux-s390@vger.kernel.org, ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 4/4] bitmap: Use bitmap_size() Date: Sat, 2 Jul 2022 20:29:44 +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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Simplify code and take advantage of the new bitmap_size() function. Signed-off-by: Christophe JAILLET --- include/linux/bitmap.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index f66fb98a4126..668b47c1e5de 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h @@ -243,21 +243,18 @@ extern int bitmap_print_list_to_buf(char *buf, const unsigned long *maskp, static inline void bitmap_zero(unsigned long *dst, unsigned int nbits) { - unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); - memset(dst, 0, len); + memset(dst, 0, bitmap_size(nbits)); } static inline void bitmap_fill(unsigned long *dst, unsigned int nbits) { - unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); - memset(dst, 0xff, len); + memset(dst, 0xff, bitmap_size(nbits)); } static inline void bitmap_copy(unsigned long *dst, const unsigned long *src, unsigned int nbits) { - unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long); - memcpy(dst, src, len); + memcpy(dst, src, bitmap_size(nbits)); } /* -- 2.34.1