diff --git a/arch/arm/src/armv7-a/arm_l2cc_pl310.c b/arch/arm/src/armv7-a/arm_l2cc_pl310.c index 65a5efde7d..eaf95d6692 100644 --- a/arch/arm/src/armv7-a/arm_l2cc_pl310.c +++ b/arch/arm/src/armv7-a/arm_l2cc_pl310.c @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -224,14 +225,6 @@ /* Misc commoly defined and re-defined things */ -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - #ifndef OK # define OK 0 #endif diff --git a/arch/arm/src/armv7-r/arm_l2cc_pl310.c b/arch/arm/src/armv7-r/arm_l2cc_pl310.c index ed45e7f0a6..937a63f918 100644 --- a/arch/arm/src/armv7-r/arm_l2cc_pl310.c +++ b/arch/arm/src/armv7-r/arm_l2cc_pl310.c @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -224,14 +225,6 @@ /* Misc commoly defined and re-defined things */ -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - #ifndef OK # define OK 0 #endif diff --git a/arch/arm/src/cxd56xx/cxd56_emmc.c b/arch/arm/src/cxd56xx/cxd56_emmc.c index c9b256389b..4d56aa040f 100644 --- a/arch/arm/src/cxd56xx/cxd56_emmc.c +++ b/arch/arm/src/cxd56xx/cxd56_emmc.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -74,10 +75,6 @@ #define EMMC_MSIZE (6) /* Burst size is 512B */ #define EMMC_FIFO_DEPTH (0x100) /* FIFO size is 1KB */ -#ifndef MIN -#define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/cxd56xx/cxd56_scu.c b/arch/arm/src/cxd56xx/cxd56_scu.c index d169414639..38c0588758 100644 --- a/arch/arm/src/cxd56xx/cxd56_scu.c +++ b/arch/arm/src/cxd56xx/cxd56_scu.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -99,14 +100,6 @@ #define DECIMATION_OFF 15 -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/cxd56xx/cxd56_sdhci.c b/arch/arm/src/cxd56xx/cxd56_sdhci.c index c59574cc27..d2246ca1e2 100644 --- a/arch/arm/src/cxd56xx/cxd56_sdhci.c +++ b/arch/arm/src/cxd56xx/cxd56_sdhci.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -211,10 +212,6 @@ #define SDIO_OCR_NUM_FUNCTIONS(ocr) (((ocr) >> 28) & 0x7) #define SDIO_FUNC_NUM_MAX (7) -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - #define SDIO_BLOCK_TIMEOUT 200 #define SDIO_BLOCK_SIZE 512 diff --git a/arch/arm/src/efm32/efm32_usbdev.c b/arch/arm/src/efm32/efm32_usbdev.c index f4d26a821f..55581f4a84 100644 --- a/arch/arm/src/efm32/efm32_usbdev.c +++ b/arch/arm/src/efm32/efm32_usbdev.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -258,16 +259,6 @@ #define efm32_rqempty(ep) ((ep)->head == NULL) #define efm32_rqpeek(ep) ((ep)->head) -/* Standard stuff ***********************************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/efm32/efm32_usbhost.c b/arch/arm/src/efm32/efm32_usbhost.c index 5567735f22..48e5cc03b1 100644 --- a/arch/arm/src/efm32/efm32_usbhost.c +++ b/arch/arm/src/efm32/efm32_usbhost.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -135,16 +136,6 @@ #define EFM32_SETUP_DELAY SEC2TICK(5) /* 5 seconds in system ticks */ #define EFM32_DATANAK_DELAY SEC2TICK(5) /* 5 seconds in system ticks */ -/* Ever-present MIN/MAX macros */ - -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - /* Tracing ******************************************************************/ #define TR_FMT1 false diff --git a/arch/arm/src/imxrt/imxrt_mpuinit.c b/arch/arm/src/imxrt/imxrt_mpuinit.c index a45e6c3fad..dc03caabe6 100644 --- a/arch/arm/src/imxrt/imxrt_mpuinit.c +++ b/arch/arm/src/imxrt/imxrt_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -41,14 +42,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - #ifndef CONFIG_ARMV7M_DCACHE /* With Dcache off: * Cacheable (MPU_RASR_C) and Bufferable (MPU_RASR_B) needs to be off diff --git a/arch/arm/src/kinetis/kinetis_mpuinit.c b/arch/arm/src/kinetis/kinetis_mpuinit.c index d9aaec6e71..6195a82ec9 100644 --- a/arch/arm/src/kinetis/kinetis_mpuinit.c +++ b/arch/arm/src/kinetis/kinetis_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -40,14 +41,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm/src/kinetis/kinetis_usbdev.c b/arch/arm/src/kinetis/kinetis_usbdev.c index f62f57c09e..1d2bff517b 100644 --- a/arch/arm/src/kinetis/kinetis_usbdev.c +++ b/arch/arm/src/kinetis/kinetis_usbdev.c @@ -35,6 +35,7 @@ #include +#include #include #include #include @@ -342,16 +343,6 @@ const struct trace_msg_t g_usb_trace_strings_deverror[] = /* Misc Helper Macros *******************************************************/ -/* Ever-present MIN and MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Byte ordering in host-based values */ #ifdef CONFIG_ENDIAN_BIG diff --git a/arch/arm/src/lc823450/lc823450_dma.c b/arch/arm/src/lc823450/lc823450_dma.c index 660a3d8266..7d34594168 100644 --- a/arch/arm/src/lc823450/lc823450_dma.c +++ b/arch/arm/src/lc823450/lc823450_dma.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -75,10 +76,6 @@ #define DMACCFG_SRCPERI_SHIFT 1 #define DMACCFG_E (1 << 0) -#ifndef MIN -# define MIN(a, b) ((a) > (b) ? (b) : (a)) -#endif /* MIN */ - #define LC823450_DMA_EN (1 << 26) /**************************************************************************** diff --git a/arch/arm/src/lc823450/lc823450_mpuinit2.c b/arch/arm/src/lc823450/lc823450_mpuinit2.c index da91875df1..b7410c096e 100644 --- a/arch/arm/src/lc823450/lc823450_mpuinit2.c +++ b/arch/arm/src/lc823450/lc823450_mpuinit2.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -38,14 +39,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm/src/lc823450/lc823450_procfs_dvfs.c b/arch/arm/src/lc823450/lc823450_procfs_dvfs.c index 5bea17194a..1e2194d6c3 100644 --- a/arch/arm/src/lc823450/lc823450_procfs_dvfs.c +++ b/arch/arm/src/lc823450/lc823450_procfs_dvfs.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -54,10 +55,6 @@ #define DVFS_LINELEN 128 -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/lc823450/lc823450_serial.c b/arch/arm/src/lc823450/lc823450_serial.c index 4b2d638d2a..70299fdcf9 100644 --- a/arch/arm/src/lc823450/lc823450_serial.c +++ b/arch/arm/src/lc823450/lc823450_serial.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -141,10 +142,6 @@ int g_console_disable; # define HS_DMAACT_ACT2 3 #endif -#ifndef MIN -# define MIN(a, b) ((a) > (b) ? (b) : (a)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/lc823450/lc823450_spi.c b/arch/arm/src/lc823450/lc823450_spi.c index 649ab1159b..c8c8f20d70 100644 --- a/arch/arm/src/lc823450/lc823450_spi.c +++ b/arch/arm/src/lc823450/lc823450_spi.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -53,10 +54,6 @@ # error "SPI_EXCHANGE is not supported" #endif -#ifndef MIN -# define MIN(a, b) ((a) > (b) ? (b) : (a)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/lc823450/lc823450_usbdev.c b/arch/arm/src/lc823450/lc823450_usbdev.c index 1651e75d28..f9b35ca776 100644 --- a/arch/arm/src/lc823450/lc823450_usbdev.c +++ b/arch/arm/src/lc823450/lc823450_usbdev.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -73,10 +74,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MIN -# define MIN(a, b) ((a) > (b) ? (b) : (a)) -#endif - #if 0 # define DPRINTF(fmt, args...) uinfo(fmt, ##args) #else diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_mpuinit.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_mpuinit.c index ce2e4cf386..106860b823 100644 --- a/arch/arm/src/lpc17xx_40xx/lpc17_40_mpuinit.c +++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/lpc43xx/lpc43_mpuinit.c b/arch/arm/src/lpc43xx/lpc43_mpuinit.c index 9ef5f66162..b006e8eb98 100644 --- a/arch/arm/src/lpc43xx/lpc43_mpuinit.c +++ b/arch/arm/src/lpc43xx/lpc43_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/lpc54xx/lpc54_mpuinit.c b/arch/arm/src/lpc54xx/lpc54_mpuinit.c index 63afefc76c..28f941d98f 100644 --- a/arch/arm/src/lpc54xx/lpc54_mpuinit.c +++ b/arch/arm/src/lpc54xx/lpc54_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/max326xx/common/max326_mpuinit.c b/arch/arm/src/max326xx/common/max326_mpuinit.c index c95c650b7a..70ef194f7c 100644 --- a/arch/arm/src/max326xx/common/max326_mpuinit.c +++ b/arch/arm/src/max326xx/common/max326_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/rtl8720c/amebaz_coex.c b/arch/arm/src/rtl8720c/amebaz_coex.c index 502dcd90e0..1dc96b77db 100644 --- a/arch/arm/src/rtl8720c/amebaz_coex.c +++ b/arch/arm/src/rtl8720c/amebaz_coex.c @@ -24,16 +24,14 @@ #include #include +#include + #include "amebaz_coex.h" /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - #define HCI_VENDOR_MAILBOX_CMD 0xfc8f /* static net_buf_simple *Xiaomi_buf; */ diff --git a/arch/arm/src/s32k3xx/s32k3xx_mpuinit.c b/arch/arm/src/s32k3xx/s32k3xx_mpuinit.c index d4c5d0de52..e7aa8304b8 100644 --- a/arch/arm/src/s32k3xx/s32k3xx_mpuinit.c +++ b/arch/arm/src/s32k3xx/s32k3xx_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -37,14 +38,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MAX -# define MAX(a,b) a > b ? a : b -#endif - -#ifndef MIN -# define MIN(a,b) a < b ? a : b -#endif - #ifndef CONFIG_ARMV7M_DCACHE /* With Dcache off: * Cacheable (MPU_RASR_C) and Bufferable (MPU_RASR_B) needs to be off diff --git a/arch/arm/src/sam34/sam_mpuinit.c b/arch/arm/src/sam34/sam_mpuinit.c index e3c57ad0e5..72930e1bda 100644 --- a/arch/arm/src/sam34/sam_mpuinit.c +++ b/arch/arm/src/sam34/sam_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm/src/sam34/sam_udp.c b/arch/arm/src/sam34/sam_udp.c index 4aa09e3bdc..d9fdca2e5b 100644 --- a/arch/arm/src/sam34/sam_udp.c +++ b/arch/arm/src/sam34/sam_udp.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -175,16 +176,6 @@ #define SAM_TRACEINTID_UPSTRRES 0x001f #define SAM_TRACEINTID_WAKEUP 0x0020 -/* Ever-present MIN and MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Byte ordering in host-based values */ #ifdef CONFIG_ENDIAN_BIG diff --git a/arch/arm/src/sama5/sam_can.c b/arch/arm/src/sama5/sam_can.c index 5ae6c9dbb0..b02e532857 100644 --- a/arch/arm/src/sama5/sam_can.c +++ b/arch/arm/src/sama5/sam_can.c @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -77,16 +78,6 @@ * Pre-processor Definitions ****************************************************************************/ -/* Common definitions *******************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Mailboxes ****************************************************************/ #define SAMA5_CAN_NRECVMB MAX(CONFIG_SAMA5_CAN0_NRECVMB, CONFIG_SAMA5_CAN1_NRECVMB) diff --git a/arch/arm/src/sama5/sam_hsmci.c b/arch/arm/src/sama5/sam_hsmci.c index a71366b767..749f3143e0 100644 --- a/arch/arm/src/sama5/sam_hsmci.c +++ b/arch/arm/src/sama5/sam_hsmci.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -338,16 +339,6 @@ # define DEBUG_NCMDSAMPLES 2 #endif -/* Some semi-standard definitions */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/sama5/sam_mcan.c b/arch/arm/src/sama5/sam_mcan.c index a11b4989b9..a2327bc53c 100644 --- a/arch/arm/src/sama5/sam_mcan.c +++ b/arch/arm/src/sama5/sam_mcan.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -62,16 +63,6 @@ * Pre-processor Definitions ****************************************************************************/ -/* Common definitions */ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /* dedicated RS and TX buffers are not supported */ #define DEDICATED_BUFFERS_NOT_USED diff --git a/arch/arm/src/sama5/sam_tsd.c b/arch/arm/src/sama5/sam_tsd.c index 9b7137218e..5f36fd82ae 100644 --- a/arch/arm/src/sama5/sam_tsd.c +++ b/arch/arm/src/sama5/sam_tsd.c @@ -50,6 +50,7 @@ #include +#include #include #include @@ -127,16 +128,6 @@ # define TSD_PENMOVE (TOUCH_MOVE | TOUCH_ID_VALID | TOUCH_POS_VALID) #endif -/* Ever-present MIN and MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - #ifndef BOARD_TSSCTIM # define BOARD_TSSCTIM 0 #endif diff --git a/arch/arm/src/sama5/sam_udphs.c b/arch/arm/src/sama5/sam_udphs.c index 6c765b46a5..de8b318337 100644 --- a/arch/arm/src/sama5/sam_udphs.c +++ b/arch/arm/src/sama5/sam_udphs.c @@ -49,6 +49,7 @@ #include +#include #include #include #include @@ -207,16 +208,6 @@ #define SAM_TRACEINTID_UPSTRRES 0x0021 #define SAM_TRACEINTID_WAKEUP 0x0022 -/* Ever-present MIN and MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Byte ordering in host-based values */ #ifdef CONFIG_ENDIAN_BIG diff --git a/arch/arm/src/samd2l2/sam_usb.c b/arch/arm/src/samd2l2/sam_usb.c index acdaef61c4..2ce1aaa419 100644 --- a/arch/arm/src/samd2l2/sam_usb.c +++ b/arch/arm/src/samd2l2/sam_usb.c @@ -66,6 +66,7 @@ #include +#include #include #include #include @@ -211,16 +212,6 @@ #define SAM_TRACEINTID_EP0WRSTATUS 0x002a #define SAM_TRACEINTID_EPTRCPT0_LEN 0x002b -/* Ever-present MIN and MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Byte ordering in host-based values */ #ifdef CONFIG_ENDIAN_BIG diff --git a/arch/arm/src/samd5e5/sam_mpuinit.c b/arch/arm/src/samd5e5/sam_mpuinit.c index f48d3591d7..ac4a723305 100644 --- a/arch/arm/src/samd5e5/sam_mpuinit.c +++ b/arch/arm/src/samd5e5/sam_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm/src/samd5e5/sam_progmem.c b/arch/arm/src/samd5e5/sam_progmem.c index ea3b384abe..5004ca8d62 100644 --- a/arch/arm/src/samd5e5/sam_progmem.c +++ b/arch/arm/src/samd5e5/sam_progmem.c @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -140,16 +141,6 @@ #define SAMD5E5_PROGMEM_ERASEDVAL (0xffu) -/* Misc stuff */ - -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/arch/arm/src/samd5e5/sam_usb.c b/arch/arm/src/samd5e5/sam_usb.c index 87e6d149e4..15a2018231 100644 --- a/arch/arm/src/samd5e5/sam_usb.c +++ b/arch/arm/src/samd5e5/sam_usb.c @@ -66,6 +66,7 @@ #include +#include #include #include #include @@ -233,16 +234,6 @@ #define SAM_TRACEINTID_PENDING_PIPE 0x002c #define SAM_TRACEINTID_PIPENO 0x002d -/* Ever-present MIN and MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Byte ordering in host-based values */ #ifdef CONFIG_ENDIAN_BIG diff --git a/arch/arm/src/samv7/sam_hsmci.c b/arch/arm/src/samv7/sam_hsmci.c index 84926ee388..ea5333187d 100644 --- a/arch/arm/src/samv7/sam_hsmci.c +++ b/arch/arm/src/samv7/sam_hsmci.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -271,16 +272,6 @@ # define DEBUG_NCMDSAMPLES 2 #endif -/* Some semi-standard definitions */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/samv7/sam_mcan.c b/arch/arm/src/samv7/sam_mcan.c index 8c06a22629..81ba8dbc37 100644 --- a/arch/arm/src/samv7/sam_mcan.c +++ b/arch/arm/src/samv7/sam_mcan.c @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -59,16 +60,6 @@ * Pre-processor Definitions ****************************************************************************/ -/* Common definitions *******************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Clock source *************************************************************/ /* PCK5 is the programmable clock source, common to all MCAN controllers */ diff --git a/arch/arm/src/samv7/sam_mpuinit.c b/arch/arm/src/samv7/sam_mpuinit.c index bac3665012..e013865274 100644 --- a/arch/arm/src/samv7/sam_mpuinit.c +++ b/arch/arm/src/samv7/sam_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -37,18 +38,6 @@ #ifdef CONFIG_ARM_MPU -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm/src/samv7/sam_progmem.c b/arch/arm/src/samv7/sam_progmem.c index 4e85806bc0..c5b1ab4ab9 100644 --- a/arch/arm/src/samv7/sam_progmem.c +++ b/arch/arm/src/samv7/sam_progmem.c @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -138,16 +139,6 @@ #define SAMV7_PROGMEM_ERASEDVAL (0xffu) -/* Misc stuff */ - -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/arch/arm/src/samv7/sam_usbdevhs.c b/arch/arm/src/samv7/sam_usbdevhs.c index 47887d1f4f..eb3036d3c2 100644 --- a/arch/arm/src/samv7/sam_usbdevhs.c +++ b/arch/arm/src/samv7/sam_usbdevhs.c @@ -51,6 +51,7 @@ #include +#include #include #include #include @@ -271,16 +272,6 @@ #define SAM_TRACEINTID_UPSTRRES 0x0025 #define SAM_TRACEINTID_WAKEUP 0x0026 -/* Ever-present MIN and MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Byte ordering in host-based values */ #ifdef CONFIG_ENDIAN_BIG diff --git a/arch/arm/src/stm32/stm32_ltdc.c b/arch/arm/src/stm32/stm32_ltdc.c index dd16b4dff7..2460b7d4ed 100644 --- a/arch/arm/src/stm32/stm32_ltdc.c +++ b/arch/arm/src/stm32/stm32_ltdc.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -573,10 +574,6 @@ # endif #endif -/* Helper */ - -#define MIN(x,y) ((x) < (y) ? (x) : (y)) - /* Color normalization */ #if defined(CONFIG_STM32_LTDC_L1_RGB565) diff --git a/arch/arm/src/stm32/stm32_mpuinit.c b/arch/arm/src/stm32/stm32_mpuinit.c index 65a168c034..ed0f4ffbf2 100644 --- a/arch/arm/src/stm32/stm32_mpuinit.c +++ b/arch/arm/src/stm32/stm32_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_otgfsdev.c b/arch/arm/src/stm32/stm32_otgfsdev.c index da3c8e2805..5ad1ba2e32 100644 --- a/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/arch/arm/src/stm32/stm32_otgfsdev.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -301,16 +302,6 @@ #define stm32_rqempty(ep) ((ep)->head == NULL) #define stm32_rqpeek(ep) ((ep)->head) -/* Standard stuff ***********************************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_otgfshost.c b/arch/arm/src/stm32/stm32_otgfshost.c index 3b90090764..7d6f18f481 100644 --- a/arch/arm/src/stm32/stm32_otgfshost.c +++ b/arch/arm/src/stm32/stm32_otgfshost.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -145,16 +146,6 @@ #define STM32_SETUP_DELAY SEC2TICK(5) /* 5 seconds in system ticks */ #define STM32_DATANAK_DELAY SEC2TICK(5) /* 5 seconds in system ticks */ -/* Ever-present MIN/MAX macros */ - -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_otghsdev.c b/arch/arm/src/stm32/stm32_otghsdev.c index ef95d7d062..6a7e7c0b89 100644 --- a/arch/arm/src/stm32/stm32_otghsdev.c +++ b/arch/arm/src/stm32/stm32_otghsdev.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -257,16 +258,6 @@ #define stm32_rqempty(ep) ((ep)->head == NULL) #define stm32_rqpeek(ep) ((ep)->head) -/* Standard stuff ***********************************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_otghshost.c b/arch/arm/src/stm32/stm32_otghshost.c index f7a22cd0eb..5f0116e2e1 100644 --- a/arch/arm/src/stm32/stm32_otghshost.c +++ b/arch/arm/src/stm32/stm32_otghshost.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -150,16 +151,6 @@ #define STM32_SETUP_DELAY SEC2TICK(5) /* 5 seconds in system ticks */ #define STM32_DATANAK_DELAY SEC2TICK(5) /* 5 seconds in system ticks */ -/* Ever-present MIN/MAX macros */ - -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_usbdev.c b/arch/arm/src/stm32/stm32_usbdev.c index 5285f1e8ea..41252a194c 100644 --- a/arch/arm/src/stm32/stm32_usbdev.c +++ b/arch/arm/src/stm32/stm32_usbdev.c @@ -29,6 +29,7 @@ #include +#include #include #include #include @@ -232,16 +233,6 @@ #define STM32_TRACEINTID_EP0SETUPOUT 0x001f #define STM32_TRACEINTID_EP0SETUPOUTDATA 0x0020 -/* Ever-present MIN and MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Byte ordering in host-based values */ #ifdef CONFIG_ENDIAN_BIG diff --git a/arch/arm/src/stm32/stm32_usbfs.c b/arch/arm/src/stm32/stm32_usbfs.c index 25fb21ccc4..8232afe7c9 100644 --- a/arch/arm/src/stm32/stm32_usbfs.c +++ b/arch/arm/src/stm32/stm32_usbfs.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -213,16 +214,6 @@ #define STM32_TRACEINTID_EP0SETUPOUT 0x001f #define STM32_TRACEINTID_EP0SETUPOUTDATA 0x0020 -/* Ever-present MIN and MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Byte ordering in host-based values */ #ifdef CONFIG_ENDIAN_BIG diff --git a/arch/arm/src/stm32f0l0g0/stm32_usbdev.c b/arch/arm/src/stm32f0l0g0/stm32_usbdev.c index 80b1c337fa..57a45b9341 100644 --- a/arch/arm/src/stm32f0l0g0/stm32_usbdev.c +++ b/arch/arm/src/stm32f0l0g0/stm32_usbdev.c @@ -29,6 +29,7 @@ #include +#include #include #include #include @@ -217,16 +218,6 @@ #define STM32_TRACEINTID_EP0SETUPOUT 0x001e #define STM32_TRACEINTID_EP0SETUPOUTDATA 0x001f -/* Ever-present MIN and MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Byte ordering in host-based values */ #ifdef CONFIG_ENDIAN_BIG diff --git a/arch/arm/src/stm32f7/stm32_ethernet.c b/arch/arm/src/stm32f7/stm32_ethernet.c index a26f55cb67..45983fd201 100644 --- a/arch/arm/src/stm32f7/stm32_ethernet.c +++ b/arch/arm/src/stm32f7/stm32_ethernet.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -218,10 +219,6 @@ # define CONFIG_STM32F7_ETH_NTXDESC 4 #endif -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /* We need at least one more free buffer than transmit buffers */ #define STM32_ETH_NFREEBUFFERS (CONFIG_STM32F7_ETH_NTXDESC+1) diff --git a/arch/arm/src/stm32f7/stm32_ltdc.c b/arch/arm/src/stm32f7/stm32_ltdc.c index 4f108a833e..094eebc902 100644 --- a/arch/arm/src/stm32f7/stm32_ltdc.c +++ b/arch/arm/src/stm32f7/stm32_ltdc.c @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -574,10 +575,6 @@ # endif #endif -/* Helper */ - -#define MIN(x,y) ((x) < (y) ? (x) : (y)) - /* Color normalization */ #if defined(CONFIG_STM32F7_LTDC_L1_RGB565) diff --git a/arch/arm/src/stm32f7/stm32_mpuinit.c b/arch/arm/src/stm32f7/stm32_mpuinit.c index ffac20ff1e..e05b57dba8 100644 --- a/arch/arm/src/stm32f7/stm32_mpuinit.c +++ b/arch/arm/src/stm32f7/stm32_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/stm32f7/stm32_otgdev.c b/arch/arm/src/stm32f7/stm32_otgdev.c index 154e993162..eb20e86f69 100644 --- a/arch/arm/src/stm32f7/stm32_otgdev.c +++ b/arch/arm/src/stm32f7/stm32_otgdev.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -386,16 +387,6 @@ # define stm32_rqempty(ep) ((ep)->head == NULL) # define stm32_rqpeek(ep) ((ep)->head) -/* Standard stuff ***********************************************************/ - -# ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -# endif - -# ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -# endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/stm32f7/stm32_otghost.c b/arch/arm/src/stm32f7/stm32_otghost.c index fe8195140d..f29ced48f3 100644 --- a/arch/arm/src/stm32f7/stm32_otghost.c +++ b/arch/arm/src/stm32f7/stm32_otghost.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -146,16 +147,6 @@ #define STM32_SETUP_DELAY SEC2TICK(5) /* 5 seconds in system ticks */ #define STM32_DATANAK_DELAY SEC2TICK(5) /* 5 seconds in system ticks */ -/* Ever-present MIN/MAX macros */ - -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/stm32h7/stm32_mpuinit.c b/arch/arm/src/stm32h7/stm32_mpuinit.c index 962c3563b8..819a8f0e11 100644 --- a/arch/arm/src/stm32h7/stm32_mpuinit.c +++ b/arch/arm/src/stm32h7/stm32_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/stm32h7/stm32_otgdev.c b/arch/arm/src/stm32h7/stm32_otgdev.c index 211e10852c..66e4e3632e 100644 --- a/arch/arm/src/stm32h7/stm32_otgdev.c +++ b/arch/arm/src/stm32h7/stm32_otgdev.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -333,16 +334,6 @@ #define stm32_rqempty(ep) ((ep)->head == NULL) #define stm32_rqpeek(ep) ((ep)->head) -/* Standard stuff ***********************************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/stm32h7/stm32_otghost.c b/arch/arm/src/stm32h7/stm32_otghost.c index c52fe71881..dd2e9d14e1 100644 --- a/arch/arm/src/stm32h7/stm32_otghost.c +++ b/arch/arm/src/stm32h7/stm32_otghost.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -146,16 +147,6 @@ #define STM32_SETUP_DELAY SEC2TICK(5) /* 5 seconds in system ticks */ #define STM32_DATANAK_DELAY SEC2TICK(5) /* 5 seconds in system ticks */ -/* Ever-present MIN/MAX macros */ - -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/stm32l4/stm32l4_flash.c b/arch/arm/src/stm32l4/stm32l4_flash.c index 3344c137d1..1862f5839f 100644 --- a/arch/arm/src/stm32l4/stm32l4_flash.c +++ b/arch/arm/src/stm32l4/stm32l4_flash.c @@ -41,6 +41,7 @@ #include #include #include +#include #include "stm32l4_rcc.h" #include "stm32l4_waste.h" @@ -88,10 +89,6 @@ FLASH_SR_PGAERR | FLASH_SR_WRPERR | \ FLASH_SR_PROGERR) -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm/src/stm32l4/stm32l4_mpuinit.c b/arch/arm/src/stm32l4/stm32l4_mpuinit.c index 379f275ebf..6d4bfaff87 100644 --- a/arch/arm/src/stm32l4/stm32l4_mpuinit.c +++ b/arch/arm/src/stm32l4/stm32l4_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/stm32l4/stm32l4_otgfsdev.c b/arch/arm/src/stm32l4/stm32l4_otgfsdev.c index e12dae8e5b..b2164fadee 100644 --- a/arch/arm/src/stm32l4/stm32l4_otgfsdev.c +++ b/arch/arm/src/stm32l4/stm32l4_otgfsdev.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -353,16 +354,6 @@ #define stm32l4_rqempty(ep) ((ep)->head == NULL) #define stm32l4_rqpeek(ep) ((ep)->head) -/* Standard stuff ***********************************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/stm32l4/stm32l4_otgfshost.c b/arch/arm/src/stm32l4/stm32l4_otgfshost.c index b382de3307..a21cb85074 100644 --- a/arch/arm/src/stm32l4/stm32l4_otgfshost.c +++ b/arch/arm/src/stm32l4/stm32l4_otgfshost.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -143,16 +144,6 @@ #define STM32L4_SETUP_DELAY SEC2TICK(5) /* 5 seconds in system ticks */ #define STM32L4_DATANAK_DELAY SEC2TICK(5) /* 5 seconds in system ticks */ -/* Ever-present MIN/MAX macros */ - -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/arm/src/stm32l4/stm32l4_usbdev.c b/arch/arm/src/stm32l4/stm32l4_usbdev.c index 177e499da2..7e7c83d115 100644 --- a/arch/arm/src/stm32l4/stm32l4_usbdev.c +++ b/arch/arm/src/stm32l4/stm32l4_usbdev.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -217,16 +218,6 @@ #define STM32L4_TRACEINTID_EP0SETUPOUT 0x001f #define STM32L4_TRACEINTID_EP0SETUPOUTDATA 0x0020 -/* Ever-present MIN and MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Byte ordering in host-based values */ #ifdef CONFIG_ENDIAN_BIG diff --git a/arch/arm/src/stm32l5/stm32l5_flash.c b/arch/arm/src/stm32l5/stm32l5_flash.c index 634c6ad1d6..653a31c34b 100644 --- a/arch/arm/src/stm32l5/stm32l5_flash.c +++ b/arch/arm/src/stm32l5/stm32l5_flash.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include "stm32l5_rcc.h" @@ -89,10 +90,6 @@ FLASH_SR_PGAERR | FLASH_SR_WRPERR | \ FLASH_SR_PROGERR) -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm/src/stm32l5/stm32l5_mpuinit.c b/arch/arm/src/stm32l5/stm32l5_mpuinit.c index 44832bc9f7..311fc29e5e 100644 --- a/arch/arm/src/stm32l5/stm32l5_mpuinit.c +++ b/arch/arm/src/stm32l5/stm32l5_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/stm32u5/stm32_flash.c b/arch/arm/src/stm32u5/stm32_flash.c index a597e23992..3733d61d22 100644 --- a/arch/arm/src/stm32u5/stm32_flash.c +++ b/arch/arm/src/stm32u5/stm32_flash.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include "stm32_rcc.h" @@ -89,10 +90,6 @@ FLASH_NSSR_PGAERR | FLASH_NSSR_WRPERR | \ FLASH_NSSR_PROGERR) -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm/src/stm32u5/stm32_mpuinit.c b/arch/arm/src/stm32u5/stm32_mpuinit.c index 9c60d4b53e..7e6901aa19 100644 --- a/arch/arm/src/stm32u5/stm32_mpuinit.c +++ b/arch/arm/src/stm32u5/stm32_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/stm32wb/stm32wb_flash.c b/arch/arm/src/stm32wb/stm32wb_flash.c index 99cfb0fcc9..bf6e423558 100644 --- a/arch/arm/src/stm32wb/stm32wb_flash.c +++ b/arch/arm/src/stm32wb/stm32wb_flash.c @@ -39,6 +39,7 @@ #include #include #include +#include #include "arm_internal.h" #include "stm32wb_rcc.h" @@ -75,10 +76,6 @@ FLASH_SR_PGAERR | FLASH_SR_WRPERR | \ FLASH_SR_PROGERR) -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm/src/stm32wb/stm32wb_mpuinit.c b/arch/arm/src/stm32wb/stm32wb_mpuinit.c index f4e9dab2df..b9e13873f4 100644 --- a/arch/arm/src/stm32wb/stm32wb_mpuinit.c +++ b/arch/arm/src/stm32wb/stm32wb_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MAX -# define MAX(a,b) (a) > (b) ? (a) : (b) -#endif - -#ifndef MIN -# define MIN(a,b) (a) < (b) ? (a) : (b) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/stm32wl5/stm32wl5_flash.c b/arch/arm/src/stm32wl5/stm32wl5_flash.c index f2bc151b00..34a5f25f45 100644 --- a/arch/arm/src/stm32wl5/stm32wl5_flash.c +++ b/arch/arm/src/stm32wl5/stm32wl5_flash.c @@ -41,6 +41,7 @@ #include #include #include +#include #include "stm32wl5_rcc.h" #include "stm32wl5_waste.h" @@ -77,10 +78,6 @@ FLASH_SR_PGAERR | FLASH_SR_WRPERR | \ FLASH_SR_PROGERR) -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm/src/stm32wl5/stm32wl5_mpuinit.c b/arch/arm/src/stm32wl5/stm32wl5_mpuinit.c index 166104dbf1..55aae6bb07 100644 --- a/arch/arm/src/stm32wl5/stm32wl5_mpuinit.c +++ b/arch/arm/src/stm32wl5/stm32wl5_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/arch/arm/src/tiva/common/tiva_mpuinit.c b/arch/arm/src/tiva/common/tiva_mpuinit.c index a2a7ad0906..b9b1f7bfb9 100644 --- a/arch/arm/src/tiva/common/tiva_mpuinit.c +++ b/arch/arm/src/tiva/common/tiva_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,17 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm/src/tlsr82/tlsr82_adc.c b/arch/arm/src/tlsr82/tlsr82_adc.c index 6f30b5e939..71e7221fc8 100644 --- a/arch/arm/src/tlsr82/tlsr82_adc.c +++ b/arch/arm/src/tlsr82/tlsr82_adc.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -46,16 +47,6 @@ * Pre-processor Definitions ****************************************************************************/ -/* ADC calibration max count */ - -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - /* Default reference voltage 1175 mV */ #define ADC_DEFAULT_VREF 1175 diff --git a/arch/arm/src/tlsr82/tlsr82_flash_mtd.c b/arch/arm/src/tlsr82/tlsr82_flash_mtd.c index 9c8ced3a46..90bb9b91f5 100644 --- a/arch/arm/src/tlsr82/tlsr82_flash_mtd.c +++ b/arch/arm/src/tlsr82/tlsr82_flash_mtd.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -44,8 +45,6 @@ * Pre-processor Definitions ****************************************************************************/ -#define MIN(a, b) (((a) > (b)) ? (b) : (a)) - /* Flash size deifnitions */ #define TLSR82_SECTOR_SHIFT 12 diff --git a/arch/arm/src/xmc4/xmc4_mpuinit.c b/arch/arm/src/xmc4/xmc4_mpuinit.c index a564cc995e..2ee32e347e 100644 --- a/arch/arm/src/xmc4/xmc4_mpuinit.c +++ b/arch/arm/src/xmc4/xmc4_mpuinit.c @@ -25,6 +25,7 @@ #include #include +#include #include @@ -33,18 +34,6 @@ #if defined(CONFIG_BUILD_PROTECTED) && defined(CONFIG_ARM_MPU) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/arm64/src/common/arm64_arch.h b/arch/arm64/src/common/arm64_arch.h index c481803541..f6875ee94e 100644 --- a/arch/arm64/src/common/arm64_arch.h +++ b/arch/arm64/src/common/arm64_arch.h @@ -34,6 +34,8 @@ #include #endif +#include + #include "barriers.h" /**************************************************************************** @@ -147,18 +149,6 @@ # define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) #endif -/* define MAX(a, b)/MIN(a, b) - * The larger/smaller value between a and b. - * Arguments are evaluated twice. - */ -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - #define GET_EL(mode) (((mode) >> MODE_EL_SHIFT) & MODE_EL_MASK) /* MPIDR_EL1, Multiprocessor Affinity Register */ diff --git a/arch/mips/src/pic32mx/pic32mx_ethernet.c b/arch/mips/src/pic32mx/pic32mx_ethernet.c index 8232e6aa1d..240edc15b2 100644 --- a/arch/mips/src/pic32mx/pic32mx_ethernet.c +++ b/arch/mips/src/pic32mx/pic32mx_ethernet.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -268,16 +269,6 @@ #define PHYS_ADDR(va) ((uint32_t)(va) & 0x1fffffff) #define VIRT_ADDR(pa) (KSEG1_BASE | (uint32_t)(pa)) -/* Ever-present MIN and MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/mips/src/pic32mx/pic32mx_usbdev.c b/arch/mips/src/pic32mx/pic32mx_usbdev.c index 4946649838..52f4b2b46a 100644 --- a/arch/mips/src/pic32mx/pic32mx_usbdev.c +++ b/arch/mips/src/pic32mx/pic32mx_usbdev.c @@ -33,6 +33,7 @@ #include +#include #include #include #include @@ -240,16 +241,6 @@ #define PHYS_ADDR(va) ((uint32_t)(va) & 0x1fffffff) #define VIRT_ADDR(pa) (KSEG1_BASE | (uint32_t)(pa)) -/* Ever-present MIN and MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Byte ordering in host-based values */ #ifdef CONFIG_ENDIAN_BIG diff --git a/arch/risc-v/src/esp32c3/esp32c3_adc.c b/arch/risc-v/src/esp32c3/esp32c3_adc.c index 959430d0c1..28837306bc 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_adc.c +++ b/arch/risc-v/src/esp32c3/esp32c3_adc.c @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -114,14 +115,6 @@ #define ADC_WORK_DELAY (1) -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/risc-v/src/esp32c3/esp32c3_bignum.c b/arch/risc-v/src/esp32c3/esp32c3_bignum.c index 7908178f36..40cd72b498 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_bignum.c +++ b/arch/risc-v/src/esp32c3/esp32c3_bignum.c @@ -46,10 +46,6 @@ * Pre-processor Macros ****************************************************************************/ -#undef MIN -#undef MAX -#define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) -#define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) #define SOC_RSA_MAX_BIT_LEN (3072) #define CIL (sizeof(uint32_t)) /* chars in limb */ diff --git a/arch/risc-v/src/esp32c3/esp32c3_dma.c b/arch/risc-v/src/esp32c3/esp32c3_dma.c index 8309b92934..88d21f300a 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_dma.c +++ b/arch/risc-v/src/esp32c3/esp32c3_dma.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -55,10 +56,6 @@ #define SET_BITS(_r, _ch, _b) modifyreg32((_r) + (_ch) * REG_OFF, 0, (_b)) #define CLR_BITS(_r, _ch, _b) modifyreg32((_r) + (_ch) * REG_OFF, (_b), 0) -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - #ifndef ALIGN_UP # define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1)) #endif diff --git a/arch/risc-v/src/esp32c3/esp32c3_efuse.c b/arch/risc-v/src/esp32c3/esp32c3_efuse.c index d1793337ff..79edcf7e29 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_efuse.c +++ b/arch/risc-v/src/esp32c3/esp32c3_efuse.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -46,8 +47,6 @@ #define EFUSE_CMD_READ 0x01 /* Command to read. */ #define EFUSE_MAX_BLK_LEN 256 /* Max length of efuse block. */ -#define MIN(a, b) ((a) < (b) ? (a) : (b)) - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/risc-v/src/esp32c3/esp32c3_idle.c b/arch/risc-v/src/esp32c3/esp32c3_idle.c index f26dfe3cad..b78bf30399 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_idle.c +++ b/arch/risc-v/src/esp32c3/esp32c3_idle.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -68,10 +69,6 @@ # define CONFIG_PM_SLEEP_WAKEUP_NSEC 0 #endif -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - #define EXPECTED_IDLE_TIME_US (800) #define EARLY_WAKEUP_US (200) diff --git a/arch/risc-v/src/esp32c3/esp32c3_ledc.c b/arch/risc-v/src/esp32c3/esp32c3_ledc.c index 6308bbbaea..b8b984b15c 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_ledc.c +++ b/arch/risc-v/src/esp32c3/esp32c3_ledc.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -117,10 +118,6 @@ #define SET_CHAN_BITS(c, r, b) setbits(b, LEDC_CHAN_REG(r, (c)->num)); #define SET_CHAN_REG(c, r, v) putreg32(v, LEDC_CHAN_REG(r, (c)->num)); -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/risc-v/src/esp32c3/esp32c3_pm.c b/arch/risc-v/src/esp32c3/esp32c3_pm.c index 88edee89e7..71a7ca42b7 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_pm.c +++ b/arch/risc-v/src/esp32c3/esp32c3_pm.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include "chip.h" @@ -74,10 +75,6 @@ #define RTC_MODULE_SLEEP_PREPARE_CYCLES (6) -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /* Time from VDD_SDIO power up to first flash read in ROM code */ #define VDD_SDIO_POWERUP_TO_FLASH_READ_US (700) diff --git a/arch/risc-v/src/esp32c3/esp32c3_rng.c b/arch/risc-v/src/esp32c3/esp32c3_rng.c index 3a5b0b65bf..f0e59e41b6 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_rng.c +++ b/arch/risc-v/src/esp32c3/esp32c3_rng.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -44,14 +45,6 @@ #if defined(CONFIG_ESP32C3_RNG) #if defined(CONFIG_DEV_RANDOM) || defined(CONFIG_DEV_URANDOM_ARCH) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/arch/risc-v/src/esp32c3/esp32c3_spi.c b/arch/risc-v/src/esp32c3/esp32c3_spi.c index 147b997f1d..daab611eb6 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_spi.c +++ b/arch/risc-v/src/esp32c3/esp32c3_spi.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -119,10 +120,6 @@ #define SPI_MAX_BUF_SIZE (64) -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/risc-v/src/esp32c3/esp32c3_spi_slave.c b/arch/risc-v/src/esp32c3/esp32c3_spi_slave.c index 7eea1cd59f..ef0f4d21ed 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_spi_slave.c +++ b/arch/risc-v/src/esp32c3/esp32c3_spi_slave.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -107,10 +108,6 @@ #define SPI_SLAVE_HW_BUF_SIZE (64) -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - #define WORDS2BYTES(_priv, _wn) ((_wn) * ((_priv)->nbits / 8)) #define BYTES2WORDS(_priv, _bn) ((_bn) / ((_priv)->nbits / 8)) diff --git a/arch/risc-v/src/esp32c3/esp32c3_wifi_adapter.c b/arch/risc-v/src/esp32c3/esp32c3_wifi_adapter.c index baec92e4e7..459ee6bf0e 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_wifi_adapter.c +++ b/arch/risc-v/src/esp32c3/esp32c3_wifi_adapter.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -92,10 +93,6 @@ # define NVS_FILE_MODE 0777 #endif -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - #define WIFI_CONNECT_TIMEOUT CONFIG_ESP32C3_WIFI_CONNECT_TIMEOUT #define WIFI_RECONNECT_COUNT (10) diff --git a/arch/risc-v/src/esp32c3/esp32c3_wifi_utils.c b/arch/risc-v/src/esp32c3/esp32c3_wifi_utils.c index 172efe9077..d08f591510 100644 --- a/arch/risc-v/src/esp32c3/esp32c3_wifi_utils.c +++ b/arch/risc-v/src/esp32c3/esp32c3_wifi_utils.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -53,10 +54,6 @@ #define SCAN_TIME_SEC (5) -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /* Maximum number of channels for Wi-Fi 2.4Ghz */ #define CHANNEL_MAX_NUM (14) diff --git a/arch/xtensa/src/esp32/esp32_clockconfig.c b/arch/xtensa/src/esp32/esp32_clockconfig.c index 27a0a0a9c6..cadddb76d6 100644 --- a/arch/xtensa/src/esp32/esp32_clockconfig.c +++ b/arch/xtensa/src/esp32/esp32_clockconfig.c @@ -23,7 +23,9 @@ ****************************************************************************/ #include + #include +#include #include "xtensa.h" #include "xtensa_attr.h" @@ -36,10 +38,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - #ifndef CONFIG_ESP_CONSOLE_UART_NUM #define CONFIG_ESP_CONSOLE_UART_NUM 0 #endif diff --git a/arch/xtensa/src/esp32/esp32_dma.c b/arch/xtensa/src/esp32/esp32_dma.c index 5c4e320b37..e5d8a39d95 100644 --- a/arch/xtensa/src/esp32/esp32_dma.c +++ b/arch/xtensa/src/esp32/esp32_dma.c @@ -25,6 +25,7 @@ #include #include +#include #include #include "hardware/esp32_dma.h" @@ -34,10 +35,6 @@ * Preprocessor Definitions ****************************************************************************/ -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - #ifndef ALIGN_UP # define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1)) #endif diff --git a/arch/xtensa/src/esp32/esp32_efuse.c b/arch/xtensa/src/esp32/esp32_efuse.c index be947ad519..27815ac045 100644 --- a/arch/xtensa/src/esp32/esp32_efuse.c +++ b/arch/xtensa/src/esp32/esp32_efuse.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include "xtensa.h" @@ -42,8 +43,6 @@ #define EFUSE_CMD_PGM 0x02 /* Command to program. */ #define EFUSE_CMD_READ 0x01 /* Command to read. */ -#define MIN(a, b) ((a) < (b) ? (a) : (b)) - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/xtensa/src/esp32/esp32_emac.c b/arch/xtensa/src/esp32/esp32_emac.c index c93b5118ef..4750ed8fd8 100644 --- a/arch/xtensa/src/esp32/esp32_emac.c +++ b/arch/xtensa/src/esp32/esp32_emac.c @@ -168,13 +168,6 @@ /* Operation ****************************************************************/ -/* Get smaller values */ - -#ifdef MIN -# undef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - /* Check if current TX description is busy */ #define TX_IS_BUSY(_priv) \ diff --git a/arch/xtensa/src/esp32/esp32_i2s.c b/arch/xtensa/src/esp32/esp32_i2s.c index 16169ce408..f39a2c3917 100644 --- a/arch/xtensa/src/esp32/esp32_i2s.c +++ b/arch/xtensa/src/esp32/esp32_i2s.c @@ -27,6 +27,7 @@ #ifdef CONFIG_ESP32_I2S #include +#include #include #include #include @@ -109,10 +110,6 @@ # define I2S1_RX_ENABLED 0 #endif -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - #ifndef ALIGN_UP # define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1)) #endif diff --git a/arch/xtensa/src/esp32/esp32_idle.c b/arch/xtensa/src/esp32/esp32_idle.c index 311511cae9..02cda6119c 100644 --- a/arch/xtensa/src/esp32/esp32_idle.c +++ b/arch/xtensa/src/esp32/esp32_idle.c @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -85,10 +86,6 @@ # define CONFIG_PM_SLEEP_WAKEUP_NSEC 0 #endif -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - #define EXPECTED_IDLE_TIME_US (800) #define EARLY_WAKEUP_US (200) diff --git a/arch/xtensa/src/esp32/esp32_ledc.c b/arch/xtensa/src/esp32/esp32_ledc.c index 66210fcb6c..d93e47645d 100644 --- a/arch/xtensa/src/esp32/esp32_ledc.c +++ b/arch/xtensa/src/esp32/esp32_ledc.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -132,10 +133,6 @@ #define SET_CHAN_BITS(c, r, b) setbits(b, LEDC_CHAN_REG(r, (c)->num)); #define SET_CHAN_REG(c, r, v) putreg32(v, LEDC_CHAN_REG(r, (c)->num)); -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/xtensa/src/esp32/esp32_partition.c b/arch/xtensa/src/esp32/esp32_partition.c index f6bc9aaf4d..15511e1862 100644 --- a/arch/xtensa/src/esp32/esp32_partition.c +++ b/arch/xtensa/src/esp32/esp32_partition.c @@ -23,8 +23,10 @@ ****************************************************************************/ #include + #include #include +#include #include #include #include @@ -80,10 +82,6 @@ #define PARTITION_FLAG_ENCRYPTED (1 << 0) -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/xtensa/src/esp32/esp32_pm.c b/arch/xtensa/src/esp32/esp32_pm.c index 4631af7702..1b36957350 100644 --- a/arch/xtensa/src/esp32/esp32_pm.c +++ b/arch/xtensa/src/esp32/esp32_pm.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include "hardware/esp32_rtccntl.h" #include "hardware/esp32_uart.h" @@ -65,10 +66,6 @@ #define LIGHT_SLEEP_MIN_TIME_US 200 -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /* Time from VDD_SDIO power up to first flash read in ROM code */ #define VDD_SDIO_POWERUP_TO_FLASH_READ_US 700 diff --git a/arch/xtensa/src/esp32/esp32_rng.c b/arch/xtensa/src/esp32/esp32_rng.c index 0d2fcc2d39..cfecced69c 100644 --- a/arch/xtensa/src/esp32/esp32_rng.c +++ b/arch/xtensa/src/esp32/esp32_rng.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -46,14 +47,6 @@ #if defined(CONFIG_ESP32_RNG) #if defined(CONFIG_DEV_RANDOM) || defined(CONFIG_DEV_URANDOM_ARCH) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/arch/xtensa/src/esp32/esp32_spi.c b/arch/xtensa/src/esp32/esp32_spi.c index 1edb011ba5..3169b3f1e6 100644 --- a/arch/xtensa/src/esp32/esp32_spi.c +++ b/arch/xtensa/src/esp32/esp32_spi.c @@ -27,6 +27,7 @@ #ifdef CONFIG_ESP32_SPI #include +#include #include #include #include @@ -108,10 +109,6 @@ #define SPI_MAX_BUF_SIZE (64) -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/xtensa/src/esp32/esp32_spi_slave.c b/arch/xtensa/src/esp32/esp32_spi_slave.c index acf5422328..24083ac26a 100644 --- a/arch/xtensa/src/esp32/esp32_spi_slave.c +++ b/arch/xtensa/src/esp32/esp32_spi_slave.c @@ -26,6 +26,7 @@ #ifdef CONFIG_ESP32_SPI +#include #include #include #include @@ -109,10 +110,6 @@ #define SPI_DMA_RESET_MASK (SPI_AHBM_RST_M | SPI_AHBM_FIFO_RST_M | \ SPI_OUT_RST_M | SPI_IN_RST_M) -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - #define WORDS2BYTES(_priv, _wn) (_wn * ((_priv)->nbits / 8)) #define BYTES2WORDS(_priv, _bn) (_bn / ((_priv)->nbits / 8)) diff --git a/arch/xtensa/src/esp32/esp32_spiflash.c b/arch/xtensa/src/esp32/esp32_spiflash.c index a987101c58..cbeccbc5d1 100644 --- a/arch/xtensa/src/esp32/esp32_spiflash.c +++ b/arch/xtensa/src/esp32/esp32_spiflash.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -91,10 +92,6 @@ & ~(SPI_FLASH_MMU_PAGE_SIZE - 1)) #define MMU_ALIGNDOWN_SIZE(_s) ((_s) & ~(SPI_FLASH_MMU_PAGE_SIZE - 1)) -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /* Flash MMU table for PRO CPU */ #define PRO_MMU_TABLE ((volatile uint32_t *)DPORT_PRO_FLASH_MMU_TABLE_REG) diff --git a/arch/xtensa/src/esp32/esp32_wifi_adapter.c b/arch/xtensa/src/esp32/esp32_wifi_adapter.c index 7183d3ff13..96220b6ec5 100644 --- a/arch/xtensa/src/esp32/esp32_wifi_adapter.c +++ b/arch/xtensa/src/esp32/esp32_wifi_adapter.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -85,10 +86,6 @@ # define NVS_FILE_MODE 0777 #endif -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - #define WIFI_CONNECT_TIMEOUT CONFIG_ESP32_WIFI_CONNECT_TIMEOUT #define TIMER_INITIALIZED_VAL (0x5aa5a55a) diff --git a/arch/xtensa/src/esp32/esp32_wifi_utils.c b/arch/xtensa/src/esp32/esp32_wifi_utils.c index f7e8c28538..a081c0a7b2 100644 --- a/arch/xtensa/src/esp32/esp32_wifi_utils.c +++ b/arch/xtensa/src/esp32/esp32_wifi_utils.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -54,10 +55,6 @@ #define SCAN_TIME_SEC (5) #define SSID_LEN (33) -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /* Maximum number of channels for Wi-Fi 2.4Ghz */ #define CHANNEL_MAX_NUM (14) diff --git a/arch/xtensa/src/esp32s2/esp32s2_clockconfig.c b/arch/xtensa/src/esp32s2/esp32s2_clockconfig.c index a8a4a7cb3e..d722fec970 100644 --- a/arch/xtensa/src/esp32s2/esp32s2_clockconfig.c +++ b/arch/xtensa/src/esp32s2/esp32s2_clockconfig.c @@ -23,7 +23,9 @@ ****************************************************************************/ #include + #include +#include #include "xtensa.h" #include "xtensa_attr.h" @@ -36,10 +38,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - #ifndef CONFIG_ESP_CONSOLE_UART_NUM #define CONFIG_ESP_CONSOLE_UART_NUM 0 #endif diff --git a/arch/xtensa/src/esp32s2/esp32s2_dma.c b/arch/xtensa/src/esp32s2/esp32s2_dma.c index 127159448f..5748b61e54 100644 --- a/arch/xtensa/src/esp32s2/esp32s2_dma.c +++ b/arch/xtensa/src/esp32s2/esp32s2_dma.c @@ -25,6 +25,7 @@ #include #include +#include #include #include "hardware/esp32s2_dma.h" @@ -34,10 +35,6 @@ * Preprocessor Definitions ****************************************************************************/ -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - #ifndef ALIGN_UP # define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1)) #endif diff --git a/arch/xtensa/src/esp32s2/esp32s2_efuse.c b/arch/xtensa/src/esp32s2/esp32s2_efuse.c index 10b547cddd..383fd520cf 100644 --- a/arch/xtensa/src/esp32s2/esp32s2_efuse.c +++ b/arch/xtensa/src/esp32s2/esp32s2_efuse.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -46,8 +47,6 @@ #define EFUSE_CMD_READ 0x01 /* Command to read. */ #define EFUSE_MAX_BLK_LEN 256 /* Max length of efuse block. */ -#define MIN(a, b) ((a) < (b) ? (a) : (b)) - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/xtensa/src/esp32s2/esp32s2_rng.c b/arch/xtensa/src/esp32s2/esp32s2_rng.c index 54b19ba6dc..8d5086314e 100644 --- a/arch/xtensa/src/esp32s2/esp32s2_rng.c +++ b/arch/xtensa/src/esp32s2/esp32s2_rng.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -47,14 +48,6 @@ #if defined(CONFIG_ESP32S2_RNG) #if defined(CONFIG_DEV_RANDOM) || defined(CONFIG_DEV_URANDOM_ARCH) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/arch/xtensa/src/esp32s2/esp32s2_spi.c b/arch/xtensa/src/esp32s2/esp32s2_spi.c index 36c823a9a3..4606b191a0 100644 --- a/arch/xtensa/src/esp32s2/esp32s2_spi.c +++ b/arch/xtensa/src/esp32s2/esp32s2_spi.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -99,10 +100,6 @@ #define SPI_MAX_BUF_SIZE (64) -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/arch/xtensa/src/esp32s3/esp32s3_clockconfig.c b/arch/xtensa/src/esp32s3/esp32s3_clockconfig.c index 2a218d7a4b..f5c42c1162 100644 --- a/arch/xtensa/src/esp32s3/esp32s3_clockconfig.c +++ b/arch/xtensa/src/esp32s3/esp32s3_clockconfig.c @@ -23,7 +23,9 @@ ****************************************************************************/ #include + #include +#include #include "xtensa.h" #include "xtensa_attr.h" @@ -35,10 +37,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MIN - #define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - #define DEFAULT_CPU_FREQ 80 /**************************************************************************** diff --git a/arch/xtensa/src/esp32s3/esp32s3_dma.c b/arch/xtensa/src/esp32s3/esp32s3_dma.c index 118d961890..ed90ab7110 100644 --- a/arch/xtensa/src/esp32s3/esp32s3_dma.c +++ b/arch/xtensa/src/esp32s3/esp32s3_dma.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -55,10 +56,6 @@ #define SET_BITS(_r, _ch, _b) modifyreg32((_r) + (_ch) * REG_OFF, 0, (_b)) #define CLR_BITS(_r, _ch, _b) modifyreg32((_r) + (_ch) * REG_OFF, (_b), 0) -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - #ifndef ALIGN_UP # define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1)) #endif diff --git a/arch/xtensa/src/esp32s3/esp32s3_efuse.c b/arch/xtensa/src/esp32s3/esp32s3_efuse.c index 4f78bb0b05..fe138056cd 100644 --- a/arch/xtensa/src/esp32s3/esp32s3_efuse.c +++ b/arch/xtensa/src/esp32s3/esp32s3_efuse.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -46,8 +47,6 @@ #define EFUSE_CMD_READ 0x01 /* Command to read. */ #define EFUSE_MAX_BLK_LEN 256 /* Max length of efuse block. */ -#define MIN(a, b) ((a) < (b) ? (a) : (b)) - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/arch/xtensa/src/esp32s3/esp32s3_rng.c b/arch/xtensa/src/esp32s3/esp32s3_rng.c index 7c23b2b9f9..3671a521ec 100644 --- a/arch/xtensa/src/esp32s3/esp32s3_rng.c +++ b/arch/xtensa/src/esp32s3/esp32s3_rng.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -47,14 +48,6 @@ #if defined(CONFIG_ESP32S3_RNG) #if defined(CONFIG_DEV_RANDOM) || defined(CONFIG_DEV_URANDOM_ARCH) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/arch/xtensa/src/esp32s3/esp32s3_spi.c b/arch/xtensa/src/esp32s3/esp32s3_spi.c index cd9d9dba71..9cb529f684 100644 --- a/arch/xtensa/src/esp32s3/esp32s3_spi.c +++ b/arch/xtensa/src/esp32s3/esp32s3_spi.c @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -105,10 +106,6 @@ #define SPI_MAX_BUF_SIZE (64) -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/audio/pcm_decode.c b/audio/pcm_decode.c index 15a4116632..69a30c59c7 100644 --- a/audio/pcm_decode.c +++ b/audio/pcm_decode.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -48,16 +49,6 @@ #define CONFIG_PCM_DEBUG 1 /* For now */ -/* Often defined and re-defined macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/binfmt/elf.c b/binfmt/elf.c index 6fb0371a54..1fc2717ca6 100644 --- a/binfmt/elf.c +++ b/binfmt/elf.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -60,10 +61,6 @@ # define elf_dumpbuffer(m,b,n) #endif -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/binfmt/libelf/libelf_load.c b/binfmt/libelf/libelf_load.c index ce235f29a3..010714c57c 100644 --- a/binfmt/libelf/libelf_load.c +++ b/binfmt/libelf/libelf_load.c @@ -24,6 +24,7 @@ #include +#include #include #include @@ -49,14 +50,6 @@ #define ELF_ALIGNUP(a) (((unsigned long)(a) + ELF_ALIGN_MASK) & ~ELF_ALIGN_MASK) #define ELF_ALIGNDOWN(a) ((unsigned long)(a) & ~ELF_ALIGN_MASK) -#ifndef MAX -# define MAX(x,y) ((x) > (y) ? (x) : (y)) -#endif - -#ifndef MIN -# define MIN(x,y) ((x) < (y) ? (x) : (y)) -#endif - /* _ALIGN_UP: 'a' is assumed to be a power of two */ #define _ALIGN_UP(v, a) (((v) + ((a) - 1)) & ~((a) - 1)) diff --git a/binfmt/libnxflat/libnxflat_addrenv.c b/binfmt/libnxflat/libnxflat_addrenv.c index 97409e1e45..cb120cb300 100644 --- a/binfmt/libnxflat/libnxflat_addrenv.c +++ b/binfmt/libnxflat/libnxflat_addrenv.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -34,14 +35,6 @@ #include "libnxflat.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(x,y) ((x) < (y) ? (x) : (y)) -#endif - /**************************************************************************** * Private Constant Data ****************************************************************************/ diff --git a/binfmt/libnxflat/libnxflat_load.c b/binfmt/libnxflat/libnxflat_load.c index ffbc24c47c..3a2c6c2063 100644 --- a/binfmt/libnxflat/libnxflat_load.c +++ b/binfmt/libnxflat/libnxflat_load.c @@ -24,6 +24,7 @@ #include +#include #include #include @@ -40,14 +41,6 @@ #include "libnxflat.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MAX -#define MAX(x,y) ((x) > (y) ? (x) : (y)) -#endif - /**************************************************************************** * Private Constant Data ****************************************************************************/ diff --git a/binfmt/nxflat.c b/binfmt/nxflat.c index 46fcff828c..b69914774a 100644 --- a/binfmt/nxflat.c +++ b/binfmt/nxflat.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -57,10 +58,6 @@ # define nxflat_dumpbuffer(m,b,n) #endif -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c index 6c41455eae..41eff6c9ad 100644 --- a/boards/arm/cxd56xx/common/src/cxd56_imageproc.c +++ b/boards/arm/cxd56xx/common/src/cxd56_imageproc.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -127,10 +128,6 @@ #define FIXEDSRC (1 << 14) #define MSBFIRST (1 << 13) -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor.c b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor.c index ee086d5d08..5adf0726ba 100644 --- a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor.c +++ b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor.c @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -42,8 +43,6 @@ #define NOR_PAGE_SIZE 0x0100U #define NOR_SECTOR_SIZE 0x1000U -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) - enum { /* SPI instructions */ diff --git a/boards/arm/sam34/sam4l-xplained/src/sam_slcd.c b/boards/arm/sam34/sam4l-xplained/src/sam_slcd.c index 7e0ac91777..5350d3de42 100644 --- a/boards/arm/sam34/sam4l-xplained/src/sam_slcd.c +++ b/boards/arm/sam34/sam4l-xplained/src/sam_slcd.c @@ -28,6 +28,7 @@ #include +#include #include #include #include @@ -68,16 +69,6 @@ # error CONFIG_SAM34_RC32K be selected in the board configuration #endif -/* The ever-present MIN/MAX macros ******************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* LCD **********************************************************************/ /* LCD characteristics. The logic in this driver is not portable; it is diff --git a/boards/arm/stm32/stm3210e-eval/src/stm32_pmbuttons.c b/boards/arm/stm32/stm3210e-eval/src/stm32_pmbuttons.c index 078aa259ef..2e964b4832 100644 --- a/boards/arm/stm32/stm3210e-eval/src/stm32_pmbuttons.c +++ b/boards/arm/stm32/stm3210e-eval/src/stm32_pmbuttons.c @@ -30,6 +30,7 @@ #include #include +#include #include #include "arm_internal.h" @@ -98,14 +99,6 @@ /* Miscellaneous Definitions ************************************************/ -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - #define MIN_BUTTON MIN(CONFIG_PM_BUTTONS_MIN, CONFIG_PM_IRQBUTTONS_MIN) #define MAX_BUTTON MAX(CONFIG_PM_BUTTONS_MAX, CONFIG_PM_IRQBUTTONS_MAX) diff --git a/boards/arm/stm32/stm32ldiscovery/src/stm32_lcd.c b/boards/arm/stm32/stm32ldiscovery/src/stm32_lcd.c index 64afa285ee..965b32b2c6 100644 --- a/boards/arm/stm32/stm32ldiscovery/src/stm32_lcd.c +++ b/boards/arm/stm32/stm32ldiscovery/src/stm32_lcd.c @@ -33,6 +33,7 @@ #include +#include #include #include #include @@ -71,16 +72,6 @@ # error "This SLCD driver requires CONFIG_LIBC_SLCDCODEC" #endif -/* The ever-present MIN/MAX macros ******************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* LCD **********************************************************************/ /* LCD. The STM32L152RBT6 supports either a 4x32 or 8x28. The STM32L- diff --git a/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_lcd1602.c b/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_lcd1602.c index 0495e09f11..b8a6c1da61 100644 --- a/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_lcd1602.c +++ b/boards/mips/pic32mx/sure-pic32mx/src/pic32mx_lcd1602.c @@ -57,6 +57,7 @@ #include +#include #include #include #include @@ -97,16 +98,6 @@ # define CONFIG_LCD_MAXPOWER 100 #endif -/* The ever-present MIN/MAX macros ******************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* LCD **********************************************************************/ #define LCD_NROWS 2 diff --git a/crypto/cmac.c b/crypto/cmac.c index fc6f3b4168..ce4b7ea450 100644 --- a/crypto/cmac.c +++ b/crypto/cmac.c @@ -31,10 +31,6 @@ #include #include -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - #define LSHIFT(v, r) do \ { \ int i; \ diff --git a/crypto/cryptosoft.c b/crypto/cryptosoft.c index 2ad6671bf5..5a88569c59 100644 --- a/crypto/cryptosoft.c +++ b/crypto/cryptosoft.c @@ -32,6 +32,7 @@ #include #include #include +#include /**************************************************************************** * Pre-processor Definitions @@ -41,8 +42,6 @@ # define howmany(x, y) (((x) + ((y) - 1)) / (y)) #endif -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) - /**************************************************************************** * Private Data ****************************************************************************/ diff --git a/crypto/random_pool.c b/crypto/random_pool.c index 086b1d8f6b..88b655d1ee 100644 --- a/crypto/random_pool.c +++ b/crypto/random_pool.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -41,10 +42,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - #define ROTL_32(x,n) (((x) << (n)) | ((x) >> (32 - (n)))) #define ROTR_32(x,n) (((x) >> (n)) | ((x) << (32 - (n)))) diff --git a/drivers/audio/cs43l22.h b/drivers/audio/cs43l22.h index a697fd9d94..125eb36114 100644 --- a/drivers/audio/cs43l22.h +++ b/drivers/audio/cs43l22.h @@ -31,6 +31,9 @@ ****************************************************************************/ #include + +#include + #include #include @@ -291,16 +294,6 @@ #define CS43L22_FRAMELEN8 14 /* Bits per frame for 8-bit data */ #define CS43L22_FRAMELEN16 32 /* Bits per frame for 16-bit data */ -/* Commonly defined and redefined macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/drivers/audio/wm8904.h b/drivers/audio/wm8904.h index d92840eb65..2cb58445ec 100644 --- a/drivers/audio/wm8904.h +++ b/drivers/audio/wm8904.h @@ -31,6 +31,9 @@ ****************************************************************************/ #include + +#include + #include #include @@ -1053,16 +1056,6 @@ #define WM8904_FRAMELEN8 14 /* Bits per frame for 8-bit data */ #define WM8904_FRAMELEN16 32 /* Bits per frame for 16-bit data */ -/* Commonly defined and redefined macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/drivers/audio/wm8994.h b/drivers/audio/wm8994.h index 5289753692..59248b3b4e 100644 --- a/drivers/audio/wm8994.h +++ b/drivers/audio/wm8994.h @@ -26,6 +26,9 @@ ****************************************************************************/ #include + +#include + #include #include @@ -1785,16 +1788,6 @@ #define WM8994_FRAMELEN8 16 /* Bits per frame for 8-bit data */ #define WM8994_FRAMELEN16 32 /* Bits per frame for 16-bit data */ -/* Commonly defined and redefined macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/drivers/clk/clk.h b/drivers/clk/clk.h index e5ac0a64cc..d005021f6b 100644 --- a/drivers/clk/clk.h +++ b/drivers/clk/clk.h @@ -29,6 +29,7 @@ #include #include +#include #ifdef CONFIG_CLK @@ -42,7 +43,6 @@ #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) #define DIV_ROUND_CLOSEST(n, d) ((((n) < 0) ^ ((d) < 0)) ? \ (((n) - (d)/2)/(d)) : (((n) + (d)/2)/(d))) -#define MIN(x, y) (x < y) ? x : y /**************************************************************************** * Inline Functions diff --git a/drivers/ioexpander/pcf8574.c b/drivers/ioexpander/pcf8574.c index cf1a469b5c..627d94aafb 100644 --- a/drivers/ioexpander/pcf8574.c +++ b/drivers/ioexpander/pcf8574.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -37,18 +38,6 @@ #ifdef CONFIG_IOEXPANDER_PCF8574 -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/drivers/ioexpander/tca64xx.c b/drivers/ioexpander/tca64xx.c index 40347c929d..e901fbb52b 100644 --- a/drivers/ioexpander/tca64xx.c +++ b/drivers/ioexpander/tca64xx.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -37,18 +38,6 @@ #ifdef CONFIG_IOEXPANDER_TCA64XX -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/drivers/lcd/apa102.c b/drivers/lcd/apa102.c index d803fa7c21..0bc1b7ab6b 100644 --- a/drivers/lcd/apa102.c +++ b/drivers/lcd/apa102.c @@ -26,6 +26,7 @@ #include +#include #include #include #include @@ -44,10 +45,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /* Configuration ************************************************************/ /* APA102 Configuration Settings: diff --git a/drivers/lcd/st7735.c b/drivers/lcd/st7735.c index bbb2835182..7bd47459f8 100644 --- a/drivers/lcd/st7735.c +++ b/drivers/lcd/st7735.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -45,10 +46,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /* Verify that all configuration requirements have been met */ #ifndef CONFIG_LCD_ST7735_SPIMODE diff --git a/drivers/modem/alt1250/altcom_hdlr.c b/drivers/modem/alt1250/altcom_hdlr.c index ecefaf9012..67201621c2 100644 --- a/drivers/modem/alt1250/altcom_hdlr.c +++ b/drivers/modem/alt1250/altcom_hdlr.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -52,10 +53,6 @@ # define ARRAY_SZ(array) (sizeof(array)/sizeof(array[0])) #endif -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - #define ALTCOM_GETEDRX_TYPE_UE 0 #define ALTCOM_GETEDRX_TYPE_NEGOTIATED 1 #define ALTCOM_GETPSM_TYPE_UE 0 diff --git a/drivers/mtd/filemtd.c b/drivers/mtd/filemtd.c index b61f87f4b6..e989ae3d1d 100644 --- a/drivers/mtd/filemtd.c +++ b/drivers/mtd/filemtd.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -42,10 +43,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /* Configuration ************************************************************/ #ifndef CONFIG_FILEMTD_BLOCKSIZE diff --git a/drivers/mtd/mtd_config_fs.c b/drivers/mtd/mtd_config_fs.c index 3fb8f544a0..e20b7246b6 100644 --- a/drivers/mtd/mtd_config_fs.c +++ b/drivers/mtd/mtd_config_fs.c @@ -29,6 +29,8 @@ ****************************************************************************/ #include + +#include #include #include #include @@ -46,8 +48,6 @@ * Pre-processor Definitions ****************************************************************************/ -#define MIN(a, b) ((a) > (b) ? (b) : (a)) - /* MASKS AND SHIFT FOR ADDRESSES * an address in nvs is an uint32_t where: * high 2 bytes represent the block number diff --git a/drivers/power/battery/bq769x0.c b/drivers/power/battery/bq769x0.c index 86ae6fb37a..d4e29545b3 100644 --- a/drivers/power/battery/bq769x0.c +++ b/drivers/power/battery/bq769x0.c @@ -32,6 +32,7 @@ #include +#include #include #include @@ -63,12 +64,6 @@ * Pre-processor Definitions ****************************************************************************/ -/* Helpers ******************************************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /* The CRC function expects to see address bytes as they appear on the wire */ #define WR_ADDR(a) ((a) << 1) diff --git a/drivers/rc/lirc_dev.c b/drivers/rc/lirc_dev.c index 0cb65fc3c4..ddde340d3c 100644 --- a/drivers/rc/lirc_dev.c +++ b/drivers/rc/lirc_dev.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -40,7 +41,6 @@ * Pre-processor Definitions ****************************************************************************/ -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) #define DEVNAME_FMT "/dev/lirc%d" #define DEVNAME_MAX 32 diff --git a/drivers/rptun/rptun.c b/drivers/rptun/rptun.c index 644a192399..5d913da60a 100644 --- a/drivers/rptun/rptun.c +++ b/drivers/rptun/rptun.c @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -46,10 +47,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - #ifndef ALIGN_UP # define ALIGN_UP(s, a) (((s) + (a) - 1) & ~((a) - 1)) #endif diff --git a/drivers/rptun/rptun_ping.c b/drivers/rptun/rptun_ping.c index 1f7a11a129..48ef2177b4 100644 --- a/drivers/rptun/rptun_ping.c +++ b/drivers/rptun/rptun_ping.c @@ -27,6 +27,7 @@ #include #include +#include #include "rptun.h" @@ -34,14 +35,6 @@ * Pre-processor definitions ****************************************************************************/ -#ifndef MIN - #define MIN(n,m) (((n) < (m)) ? (n) : (m)) -#endif - -#ifndef MAX - #define MAX(n,m) (((n) < (m)) ? (m) : (n)) -#endif - #define RPTUN_PING_EPT_NAME "rpmsg-ping" #define RPTUN_PING_SEND 1 #define RPTUN_PING_SEND_NOACK 2 diff --git a/drivers/spi/spi_slave_driver.c b/drivers/spi/spi_slave_driver.c index bcf454379a..2a8afeca03 100644 --- a/drivers/spi/spi_slave_driver.c +++ b/drivers/spi/spi_slave_driver.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -48,10 +49,6 @@ #define DEVNAME_FMT "/dev/spislv%d" #define DEVNAME_FMTLEN (11 + 3 + 1) -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - #define WORDS2BYTES(_wn) ((_wn) * (CONFIG_SPI_SLAVE_DRIVER_WIDTH / 8)) #define BYTES2WORDS(_bn) ((_bn) / (CONFIG_SPI_SLAVE_DRIVER_WIDTH / 8)) diff --git a/drivers/usbdev/cdcacm.h b/drivers/usbdev/cdcacm.h index 53d69a84f1..6e97148ef8 100644 --- a/drivers/usbdev/cdcacm.h +++ b/drivers/usbdev/cdcacm.h @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -165,18 +166,6 @@ #define CDCACM_DEVNAME_FORMAT "/dev/ttyACM%d" #define CDCACM_DEVNAME_SIZE 16 -/* Misc Macros **************************************************************/ - -/* MIN/MAX macros */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Trace values *************************************************************/ #define CDCACM_CLASSAPI_SETUP TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_SETUP) diff --git a/drivers/usbdev/cdcecm.h b/drivers/usbdev/cdcecm.h index 404deaebe7..8888626a71 100644 --- a/drivers/usbdev/cdcecm.h +++ b/drivers/usbdev/cdcecm.h @@ -28,6 +28,7 @@ #include #include +#include #include @@ -57,8 +58,4 @@ #define CDCECM_SELFPOWERED (0) #define CDCECM_REMOTEWAKEUP (0) -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - #endif /* __DRIVERS_USBDEV_CDCECM_H */ diff --git a/drivers/usbdev/composite.h b/drivers/usbdev/composite.h index bfee671565..41c02c016a 100644 --- a/drivers/usbdev/composite.h +++ b/drivers/usbdev/composite.h @@ -27,6 +27,7 @@ #include +#include #include #include @@ -114,16 +115,6 @@ #define COMPOSITE_SERIALSTRID (3) #define COMPOSITE_CONFIGSTRID (4) -/* Everpresent MIN/MAX macros ***********************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/drivers/usbdev/usbmsc.h b/drivers/usbdev/usbmsc.h index ce12644ced..2c501dbe06 100644 --- a/drivers/usbdev/usbmsc.h +++ b/drivers/usbdev/usbmsc.h @@ -29,6 +29,7 @@ #include +#include #include #include #include @@ -334,16 +335,6 @@ #define USBMSC_DRVR_GEOMETRY(l,g) \ ((l)->inode->u.i_bops->geometry((l)->inode,g)) -/* Everpresent MIN/MAX macros ***********************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/drivers/usbhost/usbhost_max3421e.c b/drivers/usbhost/usbhost_max3421e.c index f8bf055c43..1258fac983 100644 --- a/drivers/usbhost/usbhost_max3421e.c +++ b/drivers/usbhost/usbhost_max3421e.c @@ -31,6 +31,7 @@ #include +#include #include #include #include @@ -112,16 +113,6 @@ #define MAX3421E_DATANAK_DELAY SEC2TICK(5) /* 5 seconds in system ticks */ #define MAX3421E_RETRY_COUNT 5 /* Number of tries before giving up */ -/* Ever-present MIN/MAX macros */ - -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - #define NO_HOLDER (INVALID_PROCESS_ID) /* Debug ********************************************************************/ diff --git a/drivers/video/vnc/vnc_server.h b/drivers/video/vnc/vnc_server.h index 8f59b03abd..26af7ca2a7 100644 --- a/drivers/video/vnc/vnc_server.h +++ b/drivers/video/vnc/vnc_server.h @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -149,16 +150,6 @@ #define RFB_MAX_DISPLAYS CONFIG_VNCSERVER_NDISPLAYS #define RFB_DISPLAY_PORT(d) (RFB_PORT_BASE + (d)) -/* Miscellaneous */ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Debug */ #ifdef CONFIG_VNCSERVER_UPDATE_DEBUG diff --git a/drivers/wireless/gs2200m.c b/drivers/wireless/gs2200m.c index 060e3a83ad..1a2e5864ab 100644 --- a/drivers/wireless/gs2200m.c +++ b/drivers/wireless/gs2200m.c @@ -33,6 +33,7 @@ #include +#include #include #include #include @@ -63,10 +64,6 @@ # error "Worker thread support is required (CONFIG_SCHED_WORKQUEUE)" #endif -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - #define GS2200MWORK LPWORK #define SPI_MAXFREQ CONFIG_WL_GS2200M_SPI_FREQUENCY diff --git a/fs/fat/fs_fat32dirent.c b/fs/fat/fs_fat32dirent.c index 5138183363..b36f547dfa 100644 --- a/fs/fat/fs_fat32dirent.c +++ b/fs/fat/fs_fat32dirent.c @@ -54,6 +54,7 @@ #include +#include #include #include @@ -71,14 +72,6 @@ #include "inode/inode.h" #include "fs_fat32.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/fs/nxffs/nxffs.h b/fs/nxffs/nxffs.h index 035b9abd71..4569b4f310 100644 --- a/fs/nxffs/nxffs.h +++ b/fs/nxffs/nxffs.h @@ -27,6 +27,7 @@ #include +#include #include #include #include @@ -171,16 +172,6 @@ #define NXFFS_NERASED 128 -/* Quasi-standard definitions */ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/fs/procfs/fs_procfsutil.c b/fs/procfs/fs_procfsutil.c index ff7cbe4bb8..f093f74f99 100644 --- a/fs/procfs/fs_procfsutil.c +++ b/fs/procfs/fs_procfsutil.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -32,14 +33,6 @@ #if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_PROCFS) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/fs/spiffs/src/spiffs_core.h b/fs/spiffs/src/spiffs_core.h index 405420db0c..1c4065b949 100644 --- a/fs/spiffs/src/spiffs_core.h +++ b/fs/spiffs/src/spiffs_core.h @@ -50,6 +50,7 @@ #include #include +#include #include "spiffs.h" #include "spiffs_mtd.h" @@ -369,14 +370,6 @@ #define SPIFFS_VIS_NO_WRAP (1<<2) -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/fs/spiffs/src/spiffs_mtd.h b/fs/spiffs/src/spiffs_mtd.h index 9580346cdd..e8e271e8a3 100644 --- a/fs/spiffs/src/spiffs_mtd.h +++ b/fs/spiffs/src/spiffs_mtd.h @@ -32,6 +32,8 @@ extern "C" #include +#include + #include /**************************************************************************** @@ -59,16 +61,6 @@ extern "C" # define spiffs_mtdinfo _none #endif -/* Commonly used Macros */ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Public Function Prototypes ****************************************************************************/ diff --git a/fs/unionfs/fs_unionfs.c b/fs/unionfs/fs_unionfs.c index bf0c642cff..69986a2c97 100644 --- a/fs/unionfs/fs_unionfs.c +++ b/fs/unionfs/fs_unionfs.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -49,15 +50,6 @@ #if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_UNIONFS) -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#undef MIN -#undef MAX -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#define MAX(a,b) (((a) > (b)) ? (a) : (b)) - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/graphics/nxbe/nxbe_filltrapezoid.c b/graphics/nxbe/nxbe_filltrapezoid.c index 0dbe73f6c5..060ff9ee8a 100644 --- a/graphics/nxbe/nxbe_filltrapezoid.c +++ b/graphics/nxbe/nxbe_filltrapezoid.c @@ -26,23 +26,12 @@ #include #include +#include #include #include "nxbe.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Types ****************************************************************************/ diff --git a/graphics/nxbe/nxbe_setsize.c b/graphics/nxbe/nxbe_setsize.c index 6a05f506df..486995f262 100644 --- a/graphics/nxbe/nxbe_setsize.c +++ b/graphics/nxbe/nxbe_setsize.c @@ -26,6 +26,7 @@ #include #include +#include #ifdef CONFIG_NX_RAMBACKED # include @@ -41,18 +42,6 @@ #include "nxbe.h" #include "nxmu.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/include/nuttx/net/netconfig.h b/include/nuttx/net/netconfig.h index 1aade785a9..e9f3839408 100644 --- a/include/nuttx/net/netconfig.h +++ b/include/nuttx/net/netconfig.h @@ -52,22 +52,17 @@ * Included Files ****************************************************************************/ -#include #include + +#include +#include + #include /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /* Using the following definitions, the following socket() arguments should * provide a valid socket in all configurations: * diff --git a/libs/libc/fixedmath/lib_b16atan2.c b/libs/libc/fixedmath/lib_b16atan2.c index beb135ad4a..f25f9b2ee7 100644 --- a/libs/libc/fixedmath/lib_b16atan2.c +++ b/libs/libc/fixedmath/lib_b16atan2.c @@ -23,6 +23,7 @@ ****************************************************************************/ #include +#include /**************************************************************************** * Pre-processor Definitions @@ -37,14 +38,6 @@ #define B16_HALFPI 0x00019220 /* 1.570796327 */ #define B16_PI 0x00032440 /* 3.141592654 */ -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - #ifndef ABS # define ABS(a) ((a) < 0 ? -(a) : (a)) #endif diff --git a/libs/libc/modlib/modlib_load.c b/libs/libc/modlib/modlib_load.c index 049a655f28..cae7664fd9 100644 --- a/libs/libc/modlib/modlib_load.c +++ b/libs/libc/modlib/modlib_load.c @@ -24,6 +24,7 @@ #include +#include #include #include @@ -47,14 +48,6 @@ #define ELF_ALIGNUP(a) (((unsigned long)(a) + ELF_ALIGN_MASK) & ~ELF_ALIGN_MASK) #define ELF_ALIGNDOWN(a) ((unsigned long)(a) & ~ELF_ALIGN_MASK) -#ifndef MAX -# define MAX(x,y) ((x) > (y) ? (x) : (y)) -#endif - -#ifndef MIN -# define MIN(x,y) ((x) < (y) ? (x) : (y)) -#endif - /* _ALIGN_UP: 'a' is assumed to be a power of two */ #define _ALIGN_UP(v, a) (((v) + ((a) - 1)) & ~((a) - 1)) diff --git a/libs/libc/stdio/lib_dtoa_engine.c b/libs/libc/stdio/lib_dtoa_engine.c index f508bb2a2d..51e9b3902c 100644 --- a/libs/libc/stdio/lib_dtoa_engine.c +++ b/libs/libc/stdio/lib_dtoa_engine.c @@ -39,6 +39,8 @@ #include +#include + #include "lib_dtoa_engine.h" /**************************************************************************** @@ -56,9 +58,6 @@ #define MIN_MANT_INT ((uint64_t)MIN_MANT) #define MIN_MANT_EXP DBL_DIG -#define MAX(a, b) ((a) > (b) ? (a) : (b)) -#define MIN(a, b) ((a) < (b) ? (a) : (b)) - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/libs/libc/stdio/lib_libdtoa.c b/libs/libc/stdio/lib_libdtoa.c index 7f8890df31..e9f6336651 100644 --- a/libs/libc/stdio/lib_libdtoa.c +++ b/libs/libc/stdio/lib_libdtoa.c @@ -47,6 +47,7 @@ #include #include +#include #include #include @@ -58,14 +59,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /* Use the maximim precision with %g format if no precision is specified. * NOTE: This may result in numbers with precision that exceeds the * precision of type double. diff --git a/libs/libc/unistd/lib_sethostname.c b/libs/libc/unistd/lib_sethostname.c index 8e9c850fd1..4573622243 100644 --- a/libs/libc/unistd/lib_sethostname.c +++ b/libs/libc/unistd/lib_sethostname.c @@ -42,6 +42,7 @@ #include #include +#include #include #include @@ -58,18 +59,6 @@ * Pre-processor Definitions ****************************************************************************/ -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/mm/iob/iob_clone.c b/mm/iob/iob_clone.c index 90154cd2ee..166c9692c9 100644 --- a/mm/iob/iob_clone.c +++ b/mm/iob/iob_clone.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -33,14 +34,6 @@ #include "iob.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Static Functions ****************************************************************************/ diff --git a/mm/iob/iob_contig.c b/mm/iob/iob_contig.c index 97d4e4c473..3d678189f4 100644 --- a/mm/iob/iob_contig.c +++ b/mm/iob/iob_contig.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -33,14 +34,6 @@ #include "iob.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/mm/iob/iob_copyout.c b/mm/iob/iob_copyout.c index a32e777d10..58e06e874d 100644 --- a/mm/iob/iob_copyout.c +++ b/mm/iob/iob_copyout.c @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -32,14 +33,6 @@ #include "iob.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/mm/iob/iob_dump.c b/mm/iob/iob_dump.c index 1035cc9e38..b33788fa7e 100644 --- a/mm/iob/iob_dump.c +++ b/mm/iob/iob_dump.c @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -37,10 +38,6 @@ * Pre-processor definitions ****************************************************************************/ -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - #define IOB_NITEMS 32 /* 32 bytes displayed per line */ #define IOB_LINESIZE (3 * IOB_NITEMS + 4) /* 2 hex chars, ASCII char, 3 spaces, NUL */ diff --git a/mm/mempool/mempool_multiple.c b/mm/mempool/mempool_multiple.c index 119581c969..9e28212917 100644 --- a/mm/mempool/mempool_multiple.c +++ b/mm/mempool/mempool_multiple.c @@ -23,6 +23,8 @@ ****************************************************************************/ #include +#include + #include #include #include @@ -31,7 +33,6 @@ * Pre-processor Definitions ****************************************************************************/ -#define MIN(a, b) ((a) < (b) ? (a) : (b)) #undef ALIGN_UP #define ALIGN_UP(x, a) ((((size_t)x) + ((a) - 1)) & (~((a) - 1))) #undef ALIGN_DOWN diff --git a/mm/mm_heap/mm_realloc.c b/mm/mm_heap/mm_realloc.c index 2b0add69fd..28fbee2dd7 100644 --- a/mm/mm_heap/mm_realloc.c +++ b/mm/mm_heap/mm_realloc.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -34,12 +35,6 @@ #include "mm_heap/mm.h" #include "kasan/kasan.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define MIN(x, y) ((x) < (y) ? (x) : (y)) - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/mm/tlsf/mm_tlsf.c b/mm/tlsf/mm_tlsf.c index 7e3ab3093b..c7476a1c77 100644 --- a/mm/tlsf/mm_tlsf.c +++ b/mm/tlsf/mm_tlsf.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -54,8 +55,6 @@ # define MM_PTR_FMT_WIDTH 19 #endif -#define MIN(x, y) ((x) < (y) ? (x) : (y)) - #if CONFIG_MM_HEAP_MEMPOOL_THRESHOLD != 0 # define MEMPOOL_NPOOLS (CONFIG_MM_HEAP_MEMPOOL_THRESHOLD / tlsf_align_size()) #endif diff --git a/net/local/local_recvmsg.c b/net/local/local_recvmsg.c index c775b37229..d2a1f7eb6b 100644 --- a/net/local/local_recvmsg.c +++ b/net/local/local_recvmsg.c @@ -25,6 +25,7 @@ #include #if defined(CONFIG_NET) && defined(CONFIG_NET_LOCAL) +#include #include #include #include @@ -40,14 +41,6 @@ #include "socket/socket.h" #include "local/local.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/net/rpmsg/rpmsg_sockif.c b/net/rpmsg/rpmsg_sockif.c index 3852be3d2b..a7402dc6a5 100644 --- a/net/rpmsg/rpmsg_sockif.c +++ b/net/rpmsg/rpmsg_sockif.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -46,10 +47,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - #define RPMSG_SOCKET_CMD_SYNC 1 #define RPMSG_SOCKET_CMD_DATA 2 #define RPMSG_SOCKET_NAME_PREFIX "rpmsg-socket:" diff --git a/sched/module/mod_insmod.c b/sched/module/mod_insmod.c index e8371e8d5c..44023c3294 100644 --- a/sched/module/mod_insmod.c +++ b/sched/module/mod_insmod.c @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -38,14 +39,6 @@ #ifdef CONFIG_MODULE -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/sched/sched/sched_roundrobin.c b/sched/sched/sched_roundrobin.c index b78e5efb20..b05b34fbdb 100644 --- a/sched/sched/sched_roundrobin.c +++ b/sched/sched/sched_roundrobin.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -36,18 +37,6 @@ #if CONFIG_RR_INTERVAL > 0 -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/sched/sched/sched_sporadic.c b/sched/sched/sched_sporadic.c index df4d976127..94f732b2aa 100644 --- a/sched/sched/sched_sporadic.c +++ b/sched/sched/sched_sporadic.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -43,14 +44,6 @@ #ifdef CONFIG_SCHED_SPORADIC -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Private Function Prototypes ****************************************************************************/ diff --git a/sched/sched/sched_timerexpiration.c b/sched/sched/sched_timerexpiration.c index a331d8aa16..427185ccd9 100644 --- a/sched/sched/sched_timerexpiration.c +++ b/sched/sched/sched_timerexpiration.c @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -69,14 +70,6 @@ # define KEEP_ALIVE_TICKS MSEC2TICK(80) #endif -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - /**************************************************************************** * Public Data ****************************************************************************/ diff --git a/sched/wdog/wd_start.c b/sched/wdog/wd_start.c index e94caabc0e..bdf9f23cf5 100644 --- a/sched/wdog/wd_start.c +++ b/sched/wdog/wd_start.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -42,14 +43,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef MAX -# define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#endif - #ifndef CONFIG_SCHED_CRITMONITOR_MAXTIME_WDOG # define CONFIG_SCHED_CRITMONITOR_MAXTIME_WDOG 0 #endif diff --git a/tools/rp2040/make_flash_fs.c b/tools/rp2040/make_flash_fs.c index 123aba717f..c9d47e37a0 100644 --- a/tools/rp2040/make_flash_fs.c +++ b/tools/rp2040/make_flash_fs.c @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -38,10 +39,6 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef MIN -# define MIN(a,b) (((a) < (b)) ? (a) : (b)) -#endif - #define MAX_NAME_LEN 16 #define MAX_SECTOR_DATA (1024 - 10) #define MAX_DIR_COUNT (MAX_SECTOR_DATA / 24)