diff mbox series

[U-Boot,1/2] lib: Kconfig: Move DYNAMIC_CRC_TABLE to Kconfig

Message ID 1517924759-19297-2-git-send-email-faiz_abbas@ti.com
State Accepted
Commit 36c1877c5c28dd515ad90d3a6b78f1797d80636e
Delegated to: Tom Rini
Headers show
Series Add DYNAMIC_CRC_TABLE to am335x_evm | expand

Commit Message

Faiz Abbas Feb. 6, 2018, 1:45 p.m. UTC
Add CONFIG prefix to DYNAMIC_CRC_TABLE and implement it in
Kconfig.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
---
 lib/Kconfig | 6 ++++++
 lib/crc32.c | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

Comments

Tom Rini Feb. 15, 2018, 12:19 p.m. UTC | #1
On Tue, Feb 06, 2018 at 07:15:58PM +0530, Faiz Abbas wrote:

> Add CONFIG prefix to DYNAMIC_CRC_TABLE and implement it in
> Kconfig.
> 
> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/lib/Kconfig b/lib/Kconfig
index 710deb7..f76656b 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -15,6 +15,12 @@  config CC_OPTIMIZE_LIBS_FOR_SPEED
 
 	  If unsure, say N.
 
+config DYNAMIC_CRC_TABLE
+	bool "Enable Dynamic tables for CRC"
+	help
+	  Enable this option to calculate entries for CRC tables at runtime.
+	  This can be helpful when reducing the size of the build image
+
 config HAVE_PRIVATE_LIBGCC
 	bool
 
diff --git a/lib/crc32.c b/lib/crc32.c
index 9759212..7f545fd 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -26,7 +26,7 @@ 
 
 #define tole(x) cpu_to_le32(x)
 
-#ifdef DYNAMIC_CRC_TABLE
+#ifdef CONFIG_DYNAMIC_CRC_TABLE
 
 local int crc_table_empty = 1;
 local uint32_t crc_table[256];
@@ -157,7 +157,7 @@  tole(0xb40bbe37L), tole(0xc30c8ea1L), tole(0x5a05df1bL), tole(0x2d02ef8dL)
  */
 const uint32_t * ZEXPORT get_crc_table()
 {
-#ifdef DYNAMIC_CRC_TABLE
+#ifdef CONFIG_DYNAMIC_CRC_TABLE
   if (crc_table_empty) make_crc_table();
 #endif
   return (const uint32_t *)crc_table;
@@ -181,7 +181,7 @@  uint32_t ZEXPORT crc32_no_comp(uint32_t crc, const Bytef *buf, uInt len)
     const uint32_t *tab = crc_table;
     const uint32_t *b =(const uint32_t *)buf;
     size_t rem_len;
-#ifdef DYNAMIC_CRC_TABLE
+#ifdef CONFIG_DYNAMIC_CRC_TABLE
     if (crc_table_empty)
       make_crc_table();
 #endif