[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <346998e5-8798-e8f0-ccaa-a9d4810b68f5@infradead.org>
Date: Tue, 17 Jul 2018 09:57:28 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Coly Li <colyli@...e.de>, linux-kernel@...r.kernel.org
Cc: 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>
Subject: Re: [PATCH v3 3/3] lib/test_crc: Add test cases for crc calculation
Hi,
On 07/17/2018 07:55 AM, Coly Li wrote:
> diff --git a/lib/test_crc.c b/lib/test_crc.c
> new file mode 100644
> index 000000000000..441bf835fbd3
> --- /dev/null
> +++ b/lib/test_crc.c
> @@ -0,0 +1,138 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * CRC test driver
> + *
> + * Copyright (C) 2018 Coly Li <colyli@...e.de>
> + *
> +
> +static int __init test_crc_init(void)
> +{
> + int i;
> + int v, err = 0;
> +
> + pr_info("Kernel CRC consitency testing:\n");
consistency
> + for (i = 0; test_data[i].name; i++) {
> + v = test_data[i].handler(&test_data[i]);
> + if (v < 0)
> + err++;
> + }
> +
> + if (err == 0)
> + pr_info("test_crc: all %d tests passed\n", i);
> + else
> + pr_err("test_crc: %d cases tested, %d passed, %d failed\n",
> + i, i - err, err);
> +
> + return (err == 0) ? 0 : -EINVAL;
> +}
--
~Randy
Powered by blists - more mailing lists