Btrfs-progs: make smatch checker happy (trivial fixes)
authorRakesh Pandit <rakesh@tuxera.com>
Sat, 19 Apr 2014 19:05:41 +0000 (22:05 +0300)
committerDavid Sterba <dsterba@suse.cz>
Fri, 2 May 2014 15:03:45 +0000 (17:03 +0200)
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 <rakesh@tuxera.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs-find-root.c
btrfs-map-logical.c
cmds-check.c

index db01923..25d79f1 100644 (file)
@@ -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;
index a907e4d..e47a1ae 100644 (file)
@@ -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];
 
index 3e08912..a290fe3 100644 (file)
@@ -2882,7 +2882,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,
@@ -4735,7 +4735,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);