From patchwork Thu Jan 24 16:14:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 14274 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3A88723F91 for ; Thu, 24 Jan 2013 16:14:48 +0000 (UTC) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by fiordland.canonical.com (Postfix) with ESMTP id EC5E7A18070 for ; Thu, 24 Jan 2013 16:14:47 +0000 (UTC) Received: by mail-vc0-f177.google.com with SMTP id m18so4323588vcm.22 for ; Thu, 24 Jan 2013 08:14:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=aL/T/oVSZ3ZyrlPexw0Ul1t2egHnQVzQfrLxI5p0zPM=; b=Wiw9oB2vRqaVkcpsrc2tYUH5UTVMcmZK+GiBxp36LNXsOgK5OPYeZvTaLquNQDUtTM vtHNhzAJ3aY4H5FbADyJdGnwLUBwLi2wHbu0/Gls8AfQzrKuzHhJ4QMKFsjrQeSAPLWJ tdRciRpZnHC0e+77otopxVbm01064Qgu88IOzpZuzvz5krYkkLTeBSdK+ZiTpz6E4wXH h2uCr8nkBuV1YSSCeZfAacfU4WJuCzILESOT3d4mUgD95XDi4b6wbagg5OI11lcqK9AH upb/jDVPkHO940yP9haoxlZ0OrDbpFzBfhRgVnW8PIVE3OZF+CkDL4pBpA3BLi2oQnI4 /HXw== X-Received: by 10.220.149.82 with SMTP id s18mr2539254vcv.14.1359044087421; Thu, 24 Jan 2013 08:14:47 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp72748veb; Thu, 24 Jan 2013 08:14:44 -0800 (PST) X-Received: by 10.194.78.207 with SMTP id d15mr4090204wjx.52.1359044083985; Thu, 24 Jan 2013 08:14:43 -0800 (PST) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id b5si736494wie.88.2013.01.24.08.14.43 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 24 Jan 2013 08:14:43 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1TyPRn-00033r-Fn; Thu, 24 Jan 2013 16:14:39 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Gerd Hoffmann , Anthony Liguori Subject: [PATCH for-1.4] qemu-char: Avoid unused variable warning in some configs Date: Thu, 24 Jan 2013 16:14:39 +0000 Message-Id: <1359044079-11742-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQm+juJVacMEDrm12mAfiNxGeCU02OcS6lKrd3ssH7IkYQIAhMT8qlTCkaKNsjQHjiVdbZ3+ Avoid unused variable warnings: qemu-char.c: In function 'qmp_chardev_open_port': qemu-char.c:3132: warning: unused variable 'fd' qemu-char.c:3132: warning: unused variable 'flags' in configurations with neither HAVE_CHARDEV_TTY nor HAVE_CHARDEV_PARPORT set. Signed-off-by: Peter Maydell --- Specifically, this happens on MacOSX. qemu-char.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 9ba0573..da1db1d 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3129,11 +3129,11 @@ static CharDriverState *qmp_chardev_open_file(ChardevFile *file, Error **errp) static CharDriverState *qmp_chardev_open_port(ChardevPort *port, Error **errp) { - int flags, fd; - switch (port->type) { #ifdef HAVE_CHARDEV_TTY case CHARDEV_PORT_KIND_SERIAL: + { + int flags, fd; flags = O_RDWR; fd = qmp_chardev_open_file_source(port->device, flags, errp); if (error_is_set(errp)) { @@ -3141,15 +3141,19 @@ static CharDriverState *qmp_chardev_open_port(ChardevPort *port, Error **errp) } socket_set_nonblock(fd); return qemu_chr_open_tty_fd(fd); + } #endif #ifdef HAVE_CHARDEV_PARPORT case CHARDEV_PORT_KIND_PARALLEL: + { + int flags, fd; flags = O_RDWR; fd = qmp_chardev_open_file_source(port->device, flags, errp); if (error_is_set(errp)) { return NULL; } return qemu_chr_open_pp_fd(fd); + } #endif default: error_setg(errp, "unknown chardev port (%d)", port->type);