nuttx: Use MIN/MAX definitions from "sys/param.h"

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
This commit is contained in:
Gustavo Henrique Nihei
2023-02-01 10:41:12 -03:00
committed by Xiang Xiao
parent 079e2b8c7c
commit e6b204f438
179 changed files with 195 additions and 1304 deletions
+1 -8
View File
@@ -25,6 +25,7 @@
#include <nuttx/config.h>
#include <string.h>
#include <sys/param.h>
#include <assert.h>
#include <errno.h>
#include <debug.h>
@@ -33,14 +34,6 @@
#include "iob.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef MIN
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/****************************************************************************
* Static Functions
****************************************************************************/
+1 -8
View File
@@ -25,6 +25,7 @@
#include <nuttx/config.h>
#include <string.h>
#include <sys/param.h>
#include <assert.h>
#include <errno.h>
#include <debug.h>
@@ -33,14 +34,6 @@
#include "iob.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef MIN
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
+1 -8
View File
@@ -25,6 +25,7 @@
#include <nuttx/config.h>
#include <stdint.h>
#include <sys/param.h>
#include <string.h>
#include <assert.h>
@@ -32,14 +33,6 @@
#include "iob.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifndef MIN
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
+1 -4
View File
@@ -25,6 +25,7 @@
#include <nuttx/config.h>
#include <stdint.h>
#include <sys/param.h>
#include <debug.h>
#include <nuttx/mm/iob.h>
@@ -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 */
+2 -1
View File
@@ -23,6 +23,8 @@
****************************************************************************/
#include <strings.h>
#include <sys/param.h>
#include <nuttx/mutex.h>
#include <nuttx/kmalloc.h>
#include <nuttx/mm/mempool.h>
@@ -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
+1 -6
View File
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/param.h>
#include <assert.h>
#include <nuttx/mm/mm.h>
@@ -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
****************************************************************************/
+1 -2
View File
@@ -33,6 +33,7 @@
#include <sched.h>
#include <stdio.h>
#include <string.h>
#include <sys/param.h>
#include <nuttx/arch.h>
#include <nuttx/fs/procfs.h>
@@ -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