btrfs-progs: use NULL instead of 0
authorByongho Lee <bhlee.kernel@gmail.com>
Mon, 4 Jan 2016 01:01:30 +0000 (10:01 +0900)
committerDavid Sterba <dsterba@suse.com>
Tue, 12 Jan 2016 14:01:05 +0000 (15:01 +0100)
Fix the code assigning 0 to pointer instead of NULL.

Signed-off-by: Byongho Lee <bhlee.kernel@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-fi-usage.c
props.c
qgroup.c
utils.c

index 72d8027..852e565 100644 (file)
@@ -47,7 +47,7 @@ static int add_info_to_list(struct chunk_info **info_ptr,
 
        for (j = 0 ; j < num_stripes ; j++) {
                int i;
-               struct chunk_info *p = 0;
+               struct chunk_info *p = NULL;
                struct btrfs_stripe *stripe;
                u64    devid;
 
@@ -182,7 +182,7 @@ static int load_chunk_info(int fd, struct chunk_info **info_ptr, int *info_count
 
                        ret = add_info_to_list(info_ptr, info_count, item);
                        if (ret) {
-                               *info_ptr = 0;
+                               *info_ptr = NULL;
                                return 1;
                        }
 
@@ -228,7 +228,7 @@ static int cmp_btrfs_ioctl_space_info(const void *a, const void *b)
  */
 static struct btrfs_ioctl_space_args *load_space_info(int fd, char *path)
 {
-       struct btrfs_ioctl_space_args *sargs = 0, *sargs_orig = 0;
+       struct btrfs_ioctl_space_args *sargs = NULL, *sargs_orig = NULL;
        int e, ret, count;
 
        sargs_orig = sargs = calloc(1, sizeof(struct btrfs_ioctl_space_args));
@@ -312,7 +312,7 @@ static int print_filesystem_usage_overall(int fd, struct chunk_info *chunkinfo,
                int chunkcount, struct device_info *devinfo, int devcount,
                char *path, unsigned unit_mode)
 {
-       struct btrfs_ioctl_space_args *sargs = 0;
+       struct btrfs_ioctl_space_args *sargs = NULL;
        int i;
        int ret = 0;
        int width = 10;         /* default 10 for human units */
@@ -510,7 +510,7 @@ static int load_device_info(int fd, struct device_info **device_info_ptr,
        struct device_info *info;
 
        *device_info_count = 0;
-       *device_info_ptr = 0;
+       *device_info_ptr = NULL;
 
        ret = ioctl(fd, BTRFS_IOC_FS_INFO, &fi_args);
        if (ret < 0) {
@@ -620,7 +620,7 @@ static void _cmd_filesystem_usage_tabular(unsigned unit_mode,
 {
        int i;
        u64 total_unused = 0;
-       struct string_table *matrix = 0;
+       struct string_table *matrix = NULL;
        int  ncols, nrows;
        int col;
        int unallocated_col;
diff --git a/props.c b/props.c
index c9e2bd4..5b74932 100644 (file)
--- a/props.c
+++ b/props.c
@@ -194,5 +194,5 @@ const struct prop_handler prop_handlers[] = {
         prop_object_dev | prop_object_root, prop_label},
        {"compression", "Set/get compression for a file or directory", 0,
         prop_object_inode, prop_compression},
-       {0, 0, 0, 0, 0}
+       {NULL, NULL, 0, 0, NULL}
 };
index 1fbfcb9..f56f51a 100644 (file)
--- a/qgroup.c
+++ b/qgroup.c
@@ -1117,7 +1117,8 @@ static int __qgroups_search(int fd, struct qgroup_lookup *qgroup_lookup)
                                  btrfs_stack_qgroup_info_exclusive_compressed
                                  (info);
                                add_qgroup(qgroup_lookup, sh->offset, a1, a2,
-                                          a3, a4, a5, 0, 0, 0, 0, 0, 0, 0);
+                                          a3, a4, a5, 0, 0, 0, 0, 0,
+                                          NULL, NULL);
                        } else if (sh->type == BTRFS_QGROUP_LIMIT_KEY) {
                                limit = (struct btrfs_qgroup_limit_item *)
                                    (args.buf + off);
@@ -1132,7 +1133,8 @@ static int __qgroups_search(int fd, struct qgroup_lookup *qgroup_lookup)
                                a5 = btrfs_stack_qgroup_limit_rsv_exclusive
                                     (limit);
                                add_qgroup(qgroup_lookup, sh->offset, 0, 0,
-                                          0, 0, 0, a1, a2, a3, a4, a5, 0, 0);
+                                          0, 0, 0, a1, a2, a3, a4, a5,
+                                          NULL, NULL);
                        } else if (sh->type == BTRFS_QGROUP_RELATION_KEY) {
                                if (sh->offset < sh->objectid)
                                        goto skip;
diff --git a/utils.c b/utils.c
index 32e6e39..03648db 100644 (file)
--- a/utils.c
+++ b/utils.c
@@ -154,7 +154,7 @@ int test_uuid_unique(char *fs_uuid)
        blkid_dev dev = NULL;
        blkid_cache cache = NULL;
 
-       if (blkid_get_cache(&cache, 0) < 0) {
+       if (blkid_get_cache(&cache, NULL) < 0) {
                printf("ERROR: lblkid cache get failed\n");
                return 1;
        }
@@ -2601,7 +2601,7 @@ int btrfs_scan_lblkid(void)
        if (btrfs_scan_done)
                return 0;
 
-       if (blkid_get_cache(&cache, 0) < 0) {
+       if (blkid_get_cache(&cache, NULL) < 0) {
                printf("ERROR: lblkid cache get failed\n");
                return 1;
        }