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=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 27258C433E0 for ; Wed, 12 Aug 2020 01:34:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DFAFE2076C for ; Wed, 12 Aug 2020 01:34:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="gNjE2ASA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFAFE2076C 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 856C18D0049; Tue, 11 Aug 2020 21:34:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 82DE48D0001; Tue, 11 Aug 2020 21:34:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 744448D0049; Tue, 11 Aug 2020 21:34:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0125.hostedemail.com [216.40.44.125]) by kanga.kvack.org (Postfix) with ESMTP id 5D4238D0001 for ; Tue, 11 Aug 2020 21:34:40 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 274568248047 for ; Wed, 12 Aug 2020 01:34:40 +0000 (UTC) X-FDA: 77140197120.17.veil22_3c02b9126fe7 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id F1B37180D0181 for ; Wed, 12 Aug 2020 01:34:39 +0000 (UTC) X-HE-Tag: veil22_3c02b9126fe7 X-Filterd-Recvd-Size: 3378 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Wed, 12 Aug 2020 01:34:39 +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 923E02076C; Wed, 12 Aug 2020 01:34:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597196078; bh=LhRAmPDXk6mUhtcOJJMYf7L4ahTxBj52EDFxTwIhKNg=; h=Date:From:To:Subject:In-Reply-To:From; b=gNjE2ASA+Tx1t0RELeDjDSF9f+cuYGgsvNx8qngmDv8WMEAvFyvnaLVIVcKrKfdmU mQ7Rwqhcmmol+zSUqrh1IFAn9fGW9vTkQ7tQ6Nnb9fgLv4Mmu05obVREANew83eR+y PxwRoeZMiM2GlBlpzdyDiwojvNriHwOCmCPNGuhQ= Date: Tue, 11 Aug 2020 18:34:38 -0700 From: Andrew Morton To: akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, geert@linux-m68k.org, jesse.brandeburg@intel.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, richard.weiyang@gmail.com, torvalds@linux-foundation.org Subject: [patch 083/165] lib/test_bitops: do the full test during module init Message-ID: <20200812013438.CqhammgTX%akpm@linux-foundation.org> In-Reply-To: <20200811182949.e12ae9a472e3b5e27e16ad6c@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Queue-Id: F1B37180D0181 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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: Geert Uytterhoeven Subject: lib/test_bitops: do the full test during module init Currently, the bitops test consists of two parts: one part is executed during module load, the second part during module unload. This is cumbersome for the user, as he has to perform two steps to execute all tests, and is different from most (all?) other tests. Merge the two parts, so both are executed during module load. Link: http://lkml.kernel.org/r/20200706112900.7097-1-geert@linux-m68k.org Signed-off-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Cc: Wei Yang Cc: Jesse Brandeburg Signed-off-by: Andrew Morton --- lib/test_bitops.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) --- a/lib/test_bitops.c~lib-test_bitops-do-the-full-test-during-module-init +++ a/lib/test_bitops.c @@ -52,9 +52,9 @@ static unsigned long order_comb_long[][2 static int __init test_bitops_startup(void) { - int i; + int i, bit_set; - pr_warn("Loaded test module\n"); + pr_info("Starting bitops test\n"); set_bit(BITOPS_4, g_bitmap); set_bit(BITOPS_7, g_bitmap); set_bit(BITOPS_11, g_bitmap); @@ -81,12 +81,8 @@ static int __init test_bitops_startup(vo order_comb_long[i][0]); } #endif - return 0; -} -static void __exit test_bitops_unstartup(void) -{ - int bit_set; + barrier(); clear_bit(BITOPS_4, g_bitmap); clear_bit(BITOPS_7, g_bitmap); @@ -98,7 +94,13 @@ static void __exit test_bitops_unstartup if (bit_set != BITOPS_LAST) pr_err("ERROR: FOUND SET BIT %d\n", bit_set); - pr_warn("Unloaded test module\n"); + pr_info("Completed bitops test\n"); + + return 0; +} + +static void __exit test_bitops_unstartup(void) +{ } module_init(test_bitops_startup); _