arch/arm/src/lc823450: fully parenthesize MIN and MAX macros

Signed-off-by: Juha Niskanen <juha.niskanen@haltian.com>
This commit is contained in:
Juha Niskanen 2020-12-08 18:33:49 +02:00 committed by Xiang Xiao
parent cd41ed9b6d
commit 7bc7b611d6
5 changed files with 8 additions and 15 deletions

View File

@ -39,11 +39,11 @@
****************************************************************************/
#ifndef MAX
# define MAX(a,b) a > b ? a : b
# define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
#ifndef MIN
# define MIN(a,b) a < b ? a : b
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/****************************************************************************

View File

@ -56,7 +56,7 @@
#define DVFS_LINELEN 128
#ifndef MIN
# define MIN(a,b) (a < b ? a : b)
# define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef CONFIG_SMP_NCPUS
@ -286,7 +286,8 @@ static ssize_t dvfs_write(FAR struct file *filep, FAR const char *buffer,
strncpy(line, buffer, n);
line[n] = '\0';
n = MIN(strcspn(line, " "), sizeof(cmd) - 1);
n = strcspn(line, " ");
n = MIN(n, sizeof(cmd) - 1);
strncpy(cmd, line, n);
cmd[n] = '\0';

View File

@ -141,12 +141,8 @@ int g_console_disable;
# define HS_DMAACT_ACT2 3
#endif
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? a : b)
#endif
#ifndef MIN
#define MIN(a, b) ((a) > (b) ? b : a)
# define MIN(a, b) ((a) > (b) ? (b) : (a))
#endif
/****************************************************************************

View File

@ -53,7 +53,7 @@
#endif
#ifndef MIN
# define MIN(a, b) ((a) > (b) ? b : a)
# define MIN(a, b) ((a) > (b) ? (b) : (a))
#endif
/****************************************************************************

View File

@ -75,11 +75,7 @@
#ifndef MIN
# define MIN(a, b) ((a) > (b) ? (b) : (a))
#endif /* MIN */
#ifndef MAX
# define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif /* MIN */
#endif
#if 0
# define DPRINTF(fmt, args...) uinfo(fmt, ##args)