Skip to content

Commit 5c5ea61

Browse files
madhukar-ArmTrustedFirmware Code Review
authored andcommitted
Merge "fix: add parenthesis for tests in MIN, MAX and CLAMP macros" into integration
2 parents 95cde79 + 8406db1 commit 5c5ea61

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/lib/utils_def.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@
6868
__typeof__(x) _x = (x); \
6969
__typeof__(y) _y = (y); \
7070
(void)(&_x == &_y); \
71-
_x < _y ? _x : _y; \
71+
(_x < _y) ? _x : _y; \
7272
})
7373

7474
#define MAX(x, y) __extension__ ({ \
7575
__typeof__(x) _x = (x); \
7676
__typeof__(y) _y = (y); \
7777
(void)(&_x == &_y); \
78-
_x > _y ? _x : _y; \
78+
(_x > _y) ? _x : _y; \
7979
})
8080

8181
#define CLAMP(x, min, max) __extension__ ({ \
@@ -84,7 +84,7 @@
8484
__typeof__(max) _max = (max); \
8585
(void)(&_x == &_min); \
8686
(void)(&_x == &_max); \
87-
(_x > _max ? _max : (_x < _min ? _min : _x)); \
87+
((_x > _max) ? _max : ((_x < _min) ? _min : _x)); \
8888
})
8989

9090
/*

0 commit comments

Comments
 (0)