From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Coly Li <colyli@suse.de>, linux-kernel@vger.kernel.org
Cc: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Michael Lyle <mlyle@lyle.org>,
Kent Overstreet <kent.overstreet@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
Kate Stewart <kstewart@linuxfoundation.org>
Subject: Re: [PATCH v2 1/3] lib: add crc64 calculation routines
Date: Tue, 17 Jul 2018 12:57:24 +0300 [thread overview]
Message-ID: <4a25d281a0e7f622872f1e9fe3abf44288ec87e4.camel@linux.intel.com> (raw)
In-Reply-To: <20180717065711.28281-2-colyli@suse.de>
On Tue, 2018-07-17 at 14:57 +0800, Coly Li wrote:
> This patch adds the re-write crc64 calculation routines for Linux
> kernel.
> The CRC64 polynomical arithmetic follows ECMA-182 specification,
> inspired
> by CRC paper of Dr. Ross N. Williams
> (see http://www.ross.net/crc/download/crc_v3.txt) and other public
> domain
> implementations.
>
> All the changes work in this way,
> - When Linux kernel is built, host program lib/gen_crc64table.c will
> be
> compiled to lib/gen_crc64table and executed.
> - The output of gen_crc64table execution is an array called as lookup
> table (a.k.a POLY 0x42f0e1eba9ea369) which contain 256 64bits-long
> numbers, this talbe is dumped into header file lib/crc64table.h.
> - Then the header file is included by lib/crc64.c for normal 64bit crc
> calculation.
> - Function declaration of the crc64 calculation routines is placed in
> include/linux/crc64.h
> + * crc64.h
> + *
Do we need file name in the file?
> + * See lib/crc64.c for the related specification and polynomical
> arithmetic.
> + */
> +// SPDX-License-Identifier: GPL-2.0
> +#include <linux/module.h>
> +#include <uapi/linux/types.h>
Why not simple linux/types.h ?
> +#include "crc64table.h"
> +
> +MODULE_DESCRIPTION("CRC64 calculations");
> +MODULE_LICENSE("GPL");
License mismatch with SPDX.
> +#include <inttypes.h>
> +#include <linux/swab.h>
> +#include <stdio.h>
I would follow the common grouping of the headers, like more generic
first, more particular last:
inttupes
stdio
linux/foo
asm/bar
> +#include "../usr/include/asm/byteorder.h"
Hmm...
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2018-07-17 9:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-17 6:57 [PATCH 0/4] add crc64 calculation as kernel library Coly Li
2018-07-17 6:57 ` [PATCH v2 1/3] lib: add crc64 calculation routines Coly Li
2018-07-17 9:57 ` Andy Shevchenko [this message]
2018-07-17 14:19 ` Coly Li
2018-07-17 16:27 ` kbuild test robot
2018-07-17 6:57 ` [PATCH v2 2/3] bcache: use routines from lib/crc64.c for CRC64 calculation Coly Li
2018-07-17 6:57 ` [PATCH v2 3/3] lib/test_crc: Add test cases for crc calculation Coly Li
2018-07-17 7:32 ` Andy Shevchenko
2018-07-17 14:21 ` 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=4a25d281a0e7f622872f1e9fe3abf44288ec87e4.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=colyli@suse.de \
--cc=gregkh@linuxfoundation.org \
--cc=kent.overstreet@gmail.com \
--cc=kstewart@linuxfoundation.org \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mlyle@lyle.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).