From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C1B8C2BA80 for ; Tue, 7 Apr 2020 03:10:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 474DD206B8 for ; Tue, 7 Apr 2020 03:10:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="dss4Oqwh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 474DD206B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E97E58E007F; Mon, 6 Apr 2020 23:10:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E4C4C8E0062; Mon, 6 Apr 2020 23:10:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D63318E007F; Mon, 6 Apr 2020 23:10:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0223.hostedemail.com [216.40.44.223]) by kanga.kvack.org (Postfix) with ESMTP id B86078E0062 for ; Mon, 6 Apr 2020 23:10:30 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 86E4CA8CF for ; Tue, 7 Apr 2020 03:10:30 +0000 (UTC) X-FDA: 76679581020.04.tin68_46b667b16337 X-HE-Tag: tin68_46b667b16337 X-Filterd-Recvd-Size: 2553 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Tue, 7 Apr 2020 03:10:30 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5716820769; Tue, 7 Apr 2020 03:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586229029; bh=ajH8tI5c7Bct/Mk5g1WQJOw4rofFT2voajNeU6GDqtc=; h=Date:From:To:Subject:In-Reply-To:From; b=dss4OqwhJaP6+Wpfx5vcF2jWCW/TErrba9tqwR1ZFnB/bQdJ5S9La9vOKNBi/UPco RQ1bqHQpAspEjc5KFC4JiwwL/0uzRHEvv7S/eZewzwvwwU5y+5OdIjPzGB1wi5DkEH nTDtCMm3oqclfie8NWzfwEdbI/Diyq95EF6Mis7g= Date: Mon, 06 Apr 2020 20:10:28 -0700 From: Andrew Morton To: akpm@linux-foundation.org, alex.shi@linux.alibaba.com, andriy.shevchenko@linux.intel.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 121/166] lib/test_bitmap.c: make use of EXP2_IN_BITS Message-ID: <20200407031028.9qhqTSYVb%akpm@linux-foundation.org> In-Reply-To: <20200406200254.a69ebd9e08c4074e41ddebaf@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Andy Shevchenko Subject: lib/test_bitmap.c: make use of EXP2_IN_BITS Commit 30544ed5de43 ("lib/bitmap: introduce bitmap_replace() helper") introduced some new test cases to the test_bitmap.c module. Among these it also introduced an (unused) definition. Let's make use of EXP2_IN_BITS. Link: http://lkml.kernel.org/r/20200121151847.75223-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Reported-by: Alex Shi Reviewed-by: Alex Shi Signed-off-by: Andrew Morton --- lib/test_bitmap.c | 2 ++ 1 file changed, 2 insertions(+) --- a/lib/test_bitmap.c~lib-test_bitmap-make-use-of-exp2_in_bits +++ a/lib/test_bitmap.c @@ -278,6 +278,8 @@ static void __init test_replace(void) unsigned int nlongs = DIV_ROUND_UP(nbits, BITS_PER_LONG); DECLARE_BITMAP(bmap, 1024); + BUILD_BUG_ON(EXP2_IN_BITS < nbits * 2); + bitmap_zero(bmap, 1024); bitmap_replace(bmap, &exp2[0 * nlongs], &exp2[1 * nlongs], exp2_to_exp3_mask, nbits); expect_eq_bitmap(bmap, exp3_0_1, nbits); _