Commit a90b6b006c616f1a33f8ffb6939e31c8d66926a4
Committed by
Zhang Rui
1 parent
4cc32cb4e9
Exists in
smarc_imx_lf-5.15.y
and in
32 other branches
tools/thermal: tmon: add min/max macros
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Showing 1 changed file with 12 additions and 0 deletions Side-by-side Diff
tools/thermal/tmon/tui.c
... | ... | @@ -30,6 +30,18 @@ |
30 | 30 | |
31 | 31 | #include "tmon.h" |
32 | 32 | |
33 | +#define min(x, y) ({ \ | |
34 | + typeof(x) _min1 = (x); \ | |
35 | + typeof(y) _min2 = (y); \ | |
36 | + (void) (&_min1 == &_min2); \ | |
37 | + _min1 < _min2 ? _min1 : _min2; }) | |
38 | + | |
39 | +#define max(x, y) ({ \ | |
40 | + typeof(x) _max1 = (x); \ | |
41 | + typeof(y) _max2 = (y); \ | |
42 | + (void) (&_max1 == &_max2); \ | |
43 | + _max1 > _max2 ? _max1 : _max2; }) | |
44 | + | |
33 | 45 | static PANEL *data_panel; |
34 | 46 | static PANEL *dialogue_panel; |
35 | 47 | static PANEL *top; |