diff options
author | Brian Norris <computersforpeace@gmail.com> | 2015-02-17 21:18:30 -0500 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2015-02-28 00:52:47 -0500 |
commit | a90b6b006c616f1a33f8ffb6939e31c8d66926a4 (patch) | |
tree | 5aa8dd93b7a13c54d3419b53a02064ae32b6aada /tools | |
parent | 4cc32cb4e92622757685c8732bdfc400243a5644 (diff) |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/thermal/tmon/tui.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/thermal/tmon/tui.c b/tools/thermal/tmon/tui.c index 89f8ef0e15c8..43c5aecf71da 100644 --- a/tools/thermal/tmon/tui.c +++ b/tools/thermal/tmon/tui.c | |||
@@ -30,6 +30,18 @@ | |||
30 | 30 | ||
31 | #include "tmon.h" | 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 | static PANEL *data_panel; | 45 | static PANEL *data_panel; |
34 | static PANEL *dialogue_panel; | 46 | static PANEL *dialogue_panel; |
35 | static PANEL *top; | 47 | static PANEL *top; |