]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
lib: Kconfig: Move DYNAMIC_CRC_TABLE to Kconfig
authorFaiz Abbas <faiz_abbas@ti.com>
Tue, 6 Feb 2018 13:45:58 +0000 (19:15 +0530)
committerTom Rini <trini@konsulko.com>
Wed, 14 Feb 2018 17:14:11 +0000 (12:14 -0500)
Add CONFIG prefix to DYNAMIC_CRC_TABLE and implement it in
Kconfig.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
lib/Kconfig
lib/crc32.c

index 5178e8642e30e3d549c7773b5f47b48fbabcca1b..4fd41c4282a14ae7a93adf2b31b95e5ad80f921e 100644 (file)
@@ -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
 
index 97592124867abb815d576899f8789545c3aef1aa..7f545fde4a0225c5b7614942f5839d99e5f8e784 100644 (file)
@@ -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