From patchwork Fri Nov 8 19:53:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1192133 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="WgMa3Vj6"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 478rnp3kFjz9sP4 for ; Sat, 9 Nov 2019 07:04:14 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 30974C21DA2; Fri, 8 Nov 2019 19:59:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 20AD1C21EBE; Fri, 8 Nov 2019 19:55:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 46F0BC21E6C; Fri, 8 Nov 2019 19:55:10 +0000 (UTC) Received: from mail-il1-f196.google.com (mail-il1-f196.google.com [209.85.166.196]) by lists.denx.de (Postfix) with ESMTPS id 09F5EC21E68 for ; Fri, 8 Nov 2019 19:54:47 +0000 (UTC) Received: by mail-il1-f196.google.com with SMTP id z12so6202209ilp.2 for ; Fri, 08 Nov 2019 11:54:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qguJw/3547FS5ol38caB2ATre6kXs083VfZHdmYrvfw=; b=WgMa3Vj6kVAx9DpSUFrhaO9xKUu3dP7rjIm8m/XPwq1t7LnkF0CWJlVmkEKnV7nAMp w22cBZwCX2THoskDgMwFiKowDvUQ6MIk2XkGtAAc2+CsZM2vpUOZF6OZZvKttg4QWlZ9 5SJ0ATbktGdtRdC86p7FSIY+vG4qtv9q8DMl0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qguJw/3547FS5ol38caB2ATre6kXs083VfZHdmYrvfw=; b=THvgZuGZcTzsJamXu2mSnPObSwLgGlkUTlH/navRWbRenP42fpCIxdMqHSeKGo1pbQ cebNEdNfk7ryEC/W70FwjHSHLkUDUEhgIEDagZBQY/oAcG9j4UTXGiWYQmW7b9/rKwZ5 G7j+8NHCrPqygB+m9i8eO8rsu9WyvxB7pt2oKUAutNrUZZH0CD70Wl9YZQaobjeHIDR8 oEFH4AztoElx4VTIw9IOUD4pORQJrjWuoLErSBLLic6KfdC848OURtH7nbU5I1YV/SxL Z6A78yAhaeH0v/fut1rJCOzCsESeK3AxPN7Loo6irGcyHCh+PLYJjlscY8rB50QL9Q6x V13Q== X-Gm-Message-State: APjAAAWw8K3hWGICLPwcrNZ+Za0xGUuMB4y0at2ZlaCh77oRGBUSY6R2 IbOTY2S5ilCgtCQYUldDTTLRBl/aaq3/0w== X-Google-Smtp-Source: APXvYqxBncm7BgmtKJc97kGwujNEFxAYltgaVAU8Xxw9m3rFM7pa60oNa81JTUdm37C0pBaQqusBhg== X-Received: by 2002:a92:afd5:: with SMTP id v82mr15248447ill.294.1573242885740; Fri, 08 Nov 2019 11:54:45 -0800 (PST) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l205sm622306ill.50.2019.11.08.11.54.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 11:54:45 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Date: Fri, 8 Nov 2019 12:53:13 -0700 Message-Id: <20191108125120.v2.6.I0d4b5d0a27a5f0efe640f67f1cb60d0eb2e3d11d@changeid> X-Mailer: git-send-email 2.24.0.rc1.363.gb1bccd3e3d-goog In-Reply-To: <20191108195348.110648-1-sjg@chromium.org> References: <20191108195348.110648-1-sjg@chromium.org> MIME-Version: 1.0 Cc: Tom Rini Subject: [U-Boot] [PATCH v2 06/41] common: Drop linux/crc8.h X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" We have an existing U-Boot header for the one function that this defines. Use that instead of the linux/ one. Move over the nice comment. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- Changes in v2: None board/theadorable/theadorable.c | 2 +- drivers/tpm/tpm2_tis_sandbox.c | 2 +- drivers/tpm/tpm_tis_sandbox.c | 2 +- include/linux/crc8.h | 23 ----------------------- include/u-boot/crc.h | 14 +++++++++++++- lib/crc8.c | 7 ++++++- 6 files changed, 22 insertions(+), 28 deletions(-) delete mode 100644 include/linux/crc8.h diff --git a/board/theadorable/theadorable.c b/board/theadorable/theadorable.c index d42350319c..2958d5ff88 100644 --- a/board/theadorable/theadorable.c +++ b/board/theadorable/theadorable.c @@ -14,11 +14,11 @@ #include #include #include -#include #include #ifdef CONFIG_NET #include #endif +#include #include "theadorable.h" #include "../drivers/ddr/marvell/axp/ddr3_hw_training.h" diff --git a/drivers/tpm/tpm2_tis_sandbox.c b/drivers/tpm/tpm2_tis_sandbox.c index f282ea6adf..522988795c 100644 --- a/drivers/tpm/tpm2_tis_sandbox.c +++ b/drivers/tpm/tpm2_tis_sandbox.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include /* Hierarchies */ enum tpm2_hierarchy { diff --git a/drivers/tpm/tpm_tis_sandbox.c b/drivers/tpm/tpm_tis_sandbox.c index 3336f559e5..2dff0d3eee 100644 --- a/drivers/tpm/tpm_tis_sandbox.c +++ b/drivers/tpm/tpm_tis_sandbox.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include /* TPM NVRAM location indices. */ #define FIRMWARE_NV_INDEX 0x1007 diff --git a/include/linux/crc8.h b/include/linux/crc8.h deleted file mode 100644 index 0ab5b9ab21..0000000000 --- a/include/linux/crc8.h +++ /dev/null @@ -1,23 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright (c) 2013 Google, Inc - */ - - -#ifndef __linux_crc8_h -#define __linux_crc8_h - -/** - * crc8() - Calculate and return CRC-8 of the data - * - * This uses an x^8 + x^2 + x + 1 polynomial. A table-based algorithm would - * be faster, but for only a few bytes it isn't worth the code size - * - * @crc_start: CRC8 start value - * @vptr: Buffer to checksum - * @len: Length of buffer in bytes - * @return CRC8 checksum - */ -unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len); - -#endif diff --git a/include/u-boot/crc.h b/include/u-boot/crc.h index 788ef29a17..b42bcda2b3 100644 --- a/include/u-boot/crc.h +++ b/include/u-boot/crc.h @@ -8,7 +8,19 @@ #ifndef _UBOOT_CRC_H #define _UBOOT_CRC_H -/* lib/crc8.c */ +/** + * crc8() - Calculate and return CRC-8 of the data + * + * This uses an x^8 + x^2 + x + 1 polynomial. A table-based algorithm would + * be faster, but for only a few bytes it isn't worth the code size + * + * lib/crc8.c + * + * @crc_start: CRC8 start value + * @vptr: Buffer to checksum + * @len: Length of buffer in bytes + * @return CRC8 checksum + */ 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) */ diff --git a/lib/crc8.c b/lib/crc8.c index 55f7c07285..87b87b675b 100644 --- a/lib/crc8.c +++ b/lib/crc8.c @@ -3,7 +3,12 @@ * Copyright (c) 2013 Google, Inc */ -#include "linux/crc8.h" +#ifdef USE_HOSTCC +#include +#else +#include +#endif +#include #define POLY (0x1070U << 3)