Received: from eggs.gnu.org ([140.186.70.92]:54386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rkjcq-0003GV-GB for qemu-devel@nongnu.org; Tue, 10 Jan 2012 16:53:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rkjcp-0000ly-5X for qemu-devel@nongnu.org; Tue, 10 Jan 2012 16:53:00 -0500 Message-ID: <4F0CB31B.107@weilnetz.de> Date: Tue, 10 Jan 2012 22:52:27 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1326130191-20344-1-git-send-email-sw@weilnetz.de> <20120110083555.GA13145@stefanha-thinkpad.localdomain> In-Reply-To: <20120110083555.GA13145@stefanha-thinkpad.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] Add 'fall through' comments to case statements without break List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrzej Zaborowski Cc: qemu-trivial@nongnu.org, Stefan Hajnoczi , qemu-devel@nongnu.org Am 10.01.2012 09:35, schrieb Stefan Hajnoczi: > This reminds me of another questionable fall-through: > > bt-host.c:bt_host_read(): > > while (s->len --) > switch (*pkt ++) { > ... > case HCI_SCODATA_PKT: > if (s->len < 3) > goto bad_pkt; > > pktlen = MIN(pkt[2] + 3, s->len); > s->len -= pktlen; > pkt += pktlen; > <--- fall-through or not? > default: > bad_pkt: > fprintf(stderr, "qemu: bad HCI packet type %02x\n", pkt[-1]); > } > > It seems the code will skip HCI_SCODATA_PKT and report a warning > (although type > pkt[-1] will be incorrect). Any thoughts? > > Stefan > Hi Andrzej, I think there should be a break statement at the end of the HCI_SCODATA_PKT case. Could you please check this? Regards, Stefan