From patchwork Mon Aug 13 11:05:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 176913 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CB1DD2C007B for ; Mon, 13 Aug 2012 21:06:02 +1000 (EST) Received: from localhost ([::1]:60619 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0sTA-0006ub-NK for incoming@patchwork.ozlabs.org; Mon, 13 Aug 2012 07:06:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0sSy-0006uB-OS for qemu-devel@nongnu.org; Mon, 13 Aug 2012 07:05:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0sSx-0006mI-PU for qemu-devel@nongnu.org; Mon, 13 Aug 2012 07:05:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62524) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0sSx-0006m1-Fs for qemu-devel@nongnu.org; Mon, 13 Aug 2012 07:05:47 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7DB5kpO031395 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 13 Aug 2012 07:05:47 -0400 Received: from rincewind.home.kraxel.org (ovpn-116-59.ams2.redhat.com [10.36.116.59]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7DB5kof022816; Mon, 13 Aug 2012 07:05:46 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 5B440408C6; Mon, 13 Aug 2012 13:05:45 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 13 Aug 2012 13:05:44 +0200 Message-Id: <1344855944-28250-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1344855944-28250-1-git-send-email-kraxel@redhat.com> References: <1344855944-28250-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id q7DB5kpO031395 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH v2 2/2] scsi: fix warning X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org hw/scsi-bus.c:758: warning: ‘xfer’ may be used uninitialized in this function Isn't true, but older gcc versions (for example 4.1 as shipped in rhel5) are not clever enougth to figure, so sprinkle in a default: line to make them happy. Signed-off-by: Gerd Hoffmann --- hw/scsi-bus.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index b8a857d..4981a02 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -761,6 +761,7 @@ static int ata_passthrough_12_xfer_size(SCSIDevice *dev, uint8_t *buf) switch (length) { case 0: case 3: /* USB-specific. */ + default: xfer = 0; break; case 1: @@ -784,6 +785,7 @@ static int ata_passthrough_16_xfer_size(SCSIDevice *dev, uint8_t *buf) switch (length) { case 0: case 3: /* USB-specific. */ + default: xfer = 0; break; case 1: