From patchwork Wed Feb 18 02:18:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 5842501 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8D5089F37F for ; Wed, 18 Feb 2015 02:21:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D401B2015E for ; Wed, 18 Feb 2015 02:21:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1346B20149 for ; Wed, 18 Feb 2015 02:21:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752488AbbBRCTb (ORCPT ); Tue, 17 Feb 2015 21:19:31 -0500 Received: from mail-pd0-f179.google.com ([209.85.192.179]:33790 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752351AbbBRCTa (ORCPT ); Tue, 17 Feb 2015 21:19:30 -0500 Received: by pdjz10 with SMTP id z10so48040007pdj.0; Tue, 17 Feb 2015 18:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UpfbCCTodJhYkb3BZQ/UGvXFDFg8hioN4xbGadGQpgg=; b=JOqV7CelomZKB4nxB3PXiNHg9VcF+P9RNP7Hj1jJ5ueM/S9V5/YeSH4bNyQlxDMJ3S fQoqJmgFjY2UY9kB/IajGqa2hUsSEh4JTd5GCNIxs/HkuhxS68Z6Hbpvr8lloyOC9Kgi 2Des0v2PtWB/8JVHJgyF3FZ1+jg+72bQxsMATHE1az8CJts25TeNkv3X8n1nOgs2l8BI XDk3pQVO37wNNlYq+i+N8Xq+XSH5aZj6JjR5tlHOqVsh2LJ4nCjKtzTCCiu+tiqBt/EP B75WxNZ1NaC954G6i/0L92eh8K/9Pac8Pxuy375HrE8ssokpyPS+wXnHnNALCG4MiuHi XIIQ== X-Received: by 10.70.49.99 with SMTP id t3mr53869248pdn.105.1424225970314; Tue, 17 Feb 2015 18:19:30 -0800 (PST) Received: from ld-irv-0074.broadcom.com (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by mx.google.com with ESMTPSA id ff10sm19169159pad.1.2015.02.17.18.19.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Feb 2015 18:19:29 -0800 (PST) From: Brian Norris To: Zhang Rui , Cc: Neil Horman , Brian Norris , Javi Merino , Florian Fainelli , , Subject: [PATCH 2/8] tools/thermal: tmon: add min/max macros Date: Tue, 17 Feb 2015 18:18:30 -0800 Message-Id: <1424225916-13488-3-git-send-email-computersforpeace@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424225916-13488-1-git-send-email-computersforpeace@gmail.com> References: <1424225916-13488-1-git-send-email-computersforpeace@gmail.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Brian Norris --- tools/thermal/tmon/tui.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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;