From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D2B2DC433F5 for ; Thu, 21 Apr 2022 14:35:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A7F7183DA7; Thu, 21 Apr 2022 16:35:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1650551722; bh=mRErLh9TrvIcClzesRoXvBEDTXI16ojZMVTxk5WpWmQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=iFVIvUJbW2kFMesQUlYCXTpYoH2PWHmpOWD6XZUY1W01NPwjZvlHfnrPWSlHvWf6Q sF47Zx482AmSl9vnBuEkAGufWN5WzxKSH0JB7fPGakDC3xTXCJA5rdeLOVY+hR8pzA dse+g8EnResVX98U+BFqoEaoaDPvPBqvdGdwNYJMnI2+L1Zloqohwg1aF9Dbn3oNqA SZ7NiLgLatfLaLocaFmVXTIOkyavvIRY6GH9lqi86q5hsZIl9PldFoAxXtxf16RJNy KMYhfCjVFgbSo6JUqGgJUnoUGZE57joOADWLabmnZ2g4p/tdO+wZOLP1DUIGXB49hs 96xknOfY/0pfA== Received: by phobos.denx.de (Postfix, from userid 109) id 8CA5383DB0; Thu, 21 Apr 2022 16:35:15 +0200 (CEST) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:101:465::204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EC61B83D62 for ; Thu, 21 Apr 2022 16:35:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp202.mailbox.org (smtp202.mailbox.org [80.241.60.245]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4Kkg7262mnz9sRx; Thu, 21 Apr 2022 16:35:10 +0200 (CEST) Message-ID: <57d56748-7573-be0c-f642-4f585795ae6d@denx.de> Date: Thu, 21 Apr 2022 16:35:07 +0200 MIME-Version: 1.0 Subject: Re: [PATCH 3/5] crc16: Move standard CRC-16 implementation from ubifs to lib Content-Language: en-US To: =?UTF-8?Q?Pali_Roh=c3=a1r?= , Simon Glass , Bin Meng , Adrian Fiergolski , =?UTF-8?Q?Marek_Beh=c3=ban?= Cc: u-boot@lists.denx.de References: <20220412092044.25133-1-pali@kernel.org> <20220412092044.25133-4-pali@kernel.org> From: Stefan Roese In-Reply-To: <20220412092044.25133-4-pali@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On 4/12/22 11:20, Pali Rohár wrote: > This implementation provides standard CRC-16 algorithm with polynomial > x^16 + x^15 + x^2 + 1. > > Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese Thanks, Stefan > --- > fs/ubifs/Makefile | 2 +- > include/u-boot/crc.h | 3 +++ > lib/Makefile | 1 + > {fs/ubifs => lib}/crc16.c | 0 > 4 files changed, 5 insertions(+), 1 deletion(-) > rename {fs/ubifs => lib}/crc16.c (100%) > > diff --git a/fs/ubifs/Makefile b/fs/ubifs/Makefile > index 64d64472945e..631ba5f438cf 100644 > --- a/fs/ubifs/Makefile > +++ b/fs/ubifs/Makefile > @@ -9,5 +9,5 @@ > > obj-y := ubifs.o io.o super.o sb.o master.o lpt.o > obj-y += lpt_commit.o scan.o lprops.o > -obj-y += tnc.o tnc_misc.o debug.o crc16.o budget.o > +obj-y += tnc.o tnc_misc.o debug.o budget.o > obj-y += log.o orphan.o recovery.o replay.o gc.o > diff --git a/include/u-boot/crc.h b/include/u-boot/crc.h > index eba8edfb4f31..5174bd7ac413 100644 > --- a/include/u-boot/crc.h > +++ b/include/u-boot/crc.h > @@ -25,6 +25,9 @@ > */ > unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len); > > +/* lib/crc16.c - 16 bit CRC with polynomial x^16 + x^15 + x^2 + 1 */ > +uint16_t crc16(uint16_t crc, const unsigned char *buffer, size_t len); > + > /* 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); > /** > diff --git a/lib/Makefile b/lib/Makefile > index b4f03cc149d3..0d0261b8986f 100644 > --- a/lib/Makefile > +++ b/lib/Makefile > @@ -37,6 +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 > diff --git a/fs/ubifs/crc16.c b/lib/crc16.c > similarity index 100% > rename from fs/ubifs/crc16.c > rename to lib/crc16.c 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