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>
This commit is contained in:
Brian Norris 2015-02-17 18:18:30 -08:00 committed by Zhang Rui
parent 4cc32cb4e9
commit a90b6b006c
1 changed files with 12 additions and 0 deletions

View File

@ -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;