[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180718142414.1cab5d98b1f4b01102cd429a@linux-foundation.org>
Date: Wed, 18 Jul 2018 14:24:14 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Coly Li <colyli@...e.de>
Cc: linux-kernel@...r.kernel.org, linux-bcache@...r.kernel.org,
linux-block@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Kate Stewart <kstewart@...uxfoundation.org>,
Randy Dunlap <rdunlap@...radead.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Noah Massey <noah.massey@...il.com>
Subject: Re: [PATCH v4 3/3] lib/test_crc: Add test cases for crc calculation
On Thu, 19 Jul 2018 00:55:45 +0800 Coly Li <colyli@...e.de> wrote:
> This patch adds a kernel module to test the consistency of multiple crc
> calculation in Linux kernel. It is enabled with CONFIG_TEST_CRC enabled.
>
> The test results are printed into kernel message, which look like,
>
> test_crc: crc64_be: FAILED (0x03d4d0d85685d9a1, expected 0x3d4d0d85685d9a1f)
>
> kernel 0day system has framework to check kernel message, then the above
> result can be handled by 0day system. If crc calculation inconsistency
> happens, it can be detected quite soon.
>
> lib/test_crc.c is a testing frame work for many crc consistency
> testings. For now, there is only one test caes for crc64_be().
Some tweaks.
From: Andrew Morton <akpm@...ux-foundation.org>
Subject: lib-test_crc-add-test-cases-for-crc-calculation-fix
make two globals static, regularize code layout, remove unneeded initialization
Cc: Coly Li <colyli@...e.de>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---
lib/test_crc.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff -puN lib/test_crc.c~lib-test_crc-add-test-cases-for-crc-calculation-fix lib/test_crc.c
--- a/lib/test_crc.c~lib-test_crc-add-test-cases-for-crc-calculation-fix
+++ a/lib/test_crc.c
@@ -25,8 +25,8 @@ struct crc_test_record {
void (*handler)(struct crc_test_record *rec);
};
-int failed_tests;
-int total_tests;
+static int failed_tests;
+static int total_tests;
static void chk_and_msg(const char *name, u64 crc, u64 expval)
{
@@ -68,9 +68,6 @@ static int __init test_crc_init(void)
{
int i;
- failed_tests = 0;
- total_tests = 0;
-
pr_info("Kernel CRC consistency testing:\n");
for (i = 0; test_data[i].name; i++)
test_data[i].handler(&test_data[i]);
@@ -85,7 +82,9 @@ static int __init test_crc_init(void)
}
late_initcall(test_crc_init);
-static void __exit test_crc_exit(void) { }
+static void __exit test_crc_exit(void)
+{
+}
module_exit(test_crc_exit);
MODULE_DESCRIPTION("CRC consistency testing driver");
_
Powered by blists - more mailing lists