From patchwork Wed Feb 18 02:18:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 5842401 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 C30E79F37F for ; Wed, 18 Feb 2015 02:20:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1006920149 for ; Wed, 18 Feb 2015 02:20:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3138120155 for ; Wed, 18 Feb 2015 02:20:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752595AbbBRCTm (ORCPT ); Tue, 17 Feb 2015 21:19:42 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:34032 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752660AbbBRCTi (ORCPT ); Tue, 17 Feb 2015 21:19:38 -0500 Received: by pabrd3 with SMTP id rd3so10881808pab.1; Tue, 17 Feb 2015 18:19:38 -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 :mime-version:content-type:content-transfer-encoding; bh=eygdM34waKm+sUTq/24K/clOnUTe30oNKxBxtFqhSdM=; b=Aru5/ky0CG6ed/bRJqcjN8tSIrEa872yrxucp5ATDkhPIxjzbEqC/zRyeWZitRuWz0 vjBrXFS3Pyfq46jN71m7BZJrbwucjzJRj3Y8Bf5PVoBdM3Nka+bzNX7lbvhhZCsaeJpc SX6NW/FmZ+LGiJK6Pc9IsQbbyEM1+USfr6GWWspMI5GAckh0z3fHDd0XZda27hB7VLLx o0nxyIK06p8v+2ZXTPaLEp/n0wwLpQB54xzyjX2V7Go2RlazVXwLkV5MzXPAaVEja2+6 VqGc1T0LXzaJnY0OWhK09k5rbKeu34BM1RK0yaLPJ+S0JN6ZnC9AS8+AsM7y+Lm2nhZC r7nQ== X-Received: by 10.70.91.201 with SMTP id cg9mr54496544pdb.57.1424225978036; Tue, 17 Feb 2015 18:19:38 -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.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Feb 2015 18:19:37 -0800 (PST) From: Brian Norris To: Zhang Rui , Cc: Neil Horman , Brian Norris , Javi Merino , Florian Fainelli , , Subject: [PATCH 8/8] tools/thermal: tmon: silence 'set but not used' warnings Date: Tue, 17 Feb 2015 18:18:36 -0800 Message-Id: <1424225916-13488-9-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> MIME-Version: 1.0 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=unavailable 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 gcc complains about the 'cols' variable being unused. This is unavoidable, given the ncurses getmaxyx() macro-based API, which wants to assign to a variable directly, even when we're not going to use it. Warning: gcc -O1 -Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int -fstack-protector -D VERSION=\"1.0\" -c -o tui.o tui.c tui.c: In function ‘show_dialogue’: tui.c:288:12: warning: variable ‘cols’ set but not used [-Wunused-but-set-variable] int rows, cols; ^ So, add a hack to get rid of that warning. Signed-off-by: Brian Norris --- This patch is ugly and of little value IMO, but it does squash the warning. Take it or leave it. tools/thermal/tmon/tui.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/thermal/tmon/tui.c b/tools/thermal/tmon/tui.c index 36e1f86c8452..b5d1c6b22dd3 100644 --- a/tools/thermal/tmon/tui.c +++ b/tools/thermal/tmon/tui.c @@ -293,6 +293,9 @@ void show_dialogue(void) getmaxyx(w, rows, cols); + /* Silence compiler 'unused' warnings */ + (void)cols; + werase(w); box(w, 0, 0); mvwprintw(w, 0, maxx/4, DIAG_TITLE);