diff for duplicates of <933141a6-96cd-cef3-bbd3-e3b3d8def177@users.sourceforge.net> diff --git a/a/1.txt b/N1/1.txt index 0c45a15..254c3a7 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -57,7 +57,7 @@ index 116c5615d6c2..240dccf8d41c 100644 block_group->iref = 0; block_group->inode = NULL; spin_unlock(&block_group->lock); -- ASSERT(block_group->io_ctl.inode = NULL); +- ASSERT(block_group->io_ctl.inode == NULL); + ASSERT(!block_group->io_ctl.inode); iput(inode); last = block_group->key.objectid + block_group->key.offset; @@ -70,7 +70,7 @@ index ea4947c97505..7fd39a1ec7d6 100644 unsigned long num_pages = num_extent_pages(src->start, src->len); new = __alloc_extent_buffer(src->fs_info, src->start, src->len); -- if (new = NULL) +- if (new == NULL) + if (!new) return NULL; @@ -83,7 +83,7 @@ index 4cb399854f0e..508057ec2534 100644 * found idx is less than or equal to the end idx then we know that * a page exists. If no pages are found or if those pages are * outside of the range then we're fine (yay!) */ -- while (page = NULL && +- while (page == NULL && + while (!page && radix_tree_gang_lookup_slot(root, &pagep, NULL, start_idx, 1)) { page = radix_tree_deref_slot(pagep); @@ -92,7 +92,7 @@ index 4cb399854f0e..508057ec2534 100644 { struct btrfs_root *root = BTRFS_I(inode)->root; -- if (root = NULL) +- if (root == NULL) + if (!root) return 1; @@ -105,7 +105,7 @@ index d433e75d489a..29452a0fec91 100644 * the first 4 bytes */ out_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM); -- if (out_page = NULL) { +- if (out_page == NULL) { + if (!out_page) { ret = -ENOMEM; goto out; @@ -114,7 +114,7 @@ index d433e75d489a..29452a0fec91 100644 } out_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM); -- if (out_page = NULL) { +- if (out_page == NULL) { + if (!out_page) { ret = -ENOMEM; goto out; @@ -125,9 +125,9 @@ index ddc37c537058..1a29f333f54c 100644 +++ b/fs/btrfs/qgroup.c @@ -1468,7 +1468,7 @@ int btrfs_qgroup_trace_extent(struct btrfs_trans_handle *trans, if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags) - || bytenr = 0 || num_bytes = 0) + || bytenr == 0 || num_bytes == 0) return 0; -- if (WARN_ON(trans = NULL)) +- if (WARN_ON(trans == NULL)) + if (WARN_ON(!trans)) return -EINVAL; record = kmalloc(sizeof(*record), gfp_flag); @@ -136,7 +136,7 @@ index ddc37c537058..1a29f333f54c 100644 struct btrfs_path *path = NULL; BUG_ON(root_level < 0 || root_level >= BTRFS_MAX_LEVEL); -- BUG_ON(root_eb = NULL); +- BUG_ON(root_eb == NULL); + BUG_ON(!root_eb); if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)) @@ -145,7 +145,7 @@ index ddc37c537058..1a29f333f54c 100644 walk_down: level = root_level; while (level >= 0) { -- if (path->nodes[level] = NULL) { +- if (path->nodes[level] == NULL) { + if (!path->nodes[level]) { int parent_slot; u64 child_gen; @@ -158,7 +158,7 @@ index ab852b8e3e37..71b96c2dadbf 100644 if (ret) { while (--nzones >= 0) { dev = re->zones[nzones]->device; -- BUG_ON(dev = NULL); +- BUG_ON(dev == NULL); + BUG_ON(!dev); /* ignore whether the entry was inserted */ radix_tree_delete(&dev->reada_extents, index); @@ -167,7 +167,7 @@ index ab852b8e3e37..71b96c2dadbf 100644 int i; spin_lock(&fs_info->reada_lock); -- if (dev->reada_curr_zone = NULL) { +- if (dev->reada_curr_zone == NULL) { + if (!dev->reada_curr_zone) { ret = reada_pick_zone(dev); if (!ret) { @@ -189,7 +189,7 @@ index f49b94ab3d2a..a36491587d13 100644 struct bio *bio; struct scrub_page *page = sblock->pagev[page_num]; -- if (page->dev->bdev = NULL) { +- if (page->dev->bdev == NULL) { + if (!page->dev->bdev) { page->io_error = 1; sblock->no_io_error_seen = 0; @@ -198,8 +198,8 @@ index f49b94ab3d2a..a36491587d13 100644 struct scrub_page *page_good = sblock_good->pagev[page_num]; struct btrfs_fs_info *fs_info = sblock_bad->sctx->fs_info; -- BUG_ON(page_bad->page = NULL); -- BUG_ON(page_good->page = NULL); +- BUG_ON(page_bad->page == NULL); +- BUG_ON(page_good->page == NULL); + BUG_ON(!page_bad->page); + BUG_ON(!page_good->page); if (force_write || sblock_bad->header_error || @@ -209,7 +209,7 @@ index f49b94ab3d2a..a36491587d13 100644 { struct scrub_page *spage = sblock->pagev[page_num]; -- BUG_ON(spage->page = NULL); +- BUG_ON(spage->page == NULL); + BUG_ON(!spage->page); if (spage->io_error) { void *mapped_buffer = kmap_atomic(spage->page); @@ -218,7 +218,7 @@ index f49b94ab3d2a..a36491587d13 100644 while (dev->scrub_device) { mutex_unlock(&fs_info->scrub_lock); wait_event(fs_info->scrub_pause_wait, -- dev->scrub_device = NULL); +- dev->scrub_device == NULL); + !dev->scrub_device); mutex_lock(&fs_info->scrub_lock); } @@ -244,7 +244,7 @@ index 3a11ae63676e..34692772cbcf 100644 return -EIO; *name = kmalloc(*namelen, GFP_NOFS); -- if (*name = NULL) +- if (*name == NULL) + if (!*name) return -ENOMEM; @@ -253,7 +253,7 @@ index 3a11ae63676e..34692772cbcf 100644 return -EIO; *name = kmalloc(*namelen, GFP_NOFS); -- if (*name = NULL) +- if (*name == NULL) + if (!*name) return -ENOMEM; @@ -266,8 +266,8 @@ index 12bd04a4104f..dfe54b5c6884 100644 * device->running_pending is used to synchronize with the * schedule_bio code. */ -- if (device->pending_sync_bios.head = NULL && -- device->pending_bios.head = NULL) { +- if (device->pending_sync_bios.head == NULL && +- device->pending_bios.head == NULL) { + if (!device->pending_sync_bios.head && + !device->pending_bios.head) { again = 0; @@ -277,7 +277,7 @@ index 12bd04a4104f..dfe54b5c6884 100644 ret = __btrfs_map_block(fs_info, BTRFS_MAP_GET_READ_MIRRORS, logical, &length, &bbio, 0, 0); if (ret) { -- ASSERT(bbio = NULL); +- ASSERT(bbio == NULL); + ASSERT(!bbio); return ret; } @@ -285,7 +285,7 @@ index 12bd04a4104f..dfe54b5c6884 100644 @@ -5688,7 +5688,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, btrfs_dev_replace_set_lock_blocking(dev_replace); - if (dev_replace_is_ongoing && mirror_num = map->num_stripes + 1 && + if (dev_replace_is_ongoing && mirror_num == map->num_stripes + 1 && - !need_full_stripe(op) && dev_replace->tgtdev != NULL) { + !need_full_stripe(op) && dev_replace->tgtdev) { ret = get_extra_mirror_from_replace(fs_info, logical, *length, @@ -297,9 +297,9 @@ index 12bd04a4104f..dfe54b5c6884 100644 num_alloc_stripes = num_stripes; - if (dev_replace_is_ongoing && dev_replace->tgtdev != NULL) { + if (dev_replace_is_ongoing && dev_replace->tgtdev) { - if (op = BTRFS_MAP_WRITE) + if (op == BTRFS_MAP_WRITE) num_alloc_stripes <<= 1; - if (op = BTRFS_MAP_GET_READ_MIRRORS) + if (op == BTRFS_MAP_GET_READ_MIRRORS) @@ -5817,7 +5817,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info, ret = -ENOMEM; goto out; @@ -339,7 +339,7 @@ index c248f9286366..3bbe6904193a 100644 data_in = kmap(in_page); out_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM); -- if (out_page = NULL) { +- if (out_page == NULL) { + if (!out_page) { ret = -ENOMEM; goto out; @@ -348,7 +348,7 @@ index c248f9286366..3bbe6904193a 100644 goto out; } out_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM); -- if (out_page = NULL) { +- if (out_page == NULL) { + if (!out_page) { ret = -ENOMEM; goto out; diff --git a/a/content_digest b/N1/content_digest index 1c895b3..f4d9647 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,7 +1,7 @@ "ref\0360126ba-e45b-0a8d-57b6-83764c4c2bce@users.sourceforge.net\0" "From\0SF Markus Elfring <elfring@users.sourceforge.net>\0" "Subject\0[PATCH 2/4] btrfs: Adjust 32 checks for null pointers\0" - "Date\0Sun, 20 Aug 2017 20:18:55 +0000\0" + "Date\0Sun, 20 Aug 2017 22:18:55 +0200\0" "To\0linux-btrfs@vger.kernel.org" Chris Mason <clm@fb.com> David Sterba <dsterba@suse.com> @@ -69,7 +69,7 @@ " \t\tblock_group->iref = 0;\n" " \t\tblock_group->inode = NULL;\n" " \t\tspin_unlock(&block_group->lock);\n" - "-\t\tASSERT(block_group->io_ctl.inode = NULL);\n" + "-\t\tASSERT(block_group->io_ctl.inode == NULL);\n" "+\t\tASSERT(!block_group->io_ctl.inode);\n" " \t\tiput(inode);\n" " \t\tlast = block_group->key.objectid + block_group->key.offset;\n" @@ -82,7 +82,7 @@ " \tunsigned long num_pages = num_extent_pages(src->start, src->len);\n" " \n" " \tnew = __alloc_extent_buffer(src->fs_info, src->start, src->len);\n" - "-\tif (new = NULL)\n" + "-\tif (new == NULL)\n" "+\tif (!new)\n" " \t\treturn NULL;\n" " \n" @@ -95,7 +95,7 @@ " \t * found idx is less than or equal to the end idx then we know that\n" " \t * a page exists. If no pages are found or if those pages are\n" " \t * outside of the range then we're fine (yay!) */\n" - "-\twhile (page = NULL &&\n" + "-\twhile (page == NULL &&\n" "+\twhile (!page &&\n" " \t radix_tree_gang_lookup_slot(root, &pagep, NULL, start_idx, 1)) {\n" " \t\tpage = radix_tree_deref_slot(pagep);\n" @@ -104,7 +104,7 @@ " {\n" " \tstruct btrfs_root *root = BTRFS_I(inode)->root;\n" " \n" - "-\tif (root = NULL)\n" + "-\tif (root == NULL)\n" "+\tif (!root)\n" " \t\treturn 1;\n" " \n" @@ -117,7 +117,7 @@ " \t * the first 4 bytes\n" " \t */\n" " \tout_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM);\n" - "-\tif (out_page = NULL) {\n" + "-\tif (out_page == NULL) {\n" "+\tif (!out_page) {\n" " \t\tret = -ENOMEM;\n" " \t\tgoto out;\n" @@ -126,7 +126,7 @@ " \t\t\t\t}\n" " \n" " \t\t\t\tout_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM);\n" - "-\t\t\t\tif (out_page = NULL) {\n" + "-\t\t\t\tif (out_page == NULL) {\n" "+\t\t\t\tif (!out_page) {\n" " \t\t\t\t\tret = -ENOMEM;\n" " \t\t\t\t\tgoto out;\n" @@ -137,9 +137,9 @@ "+++ b/fs/btrfs/qgroup.c\n" "@@ -1468,7 +1468,7 @@ int btrfs_qgroup_trace_extent(struct btrfs_trans_handle *trans,\n" " \tif (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)\n" - " \t || bytenr = 0 || num_bytes = 0)\n" + " \t || bytenr == 0 || num_bytes == 0)\n" " \t\treturn 0;\n" - "-\tif (WARN_ON(trans = NULL))\n" + "-\tif (WARN_ON(trans == NULL))\n" "+\tif (WARN_ON(!trans))\n" " \t\treturn -EINVAL;\n" " \trecord = kmalloc(sizeof(*record), gfp_flag);\n" @@ -148,7 +148,7 @@ " \tstruct btrfs_path *path = NULL;\n" " \n" " \tBUG_ON(root_level < 0 || root_level >= BTRFS_MAX_LEVEL);\n" - "-\tBUG_ON(root_eb = NULL);\n" + "-\tBUG_ON(root_eb == NULL);\n" "+\tBUG_ON(!root_eb);\n" " \n" " \tif (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags))\n" @@ -157,7 +157,7 @@ " walk_down:\n" " \tlevel = root_level;\n" " \twhile (level >= 0) {\n" - "-\t\tif (path->nodes[level] = NULL) {\n" + "-\t\tif (path->nodes[level] == NULL) {\n" "+\t\tif (!path->nodes[level]) {\n" " \t\t\tint parent_slot;\n" " \t\t\tu64 child_gen;\n" @@ -170,7 +170,7 @@ " \t\tif (ret) {\n" " \t\t\twhile (--nzones >= 0) {\n" " \t\t\t\tdev = re->zones[nzones]->device;\n" - "-\t\t\t\tBUG_ON(dev = NULL);\n" + "-\t\t\t\tBUG_ON(dev == NULL);\n" "+\t\t\t\tBUG_ON(!dev);\n" " \t\t\t\t/* ignore whether the entry was inserted */\n" " \t\t\t\tradix_tree_delete(&dev->reada_extents, index);\n" @@ -179,7 +179,7 @@ " \tint i;\n" " \n" " \tspin_lock(&fs_info->reada_lock);\n" - "-\tif (dev->reada_curr_zone = NULL) {\n" + "-\tif (dev->reada_curr_zone == NULL) {\n" "+\tif (!dev->reada_curr_zone) {\n" " \t\tret = reada_pick_zone(dev);\n" " \t\tif (!ret) {\n" @@ -201,7 +201,7 @@ " \t\tstruct bio *bio;\n" " \t\tstruct scrub_page *page = sblock->pagev[page_num];\n" " \n" - "-\t\tif (page->dev->bdev = NULL) {\n" + "-\t\tif (page->dev->bdev == NULL) {\n" "+\t\tif (!page->dev->bdev) {\n" " \t\t\tpage->io_error = 1;\n" " \t\t\tsblock->no_io_error_seen = 0;\n" @@ -210,8 +210,8 @@ " \tstruct scrub_page *page_good = sblock_good->pagev[page_num];\n" " \tstruct btrfs_fs_info *fs_info = sblock_bad->sctx->fs_info;\n" " \n" - "-\tBUG_ON(page_bad->page = NULL);\n" - "-\tBUG_ON(page_good->page = NULL);\n" + "-\tBUG_ON(page_bad->page == NULL);\n" + "-\tBUG_ON(page_good->page == NULL);\n" "+\tBUG_ON(!page_bad->page);\n" "+\tBUG_ON(!page_good->page);\n" " \tif (force_write || sblock_bad->header_error ||\n" @@ -221,7 +221,7 @@ " {\n" " \tstruct scrub_page *spage = sblock->pagev[page_num];\n" " \n" - "-\tBUG_ON(spage->page = NULL);\n" + "-\tBUG_ON(spage->page == NULL);\n" "+\tBUG_ON(!spage->page);\n" " \tif (spage->io_error) {\n" " \t\tvoid *mapped_buffer = kmap_atomic(spage->page);\n" @@ -230,7 +230,7 @@ " \twhile (dev->scrub_device) {\n" " \t\tmutex_unlock(&fs_info->scrub_lock);\n" " \t\twait_event(fs_info->scrub_pause_wait,\n" - "-\t\t\t dev->scrub_device = NULL);\n" + "-\t\t\t dev->scrub_device == NULL);\n" "+\t\t\t !dev->scrub_device);\n" " \t\tmutex_lock(&fs_info->scrub_lock);\n" " \t}\n" @@ -256,7 +256,7 @@ " \t\treturn -EIO;\n" " \n" " \t*name = kmalloc(*namelen, GFP_NOFS);\n" - "-\tif (*name = NULL)\n" + "-\tif (*name == NULL)\n" "+\tif (!*name)\n" " \t\treturn -ENOMEM;\n" " \n" @@ -265,7 +265,7 @@ " \t\treturn -EIO;\n" " \n" " \t*name = kmalloc(*namelen, GFP_NOFS);\n" - "-\tif (*name = NULL)\n" + "-\tif (*name == NULL)\n" "+\tif (!*name)\n" " \t\treturn -ENOMEM;\n" " \n" @@ -278,8 +278,8 @@ " \t * device->running_pending is used to synchronize with the\n" " \t * schedule_bio code.\n" " \t */\n" - "-\tif (device->pending_sync_bios.head = NULL &&\n" - "-\t device->pending_bios.head = NULL) {\n" + "-\tif (device->pending_sync_bios.head == NULL &&\n" + "-\t device->pending_bios.head == NULL) {\n" "+\tif (!device->pending_sync_bios.head &&\n" "+\t !device->pending_bios.head) {\n" " \t\tagain = 0;\n" @@ -289,7 +289,7 @@ " \tret = __btrfs_map_block(fs_info, BTRFS_MAP_GET_READ_MIRRORS,\n" " \t\t\t\tlogical, &length, &bbio, 0, 0);\n" " \tif (ret) {\n" - "-\t\tASSERT(bbio = NULL);\n" + "-\t\tASSERT(bbio == NULL);\n" "+\t\tASSERT(!bbio);\n" " \t\treturn ret;\n" " \t}\n" @@ -297,7 +297,7 @@ "@@ -5688,7 +5688,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info,\n" " \t\tbtrfs_dev_replace_set_lock_blocking(dev_replace);\n" " \n" - " \tif (dev_replace_is_ongoing && mirror_num = map->num_stripes + 1 &&\n" + " \tif (dev_replace_is_ongoing && mirror_num == map->num_stripes + 1 &&\n" "-\t !need_full_stripe(op) && dev_replace->tgtdev != NULL) {\n" "+\t !need_full_stripe(op) && dev_replace->tgtdev) {\n" " \t\tret = get_extra_mirror_from_replace(fs_info, logical, *length,\n" @@ -309,9 +309,9 @@ " \tnum_alloc_stripes = num_stripes;\n" "-\tif (dev_replace_is_ongoing && dev_replace->tgtdev != NULL) {\n" "+\tif (dev_replace_is_ongoing && dev_replace->tgtdev) {\n" - " \t\tif (op = BTRFS_MAP_WRITE)\n" + " \t\tif (op == BTRFS_MAP_WRITE)\n" " \t\t\tnum_alloc_stripes <<= 1;\n" - " \t\tif (op = BTRFS_MAP_GET_READ_MIRRORS)\n" + " \t\tif (op == BTRFS_MAP_GET_READ_MIRRORS)\n" "@@ -5817,7 +5817,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info,\n" " \t\tret = -ENOMEM;\n" " \t\tgoto out;\n" @@ -351,7 +351,7 @@ " \tdata_in = kmap(in_page);\n" " \n" " \tout_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM);\n" - "-\tif (out_page = NULL) {\n" + "-\tif (out_page == NULL) {\n" "+\tif (!out_page) {\n" " \t\tret = -ENOMEM;\n" " \t\tgoto out;\n" @@ -360,7 +360,7 @@ " \t\t\t\tgoto out;\n" " \t\t\t}\n" " \t\t\tout_page = alloc_page(GFP_NOFS | __GFP_HIGHMEM);\n" - "-\t\t\tif (out_page = NULL) {\n" + "-\t\t\tif (out_page == NULL) {\n" "+\t\t\tif (!out_page) {\n" " \t\t\t\tret = -ENOMEM;\n" " \t\t\t\tgoto out;\n" @@ -368,4 +368,4 @@ "-- \n" 2.14.0 -ccdc66ef594d593d28cb94881e21f32911be5ee82574f58be52a156704cc5efa +9a182044fe367b01813d0147e0fd526e5689a754ccd72b31a5d40cc189eb1adc
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.