From patchwork Tue Jun 25 09:24:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christophe de Dinechin X-Patchwork-Id: 11015107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7FF6414E5 for ; Tue, 25 Jun 2019 09:25:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F22B1FE8D for ; Tue, 25 Jun 2019 09:25:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6033227F88; Tue, 25 Jun 2019 09:25:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, MIME_QP_LONG_LINE,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0F7D31FE8D for ; Tue, 25 Jun 2019 09:25:02 +0000 (UTC) Received: from localhost ([::1]:57856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfhhG-00073S-A6 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 25 Jun 2019 05:25:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41916) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hfhgT-0006aE-DP for qemu-devel@nongnu.org; Tue, 25 Jun 2019 05:24:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hfhgR-0003FY-LO for qemu-devel@nongnu.org; Tue, 25 Jun 2019 05:24:13 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42631) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hfhgR-0003EJ-DG for qemu-devel@nongnu.org; Tue, 25 Jun 2019 05:24:11 -0400 Received: by mail-wr1-f67.google.com with SMTP id x17so16971870wrl.9 for ; Tue, 25 Jun 2019 02:24:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:cc:to; bh=9lGAcAg9fjR59KFRj/dFI9y0S6NbmPeBua+DQBsOvp4=; b=q7y1GwRVVa0LzXcUlRO8JQK1ErNxBmmj8CoDRLQ3lCRnGT8TXDneQ6cEFH+tdJ5K+6 +EELmBImPpiBnR+XS+JsHpWXchZFgg4cSdXRooosWo0mshFM/Xc+dxdKIQJ60jpw0vk+ N4Mp0SW9C6zEp2SEtBfx06tj17BlCT7BqrVCbOaMikt/YhaE3sOuKxRBMK2m8vkgZhtV JuzLILA2E52jXxwdZgC/Da1vEUyrFVFt9ujfiEG/+BrINZdInxQd4aKkRModfkx7pdBS ryarE2Rke6pet0fqiQVrAT4xGaEw0ewdKgOhqONWzXqOy+blKSXaltdhFJu1J33RmsTu ILrg== X-Gm-Message-State: APjAAAVAaBk3SZP0HdZejNKdQgaV74+jm/dQXIGw9bralN9ODm0cxW4s x/MoX3kttRK1ryojm65rYv87LeQl7IM= X-Google-Smtp-Source: APXvYqw0a+e+c16+O6ocToIFxYsk21iz48+Wg3ha8wwpSmaAFhB50aowg0JRFKOZJSwrRZpFGNoBaw== X-Received: by 2002:adf:cf0a:: with SMTP id o10mr35802862wrj.37.1561454649038; Tue, 25 Jun 2019 02:24:09 -0700 (PDT) Received: from ?IPv6:2a01:e35:8b6a:1220:e1dd:b35b:b1e3:d497? ([2a01:e35:8b6a:1220:e1dd:b35b:b1e3:d497]) by smtp.gmail.com with ESMTPSA id 11sm1980357wmb.26.2019.06.25.02.24.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Jun 2019 02:24:08 -0700 (PDT) From: Christophe de Dinechin Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Message-Id: <4C5F8F98-D058-46A4-81E7-D9A5D4FEE2EC@redhat.com> Date: Tue, 25 Jun 2019 11:24:05 +0200 To: qemu-devel@nongnu.org X-Mailer: Apple Mail (2.3445.104.11) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.221.67 Subject: [Qemu-devel] [PATCH] Fix build error when VNC is configured out X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP In hmp_change(), the variable hmp_mon is only used by code under #ifdef CONFIG_VNC. This results in a build error when VNC is configured out with the default of treating warnings as errors: monitor/hmp-cmds.c: In function ‘hmp_change’: monitor/hmp-cmds.c:1946:17: error: unused variable ‘hmp_mon’ [-Werror=unused-variable] 1946 | MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common); | ^~~~~~~ Signed-off-by: Christophe de Dinechin Reviewed-by: Philippe Mathieu-Daudé --- monitor/hmp-cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index c283dde0e9..038614da8e 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -1943,7 +1943,6 @@ static void hmp_change_read_arg(void *opaque, const char *password, void hmp_change(Monitor *mon, const QDict *qdict) { - MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common); const char *device = qdict_get_str(qdict, "device"); const char *target = qdict_get_str(qdict, "target"); const char *arg = qdict_get_try_str(qdict, "arg"); @@ -1952,6 +1951,7 @@ void hmp_change(Monitor *mon, const QDict *qdict) Error *err = NULL; #ifdef CONFIG_VNC + MonitorHMP *hmp_mon = container_of(mon, MonitorHMP, common); if (strcmp(device, "vnc") == 0) { if (read_only) { monitor_printf(mon,