From patchwork Fri Apr 15 03:02:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prerna Saxena X-Patchwork-Id: 8851051 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A9BA4BF29F for ; Fri, 15 Apr 2016 13:36:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8917A20270 for ; Fri, 15 Apr 2016 13:36:53 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC6EF2026F for ; Fri, 15 Apr 2016 13:36:51 +0000 (UTC) Received: from localhost ([::1]:34334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ar3vV-0005b4-G4 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Apr 2016 09:36:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqu2M-0006TV-37 for qemu-devel@nongnu.org; Thu, 14 Apr 2016 23:03:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqu2K-0004Yc-UO for qemu-devel@nongnu.org; Thu, 14 Apr 2016 23:03:14 -0400 Received: from mail-pa0-x241.google.com ([2607:f8b0:400e:c03::241]:36218) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqu2K-0004YY-NB for qemu-devel@nongnu.org; Thu, 14 Apr 2016 23:03:12 -0400 Received: by mail-pa0-x241.google.com with SMTP id k3so8216145pav.3 for ; Thu, 14 Apr 2016 20:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KdmYFA+flkT+DWQxsJQyFkx1aZ2TzFLdKqYdg0IqKLw=; b=qRB/vSbHsGWKq9fgNN72rnNDGzMKlgeDhJYa2KPOQJ8Lt2tgUQQcFNdjNlJpzql+R3 x+aLAMcNnASys3fk3RrpXxD4OshnzCTrPoyLdT8Q1mglBzQRpdZ7gj9GpPzZ9UiEriBp XFFPvt41vP6Rx76072VxlQCqYCod+KPfgUODbjIDYPh0u9wygqTrW5b5+Y469VLSQ6of IWr9zd43D8Y9nljjW2tfWjzn2lbWo0y15+/8o0Uo6COqRiF4u4VsqMP3OVJ46VwxqchJ e9G9rXaeTJoMMVVNUvxkKGPEaJ/nBxArK9N7pcF6UkwHceDC4HtTq47cadL25kVlMkFW VZrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KdmYFA+flkT+DWQxsJQyFkx1aZ2TzFLdKqYdg0IqKLw=; b=b/V1QrlK3MCZ+zT07XUOTPikWOz6Km/PED3Jn9CAiY/on+9NUcMW4JELYH2Q4NIfnD T1iLwr9PPUR5Wcl9jOuUjveFA0YZTW152Fffl/cElmHZRuuOjygtSYOG2jOBium2MYhm Is3GgL7WfwgDVQnSyCzSqrdtBU5FbJQSBcGXAdxrPhue9jp9hFTCtmEabmbJj9pCGq3L 2tYkiKNXzRhubz/kmUNhl+zvEM/jNwW8lPlwzZZpBk9pRSJUC2siYXf1SbmYnBB1ELPr spdnkm75CNwhHfqrwoZHpa0trLaL+GkL01Q3YjRemSx7B2EErbC5UNBIROYn6X2HEQZN kedg== X-Gm-Message-State: AOPr4FV2tLT/H3voOnKB/lZRKe274eEttmMbnHotZYkNzwvQyinbdIvaFhUOjr2sFqcyVw== X-Received: by 10.66.141.42 with SMTP id rl10mr26421907pab.48.1460689391994; Thu, 14 Apr 2016 20:03:11 -0700 (PDT) Received: from localhost.localdomain ([14.141.153.182]) by smtp.gmail.com with ESMTPSA id xs10sm61016252pab.4.2016.04.14.20.03.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Apr 2016 20:03:11 -0700 (PDT) From: Prerna Saxena To: qemu-devel@nongnu.org Date: Fri, 15 Apr 2016 08:32:53 +0530 Message-Id: <1460689374-9690-2-git-send-email-saxenap.ltc@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1460689374-9690-1-git-send-email-saxenap.ltc@gmail.com> References: <1460689374-9690-1-git-send-email-saxenap.ltc@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::241 X-Mailman-Approved-At: Fri, 15 Apr 2016 09:36:33 -0400 Subject: [Qemu-devel] [PATCH 1/2] Block: Cleanup vvfat.c to remove dead code. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Prerna Saxena , Prerna Saxena Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 43dc2a64 replaced assert() with abort(), but didnt remove statements that followed these calls. So current code still has return values set after a call to abort(). Such statements will never execute and need to be cleaned up. Signed-off-by: Prerna Saxena --- block/vvfat.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index 6b85314..ffe739b 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -1747,8 +1747,7 @@ static uint32_t get_cluster_count_for_direntry(BDRVVVFATState* s, schedule_new_file(s, g_strdup(path), cluster_num); else { abort(); - return 0; - } + } } while(1) { @@ -1768,7 +1767,6 @@ static uint32_t get_cluster_count_for_direntry(BDRVVVFATState* s, * (cluster_num - mapping->begin)) { /* offset of this cluster in file chain has changed */ abort(); - copy_it = 1; } else if (offset == 0) { const char* basename = get_basename(mapping->path); @@ -1780,7 +1778,6 @@ static uint32_t get_cluster_count_for_direntry(BDRVVVFATState* s, if (mapping->first_mapping_index != first_mapping_index && mapping->info.file.offset > 0) { abort(); - copy_it = 1; } /* need to write out? */ @@ -1946,8 +1943,6 @@ DLOG(fprintf(stderr, "check direntry %d:\n", i); print_direntry(direntries + i)) } } else abort(); /* cluster_count = 0; */ - - ret += cluster_count; } cluster_num = modified_fat_get(s, cluster_num); @@ -2578,10 +2573,6 @@ static int handle_commits(BDRVVVFATState* s) for (i = 0; !fail && i < s->commits.next; i++) { commit_t* commit = array_get(&(s->commits), i); switch(commit->action) { - case ACTION_RENAME: case ACTION_MKDIR: - abort(); - fail = -2; - break; case ACTION_WRITEOUT: { #ifndef NDEBUG /* these variables are only used by assert() below */ @@ -2639,6 +2630,8 @@ static int handle_commits(BDRVVVFATState* s) break; } + case ACTION_RENAME: + case ACTION_MKDIR: default: abort(); } @@ -2729,7 +2722,6 @@ static int do_commit(BDRVVVFATState* s) if (ret) { fprintf(stderr, "Error handling renames (%d)\n", ret); abort(); - return ret; } /* copy FAT (with bdrv_read) */ @@ -2740,21 +2732,18 @@ static int do_commit(BDRVVVFATState* s) if (ret) { fprintf(stderr, "Fatal: error while committing (%d)\n", ret); abort(); - return ret; } ret = handle_commits(s); if (ret) { fprintf(stderr, "Error handling commits (%d)\n", ret); abort(); - return ret; } ret = handle_deletes(s); if (ret) { fprintf(stderr, "Error deleting\n"); abort(); - return ret; } if (s->qcow->drv->bdrv_make_empty) {