summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2015-02-17 18:18:30 -0800
committerZhang Rui <rui.zhang@intel.com>2015-02-28 13:52:47 +0800
commita90b6b006c616f1a33f8ffb6939e31c8d66926a4 (patch)
tree5aa8dd93b7a13c54d3419b53a02064ae32b6aada /tools
parent4cc32cb4e92622757685c8732bdfc400243a5644 (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.c12
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 @@
#include "tmon.h"
+#define min(x, y) ({ \
+ typeof(x) _min1 = (x); \
+ typeof(y) _min2 = (y); \
+ (void) (&_min1 == &_min2); \
+ _min1 < _min2 ? _min1 : _min2; })
+
+#define max(x, y) ({ \
+ typeof(x) _max1 = (x); \
+ typeof(y) _max2 = (y); \
+ (void) (&_max1 == &_max2); \
+ _max1 > _max2 ? _max1 : _max2; })
+
static PANEL *data_panel;
static PANEL *dialogue_panel;
static PANEL *top;