From: Andrew Morton <akpm@linux-foundation.org>
To: Coly Li <colyli@suse.de>
Cc: linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org,
linux-block@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Kate Stewart <kstewart@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Noah Massey <noah.massey@gmail.com>
Subject: Re: [PATCH v4 3/3] lib/test_crc: Add test cases for crc calculation
Date: Wed, 18 Jul 2018 14:24:14 -0700 [thread overview]
Message-ID: <20180718142414.1cab5d98b1f4b01102cd429a@linux-foundation.org> (raw)
In-Reply-To: <20180718165545.1622-4-colyli@suse.de>
On Thu, 19 Jul 2018 00:55:45 +0800 Coly Li <colyli@suse.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@linux-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@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-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");
_
next prev parent reply other threads:[~2018-07-18 21:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-18 16:55 [PATCH v4 0/3] add crc64 calculation as kernel library Coly Li
2018-07-18 16:55 ` [PATCH v4 1/3] lib: add crc64 calculation routines Coly Li
2018-07-24 4:26 ` Eric Biggers
2018-07-24 16:29 ` Coly Li
2018-07-24 17:06 ` Andy Shevchenko
2018-07-25 2:37 ` Coly Li
2018-07-25 21:22 ` Andrew Morton
2018-07-26 3:28 ` Coly Li
2018-07-18 16:55 ` [PATCH v4 2/3] bcache: use routines from lib/crc64.c for CRC64 calculation Coly Li
2018-07-18 16:55 ` [PATCH v4 3/3] lib/test_crc: Add test cases for crc calculation Coly Li
2018-07-18 21:24 ` Andrew Morton [this message]
2018-07-24 4:44 ` Eric Biggers
2018-07-24 16:28 ` Coly Li
2018-07-24 17:39 ` Eric Biggers
2018-07-25 4:07 ` Coly Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180718142414.1cab5d98b1f4b01102cd429a@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=colyli@suse.de \
--cc=gregkh@linuxfoundation.org \
--cc=kstewart@linuxfoundation.org \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=noah.massey@gmail.com \
--cc=rdunlap@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).