All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: "Pali Rohár" <pali@kernel.org>, "Simon Glass" <sjg@chromium.org>,
	"Bin Meng" <bmeng.cn@gmail.com>,
	"Adrian Fiergolski" <adrian.fiergolski@fastree3d.com>,
	"Marek Behún" <marek.behun@nic.cz>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH 1/5] crc16-ccitt: Rename file with CRC-16-CCITT implementation to crc16-ccitt.c
Date: Thu, 21 Apr 2022 16:34:45 +0200	[thread overview]
Message-ID: <c905ef77-338f-f214-e54c-248d27781359@denx.de> (raw)
In-Reply-To: <20220412092044.25133-2-pali@kernel.org>

On 4/12/22 11:20, Pali Rohár wrote:
> U-Boot CRC-16 implementation uses polynomial x^16 + x^12 + x^5 + 1 which is
> not standard CRC-16 algorithm, but it is known as CRC-16-CCITT. Rename file
> crc16.c to crc16-ccitt.c to reduce confusion.
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

> ---
>   include/u-boot/crc.h           | 2 +-
>   lib/Makefile                   | 8 ++++----
>   lib/{crc16.c => crc16-ccitt.c} | 2 +-
>   tools/Makefile                 | 2 +-
>   4 files changed, 7 insertions(+), 7 deletions(-)
>   rename lib/{crc16.c => crc16-ccitt.c} (99%)
> 
> diff --git a/include/u-boot/crc.h b/include/u-boot/crc.h
> index 52ec6a9e2d4b..eba8edfb4f31 100644
> --- a/include/u-boot/crc.h
> +++ b/include/u-boot/crc.h
> @@ -25,7 +25,7 @@
>    */
>   unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len);
>   
> -/* lib/crc16.c - 16 bit CRC with polynomial x^16+x^12+x^5+1 (CRC-CCITT) */
> +/* lib/crc16-ccitt.c - 16 bit CRC with polynomial x^16+x^12+x^5+1 (CRC-CCITT) */
>   uint16_t crc16_ccitt(uint16_t crc_start, const unsigned char *s, int len);
>   /**
>    * crc16_ccitt_wd_buf - Perform CRC16-CCIT on an input buffer and return the
> diff --git a/lib/Makefile b/lib/Makefile
> index 11b03d1cbec8..b4f03cc149d3 100644
> --- a/lib/Makefile
> +++ b/lib/Makefile
> @@ -37,7 +37,7 @@ obj-$(CONFIG_CIRCBUF) += circbuf.o
>   endif
>   
>   obj-y += crc8.o
> -obj-y += crc16.o
> +obj-y += crc16-ccitt.o
>   obj-$(CONFIG_ERRNO_STR) += errno_str.o
>   obj-$(CONFIG_FIT) += fdtdec_common.o
>   obj-$(CONFIG_TEST_FDTDEC) += fdtdec_test.o
> @@ -90,9 +90,9 @@ obj-$(CONFIG_$(SPL_TPL_)OF_LIBFDT) += libfdt/
>   obj-$(CONFIG_$(SPL_TPL_)OF_REAL) += fdtdec_common.o fdtdec.o
>   
>   ifdef CONFIG_SPL_BUILD
> -obj-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16.o
> -obj-$(CONFIG_$(SPL_TPL_)HASH) += crc16.o
> -obj-$(CONFIG_MMC_SPI_CRC_ON) += crc16.o
> +obj-$(CONFIG_SPL_YMODEM_SUPPORT) += crc16-ccitt.o
> +obj-$(CONFIG_$(SPL_TPL_)HASH) += crc16-ccitt.o
> +obj-$(CONFIG_MMC_SPI_CRC_ON) += crc16-ccitt.o
>   obj-y += net_utils.o
>   endif
>   obj-$(CONFIG_ADDR_MAP) += addr_map.o
> diff --git a/lib/crc16.c b/lib/crc16-ccitt.c
> similarity index 99%
> rename from lib/crc16.c
> rename to lib/crc16-ccitt.c
> index f46ba727c9a8..6cadbc103d3e 100644
> --- a/lib/crc16.c
> +++ b/lib/crc16-ccitt.c
> @@ -2,7 +2,7 @@
>   /*
>    *==========================================================================
>    *
> - *      crc16.c
> + *      crc16-ccitt.c
>    *
>    *      16 bit CRC with polynomial x^16+x^12+x^5+1
>    *
> diff --git a/tools/Makefile b/tools/Makefile
> index 60231c728ceb..852dc638f418 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -131,7 +131,7 @@ dumpimage-mkimage-objs := aisimage.o \
>   			$(ROCKCHIP_OBS) \
>   			socfpgaimage.o \
>   			sunxi_egon.o \
> -			lib/crc16.o \
> +			lib/crc16-ccitt.o \
>   			lib/hash-checksum.o \
>   			lib/sha1.o \
>   			lib/sha256.o \

Viele Grüße,
Stefan Roese

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de

  reply	other threads:[~2022-04-21 14:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12  9:20 [PATCH 0/5] crc16: Remove duplicate implementations Pali Rohár
2022-04-12  9:20 ` [PATCH 1/5] crc16-ccitt: Rename file with CRC-16-CCITT implementation to crc16-ccitt.c Pali Rohár
2022-04-21 14:34   ` Stefan Roese [this message]
2022-04-21 23:56   ` Tom Rini
2022-04-12  9:20 ` [PATCH 2/5] crc16: Rename fs/ubifs/crc16.h to include/linux/crc16.h Pali Rohár
2022-04-21 14:34   ` Stefan Roese
2022-04-21 23:56   ` Tom Rini
2022-04-12  9:20 ` [PATCH 3/5] crc16: Move standard CRC-16 implementation from ubifs to lib Pali Rohár
2022-04-21 14:35   ` Stefan Roese
2022-04-21 23:57   ` Tom Rini
2022-04-12  9:20 ` [PATCH 4/5] fs: ext4: Use CRC-16 implementation from linux/crc16.h Pali Rohár
2022-04-21 14:35   ` Stefan Roese
2022-04-21 23:57   ` Tom Rini
2022-04-12  9:20 ` [PATCH 5/5] misc: atsha204a: Remove duplicate CRC-16 implementation Pali Rohár
2022-04-21 14:35   ` Stefan Roese
2022-04-21 23:57   ` Tom Rini

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=c905ef77-338f-f214-e54c-248d27781359@denx.de \
    --to=sr@denx.de \
    --cc=adrian.fiergolski@fastree3d.com \
    --cc=bmeng.cn@gmail.com \
    --cc=marek.behun@nic.cz \
    --cc=pali@kernel.org \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.