From 2b37909c9e70d0646135f67f2ed8643757563860 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 12 Aug 2022 14:13:41 +0800 Subject: [PATCH] libc: Move crc8.h, crc16.h and crc32.h from include to include/nuttx to avoid the conflict with the 3rd party library Signed-off-by: Xiang Xiao --- arch/arm/src/stm32/stm32_bbsram.c | 3 +-- arch/arm/src/stm32f7/stm32_bbsram.c | 3 +-- arch/arm/src/stm32f7/stm32_ethernet.c | 2 +- arch/arm/src/stm32h7/stm32_bbsram.c | 3 +-- arch/arm/src/stm32h7/stm32_ethernet.c | 2 +- arch/renesas/src/rx65n/rx65n_sbram.c | 3 +-- arch/risc-v/src/esp32c3/esp32c3_wlan.c | 2 +- arch/xtensa/src/esp32/esp32_emac.c | 2 +- arch/xtensa/src/esp32/esp32_wlan.c | 2 +- drivers/mtd/smart.c | 7 +++---- drivers/net/ftmac100.c | 2 +- drivers/power/battery/bq769x0.c | 2 +- drivers/sensors/mlx90614.c | 2 +- fs/nxffs/nxffs_dump.c | 2 +- fs/nxffs/nxffs_inode.c | 2 +- fs/nxffs/nxffs_open.c | 2 +- fs/nxffs/nxffs_pack.c | 2 +- fs/nxffs/nxffs_read.c | 2 +- fs/nxffs/nxffs_write.c | 2 +- fs/partition/fs_gpt.c | 2 +- include/{ => nuttx}/crc16.h | 8 ++++---- include/{ => nuttx}/crc32.h | 8 ++++---- include/{ => nuttx}/crc64.h | 8 ++++---- include/{ => nuttx}/crc8.h | 8 ++++---- libs/libc/libc.csv | 4 ++-- libs/libc/misc/lib_crc16.c | 3 ++- libs/libc/misc/lib_crc32.c | 3 ++- libs/libc/misc/lib_crc64.c | 3 ++- libs/libc/misc/lib_crc8.c | 3 ++- libs/libc/misc/lib_crc8ccitt.c | 3 ++- libs/libc/misc/lib_crc8table.c | 3 ++- 31 files changed, 52 insertions(+), 51 deletions(-) rename include/{ => nuttx}/crc16.h (94%) rename include/{ => nuttx}/crc32.h (94%) rename include/{ => nuttx}/crc64.h (95%) rename include/{ => nuttx}/crc8.h (96%) diff --git a/arch/arm/src/stm32/stm32_bbsram.c b/arch/arm/src/stm32/stm32_bbsram.c index 395e6d5c98..6f2cdf3fa3 100644 --- a/arch/arm/src/stm32/stm32_bbsram.c +++ b/arch/arm/src/stm32/stm32_bbsram.c @@ -40,8 +40,7 @@ #include #include #include - -#include +#include #include "stm32_bbsram.h" #include "chip.h" diff --git a/arch/arm/src/stm32f7/stm32_bbsram.c b/arch/arm/src/stm32f7/stm32_bbsram.c index b2b583e1ef..4cc6111ee4 100644 --- a/arch/arm/src/stm32f7/stm32_bbsram.c +++ b/arch/arm/src/stm32f7/stm32_bbsram.c @@ -40,8 +40,7 @@ #include #include #include - -#include +#include #include "stm32_bbsram.h" #include "chip.h" diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index 9a68b794dd..28e8beffd0 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include #if defined(CONFIG_NET_PKT) # include diff --git a/arch/arm/src/stm32h7/stm32_bbsram.c b/arch/arm/src/stm32h7/stm32_bbsram.c index 815c18505a..d05b56d58f 100644 --- a/arch/arm/src/stm32h7/stm32_bbsram.c +++ b/arch/arm/src/stm32h7/stm32_bbsram.c @@ -39,8 +39,7 @@ #include #include #include - -#include +#include #include "stm32_bbsram.h" #include "chip.h" diff --git a/arch/arm/src/stm32h7/stm32_ethernet.c b/arch/arm/src/stm32h7/stm32_ethernet.c index 4c131f5a62..e79387d4db 100644 --- a/arch/arm/src/stm32h7/stm32_ethernet.c +++ b/arch/arm/src/stm32h7/stm32_ethernet.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include #if defined(CONFIG_NET_PKT) # include diff --git a/arch/renesas/src/rx65n/rx65n_sbram.c b/arch/renesas/src/rx65n/rx65n_sbram.c index cb207a33c0..e36d8ec8e6 100644 --- a/arch/renesas/src/rx65n/rx65n_sbram.c +++ b/arch/renesas/src/rx65n/rx65n_sbram.c @@ -40,8 +40,7 @@ #include #include #include - -#include +#include #include "rx65n_sbram.h" #include "chip.h" diff --git a/arch/risc-v/src/esp32c3/esp32c3_wlan.c b/arch/risc-v/src/esp32c3/esp32c3_wlan.c index c70ec77872..92afdb05ef 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_wlan.c +++ b/arch/risc-v/src/esp32c3/esp32c3_wlan.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/arch/xtensa/src/esp32/esp32_emac.c b/arch/xtensa/src/esp32/esp32_emac.c index b20905bcd4..5e4f612703 100644 --- a/arch/xtensa/src/esp32/esp32_emac.c +++ b/arch/xtensa/src/esp32/esp32_emac.c @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include #include diff --git a/arch/xtensa/src/esp32/esp32_wlan.c b/arch/xtensa/src/esp32/esp32_wlan.c index 6b16fe4c2f..db86734cca 100644 --- a/arch/xtensa/src/esp32/esp32_wlan.c +++ b/arch/xtensa/src/esp32/esp32_wlan.c @@ -30,9 +30,9 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/drivers/mtd/smart.c b/drivers/mtd/smart.c index 2a8327803b..de232c454b 100644 --- a/drivers/mtd/smart.c +++ b/drivers/mtd/smart.c @@ -37,12 +37,11 @@ #include #include #include - -#include -#include -#include #include +#include +#include +#include #include #include #include diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c index a93b82230a..a7c0061912 100644 --- a/drivers/net/ftmac100.c +++ b/drivers/net/ftmac100.c @@ -33,10 +33,10 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/drivers/power/battery/bq769x0.c b/drivers/power/battery/bq769x0.c index d3e5d71174..86ae6fb37a 100644 --- a/drivers/power/battery/bq769x0.c +++ b/drivers/power/battery/bq769x0.c @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/sensors/mlx90614.c b/drivers/sensors/mlx90614.c index 154b03544f..f05f6c946a 100644 --- a/drivers/sensors/mlx90614.c +++ b/drivers/sensors/mlx90614.c @@ -40,7 +40,7 @@ #include #ifdef CONFIG_MLX90614_CRC -#include +#include #endif #if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_MLX90614) diff --git a/fs/nxffs/nxffs_dump.c b/fs/nxffs/nxffs_dump.c index 9a2851721b..3ebf245807 100644 --- a/fs/nxffs/nxffs_dump.c +++ b/fs/nxffs/nxffs_dump.c @@ -27,8 +27,8 @@ #include #include #include -#include +#include #include #include #include diff --git a/fs/nxffs/nxffs_inode.c b/fs/nxffs/nxffs_inode.c index 093dd96d27..df3d9ec37a 100644 --- a/fs/nxffs/nxffs_inode.c +++ b/fs/nxffs/nxffs_inode.c @@ -26,11 +26,11 @@ #include #include -#include #include #include #include +#include #include #include diff --git a/fs/nxffs/nxffs_open.c b/fs/nxffs/nxffs_open.c index 13c5a03f4c..f7dfeabd8c 100644 --- a/fs/nxffs/nxffs_open.c +++ b/fs/nxffs/nxffs_open.c @@ -28,11 +28,11 @@ #include #include #include -#include #include #include #include +#include #include #include #include diff --git a/fs/nxffs/nxffs_pack.c b/fs/nxffs/nxffs_pack.c index 96bfe480ae..133cf68cad 100644 --- a/fs/nxffs/nxffs_pack.c +++ b/fs/nxffs/nxffs_pack.c @@ -28,9 +28,9 @@ #include #include #include -#include #include +#include #include #include "nxffs.h" diff --git a/fs/nxffs/nxffs_read.c b/fs/nxffs/nxffs_read.c index 714fcd79ea..ea8c75e65c 100644 --- a/fs/nxffs/nxffs_read.c +++ b/fs/nxffs/nxffs_read.c @@ -27,11 +27,11 @@ #include #include #include -#include #include #include #include +#include #include #include diff --git a/fs/nxffs/nxffs_write.c b/fs/nxffs/nxffs_write.c index 64d3b14e94..d32d6450fc 100644 --- a/fs/nxffs/nxffs_write.c +++ b/fs/nxffs/nxffs_write.c @@ -27,11 +27,11 @@ #include #include #include -#include #include #include #include +#include #include #include diff --git a/fs/partition/fs_gpt.c b/fs/partition/fs_gpt.c index d337c78445..35401f0a34 100644 --- a/fs/partition/fs_gpt.c +++ b/fs/partition/fs_gpt.c @@ -22,12 +22,12 @@ * Included Files ****************************************************************************/ -#include #include #include #include #include +#include #include #include "partition.h" diff --git a/include/crc16.h b/include/nuttx/crc16.h similarity index 94% rename from include/crc16.h rename to include/nuttx/crc16.h index 7498d06197..7ca21b14a8 100644 --- a/include/crc16.h +++ b/include/nuttx/crc16.h @@ -1,5 +1,5 @@ /**************************************************************************** - * include/crc16.h + * include/nuttx/crc16.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -18,8 +18,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_CRC16_H -#define __INCLUDE_CRC16_H +#ifndef __INCLUDE_NUTTX_CRC16_H +#define __INCLUDE_NUTTX_CRC16_H /**************************************************************************** * Included Files @@ -65,4 +65,4 @@ uint16_t crc16(FAR const uint8_t *src, size_t len); } #endif -#endif /* __INCLUDE_CRC16_H */ +#endif /* __INCLUDE_NUTTX_CRC16_H */ diff --git a/include/crc32.h b/include/nuttx/crc32.h similarity index 94% rename from include/crc32.h rename to include/nuttx/crc32.h index 0809a13682..452df9f228 100644 --- a/include/crc32.h +++ b/include/nuttx/crc32.h @@ -1,5 +1,5 @@ /**************************************************************************** - * include/crc32.h + * include/nuttx/crc32.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -18,8 +18,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_CRC32_H -#define __INCLUDE_CRC32_H +#ifndef __INCLUDE_NUTTX_CRC32_H +#define __INCLUDE_NUTTX_CRC32_H /**************************************************************************** * Included Files @@ -65,4 +65,4 @@ uint32_t crc32(FAR const uint8_t *src, size_t len); } #endif -#endif /* __INCLUDE_CRC32_H */ +#endif /* __INCLUDE_NUTTX_CRC32_H */ diff --git a/include/crc64.h b/include/nuttx/crc64.h similarity index 95% rename from include/crc64.h rename to include/nuttx/crc64.h index be5486eb2f..618241ff4b 100644 --- a/include/crc64.h +++ b/include/nuttx/crc64.h @@ -1,5 +1,5 @@ /**************************************************************************** - * include/crc64.h + * include/nuttx/crc64.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -18,8 +18,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_CRC64_H -#define __INCLUDE_CRC64_H +#ifndef __INCLUDE_NUTTX_CRC64_H +#define __INCLUDE_NUTTX_CRC64_H /**************************************************************************** * Included Files @@ -91,4 +91,4 @@ uint64_t crc64(FAR const uint8_t *src, size_t len); #endif #endif /* CONFIG_HAVE_LONG_LONG */ -#endif /* __INCLUDE_CRC64_H */ +#endif /* __INCLUDE_NUTTX_CRC64_H */ diff --git a/include/crc8.h b/include/nuttx/crc8.h similarity index 96% rename from include/crc8.h rename to include/nuttx/crc8.h index f6a2d695b7..2525b8d4fe 100644 --- a/include/crc8.h +++ b/include/nuttx/crc8.h @@ -1,5 +1,5 @@ /**************************************************************************** - * include/crc8.h + * include/nuttx/crc8.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -18,8 +18,8 @@ * ****************************************************************************/ -#ifndef __INCLUDE_CRC8_H -#define __INCLUDE_CRC8_H +#ifndef __INCLUDE_NUTTX_CRC8_H +#define __INCLUDE_NUTTX_CRC8_H /**************************************************************************** * Included Files @@ -101,4 +101,4 @@ uint8_t crc8ccittpart(FAR const uint8_t *src, size_t len, uint8_t crc8val); } #endif -#endif /* __INCLUDE_CRC8_H */ +#endif /* __INCLUDE_NUTTX_CRC8_H */ diff --git a/libs/libc/libc.csv b/libs/libc/libc.csv index d2f9c6a188..8da5c15f2a 100644 --- a/libs/libc/libc.csv +++ b/libs/libc/libc.csv @@ -29,8 +29,8 @@ "cfsetspeed","termios.h","defined(CONFIG_SERIAL_TERMIOS)","int","FAR struct termios *","speed_t" "chdir","unistd.h","!defined(CONFIG_DISABLE_ENVIRON)","int","FAR const char *" "clock","time.h","","clock_t" -"crc32","crc32.h","","uint32_t","FAR const uint8_t *","size_t" -"crc32part","crc32.h","","uint32_t","FAR const uint8_t *","size_t","uint32_t" +"crc32","nuttx/crc32.h","","uint32_t","FAR const uint8_t *","size_t" +"crc32part","nuttx/crc32.h","","uint32_t","FAR const uint8_t *","size_t","uint32_t" "ctime","time.h","","char *","const time_t *" "dirname","libgen.h","","FAR char *","FAR char *" "dlclose","dlfcn.h","defined(CONFIG_LIBC_DLFCN)","int","FAR void *" diff --git a/libs/libc/misc/lib_crc16.c b/libs/libc/misc/lib_crc16.c index a564ffd860..a35ff44eaa 100644 --- a/libs/libc/misc/lib_crc16.c +++ b/libs/libc/misc/lib_crc16.c @@ -38,7 +38,8 @@ #include #include -#include + +#include /************************************************************************************************ * Private Data diff --git a/libs/libc/misc/lib_crc32.c b/libs/libc/misc/lib_crc32.c index 908022aebf..cd7eb2dcae 100644 --- a/libs/libc/misc/lib_crc32.c +++ b/libs/libc/misc/lib_crc32.c @@ -45,7 +45,8 @@ #include #include -#include + +#include /************************************************************************************************ * Private Data diff --git a/libs/libc/misc/lib_crc64.c b/libs/libc/misc/lib_crc64.c index 106b4b2b84..6ad3989b13 100644 --- a/libs/libc/misc/lib_crc64.c +++ b/libs/libc/misc/lib_crc64.c @@ -26,7 +26,8 @@ #include #include -#include + +#include #ifdef CONFIG_HAVE_LONG_LONG diff --git a/libs/libc/misc/lib_crc8.c b/libs/libc/misc/lib_crc8.c index 58e7b8fb69..c23e687306 100644 --- a/libs/libc/misc/lib_crc8.c +++ b/libs/libc/misc/lib_crc8.c @@ -24,7 +24,8 @@ #include #include -#include + +#include /**************************************************************************** * Private Data diff --git a/libs/libc/misc/lib_crc8ccitt.c b/libs/libc/misc/lib_crc8ccitt.c index 94e59b4ca2..8ad84a54c9 100644 --- a/libs/libc/misc/lib_crc8ccitt.c +++ b/libs/libc/misc/lib_crc8ccitt.c @@ -26,7 +26,8 @@ #include #include -#include + +#include /*************************************************************************** * Private Data diff --git a/libs/libc/misc/lib_crc8table.c b/libs/libc/misc/lib_crc8table.c index 0ddb4df4fc..b5d998aedb 100644 --- a/libs/libc/misc/lib_crc8table.c +++ b/libs/libc/misc/lib_crc8table.c @@ -24,7 +24,8 @@ #include #include -#include + +#include /**************************************************************************** * Public Functions