From patchwork Fri Jan 13 10:51:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 135790 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D72F8B6F71 for ; Fri, 13 Jan 2012 21:54:24 +1100 (EST) Received: from localhost ([::1]:53621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rlem1-0002EC-1q for incoming@patchwork.ozlabs.org; Fri, 13 Jan 2012 05:54:17 -0500 Received: from eggs.gnu.org ([140.186.70.92]:42584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rlelc-0000pl-MG for qemu-devel@nongnu.org; Fri, 13 Jan 2012 05:54:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rleky-0001M7-Ki for qemu-devel@nongnu.org; Fri, 13 Jan 2012 05:53:23 -0500 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:59272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rleky-0001KE-Bh for qemu-devel@nongnu.org; Fri, 13 Jan 2012 05:53:12 -0500 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Jan 2012 10:53:01 -0000 Received: from d06nrmr1806.portsmouth.uk.ibm.com ([9.149.39.193]) by e06smtp14.uk.ibm.com ([192.168.101.144]) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 13 Jan 2012 10:52:55 -0000 Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q0DAqtDR2527454 for ; Fri, 13 Jan 2012 10:52:55 GMT Received: from d06av11.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q0DAqsBa014800 for ; Fri, 13 Jan 2012 03:52:54 -0700 Received: from localhost (stefanha-thinkpad.manchester-maybrook.uk.ibm.com [9.174.219.31]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q0DAqs1O014794; Fri, 13 Jan 2012 03:52:54 -0700 From: Stefan Hajnoczi To: Anthony Liguori Date: Fri, 13 Jan 2012 10:51:35 +0000 Message-Id: <1326451900-18325-8-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1326451900-18325-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1326451900-18325-1-git-send-email-stefanha@linux.vnet.ibm.com> x-cbid: 12011310-1948-0000-0000-000000A0F694 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.110 Cc: Stefan Weil , qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 07/12] Add 'fall through' comments to case statements without break 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 From: Stefan Weil These comments are used by static code analysis tools and in code reviews to avoid false warnings because of missing break statements. The case statements handled here were reported by coverity. Reviewed-by: Peter Maydell Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- hw/pcnet.c | 1 + json-lexer.c | 1 + qemu-option.c | 4 ++++ 3 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/pcnet.c b/hw/pcnet.c index cba253b..306dc6e 100644 --- a/hw/pcnet.c +++ b/hw/pcnet.c @@ -1505,6 +1505,7 @@ static void pcnet_bcr_writew(PCNetState *s, uint32_t rap, uint32_t val) #ifdef PCNET_DEBUG printf("BCR_SWS=0x%04x\n", val); #endif + /* fall through */ case BCR_LNKST: case BCR_LED1: case BCR_LED2: diff --git a/json-lexer.c b/json-lexer.c index c21338f..3cd3285 100644 --- a/json-lexer.c +++ b/json-lexer.c @@ -301,6 +301,7 @@ static int json_lexer_feed_char(JSONLexer *lexer, char ch, bool flush) case JSON_KEYWORD: case JSON_STRING: lexer->emit(lexer, lexer->token, new_state, lexer->x, lexer->y); + /* fall through */ case JSON_SKIP: QDECREF(lexer->token); lexer->token = qstring_new(); diff --git a/qemu-option.c b/qemu-option.c index 6b23c31..a303f87 100644 --- a/qemu-option.c +++ b/qemu-option.c @@ -214,13 +214,17 @@ static int parse_option_size(const char *name, const char *value, uint64_t *ret) switch (*postfix) { case 'T': sizef *= 1024; + /* fall through */ case 'G': sizef *= 1024; + /* fall through */ case 'M': sizef *= 1024; + /* fall through */ case 'K': case 'k': sizef *= 1024; + /* fall through */ case 'b': case '\0': *ret = (uint64_t) sizef;