From patchwork Sat Apr 19 19:05:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Pandit X-Patchwork-Id: 4020341 X-Patchwork-Delegate: dave@jikos.cz Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 114C6BFF02 for ; Sat, 19 Apr 2014 19:05:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3584720375 for ; Sat, 19 Apr 2014 19:05:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E5E9E2022D for ; Sat, 19 Apr 2014 19:05:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755188AbaDSTFr (ORCPT ); Sat, 19 Apr 2014 15:05:47 -0400 Received: from nbl-ex10-fe02.nebula.fi ([188.117.32.122]:62194 "EHLO ex10.nebula.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755081AbaDSTFp (ORCPT ); Sat, 19 Apr 2014 15:05:45 -0400 Received: from hercules.tuxera.com (88.195.159.123) by ex10.nebula.fi (188.117.32.115) with Microsoft SMTP Server (TLS) id 14.3.174.1; Sat, 19 Apr 2014 22:05:42 +0300 Date: Sat, 19 Apr 2014 22:05:41 +0300 From: Rakesh Pandit To: Subject: [PATCH] Btrfs-progs: make smatch checker happy (trivial fixes) Message-ID: <20140419190540.GA10872@hercules.tuxera.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [88.195.159.123] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 It complains errno never gets assigned to zero in find-root and since errno anyway is zero at program started up, lets remove it. Check "copy is less then zero" isn't possible because strtoull used by arg_strtou64 wouldn't return -ve number. Trivial space fixes. Signed-off-by: Rakesh Pandit --- btrfs-find-root.c | 1 - btrfs-map-logical.c | 2 -- cmds-check.c | 4 ++-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/btrfs-find-root.c b/btrfs-find-root.c index db01923..25d79f1 100644 --- a/btrfs-find-root.c +++ b/btrfs-find-root.c @@ -287,7 +287,6 @@ int main(int argc, char **argv) while ((opt = getopt(argc, argv, "l:o:g:")) != -1) { switch(opt) { - errno = 0; case 'o': search_objectid = arg_strtou64(optarg); break; diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c index a907e4d..e47a1ae 100644 --- a/btrfs-map-logical.c +++ b/btrfs-map-logical.c @@ -153,8 +153,6 @@ int main(int ac, char **av) print_usage(); if (logical == 0) print_usage(); - if (copy < 0) - print_usage(); dev = av[optind]; diff --git a/cmds-check.c b/cmds-check.c index 93f9ae6..04bdae5 100644 --- a/cmds-check.c +++ b/cmds-check.c @@ -2886,7 +2886,7 @@ static int add_data_backref(struct cache_tree *extent_cache, u64 bytenr, } else { if (back->node.found_extent_tree) { fprintf(stderr, "Extent back ref already exists " - "for %llu parent %llu root %llu" + "for %llu parent %llu root %llu " "owner %llu offset %llu num_refs %lu\n", (unsigned long long)bytenr, (unsigned long long)parent, @@ -4859,7 +4859,7 @@ static int verify_backrefs(struct btrfs_trans_handle *trans, if (!best) { entry = find_entry(&entries, rec->start, rec->nr); if (!entry && (!broken_entries || !rec->found_rec)) { - fprintf(stderr, "Backrefs don't agree with eachother " + fprintf(stderr, "Backrefs don't agree with each other " "and extent record doesn't agree with anybody," " so we can't fix bytenr %Lu bytes %Lu\n", rec->start, rec->nr);