All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/39] drop null test before destroy functions
@ 2015-09-13 12:14 ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: iommu, dccp, dri-devel, intel-gfx, ecryptfs, dmaengine
  Cc: sergey.senozhatsky, kernel-janitors, Dan Williams, cluster-devel,
	intel-wired-lan, Mitch Williams, John Ronciak, Matthew Vick,
	Don Skidmore, Carolyn Wyborny, Shannon Nelson, Jesse Brandeburg,
	linux-nfs, linux-raid, netdev, linux-atm-general, linux-btrfs,
	linux-nilfs, linux-kernel, linux-mtd, linux-usb, linux-ext4,
	linux-rdma, devel, HPDD-discuss, linux-bcache, drbd-user,
	ocfs2-devel, kvm, ceph-devel, Chao Yu, linux-f2fs-devel

Recent commits to kernel/git/torvalds/linux.git have made the following
functions able to tolerate NULL arguments:

kmem_cache_destroy (commit 3942d29918522)
mempool_destroy (commit 4e3ca3e033d1)
dma_pool_destroy (commit 44d7175da6ea)

These patches remove the associated NULL tests for the files that I found
easy to compile test.  If these changes are OK, I will address the
remainder later.

---

 arch/x86/kvm/mmu.c                                 |    6 --
 block/bio-integrity.c                              |    7 --
 block/bio.c                                        |    7 --
 block/blk-core.c                                   |    3 -
 block/elevator.c                                   |    3 -
 drivers/atm/he.c                                   |    7 --
 drivers/block/aoe/aoedev.c                         |    3 -
 drivers/block/drbd/drbd_main.c                     |   21 ++-----
 drivers/block/pktcdvd.c                            |    3 -
 drivers/block/rbd.c                                |    6 --
 drivers/dma/dmaengine.c                            |    6 --
 drivers/firmware/google/gsmi.c                     |    3 -
 drivers/gpu/drm/i915/i915_dma.c                    |   19 ++----
 drivers/iommu/amd_iommu_init.c                     |    7 --
 drivers/md/bcache/bset.c                           |    3 -
 drivers/md/bcache/request.c                        |    3 -
 drivers/md/bcache/super.c                          |    9 +--
 drivers/md/dm-bufio.c                              |    3 -
 drivers/md/dm-cache-target.c                       |    3 -
 drivers/md/dm-crypt.c                              |    6 --
 drivers/md/dm-io.c                                 |    3 -
 drivers/md/dm-log-userspace-base.c                 |    3 -
 drivers/md/dm-region-hash.c                        |    4 -
 drivers/md/dm.c                                    |   13 +---
 drivers/md/multipath.c                             |    3 -
 drivers/md/raid1.c                                 |    6 --
 drivers/md/raid10.c                                |    9 +--
 drivers/md/raid5.c                                 |    3 -
 drivers/mtd/nand/nandsim.c                         |    3 -
 drivers/mtd/ubi/attach.c                           |    4 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c      |    3 -
 drivers/staging/lustre/lustre/llite/super25.c      |   16 +----
 drivers/staging/lustre/lustre/obdclass/genops.c    |   24 ++------
 drivers/staging/lustre/lustre/obdclass/lu_object.c |    6 --
 drivers/staging/rdma/hfi1/user_sdma.c              |    3 -
 drivers/thunderbolt/ctl.c                          |    3 -
 drivers/usb/gadget/udc/bdc/bdc_core.c              |    3 -
 drivers/usb/gadget/udc/gr_udc.c                    |    3 -
 drivers/usb/gadget/udc/mv_u3d_core.c               |    3 -
 drivers/usb/gadget/udc/mv_udc_core.c               |    3 -
 drivers/usb/host/fotg210-hcd.c                     |   12 +---
 drivers/usb/host/fusbh200-hcd.c                    |   12 +---
 drivers/usb/host/whci/init.c                       |    3 -
 drivers/usb/host/xhci-mem.c                        |   12 +---
 fs/btrfs/backref.c                                 |    3 -
 fs/btrfs/delayed-inode.c                           |    3 -
 fs/btrfs/delayed-ref.c                             |   12 +---
 fs/btrfs/disk-io.c                                 |    3 -
 fs/btrfs/extent_io.c                               |    6 --
 fs/btrfs/extent_map.c                              |    3 -
 fs/btrfs/file.c                                    |    3 -
 fs/btrfs/inode.c                                   |   18 ++----
 fs/btrfs/ordered-data.c                            |    3 -
 fs/dlm/memory.c                                    |    6 --
 fs/ecryptfs/main.c                                 |    3 -
 fs/ext4/crypto.c                                   |    9 +--
 fs/ext4/extents_status.c                           |    3 -
 fs/ext4/mballoc.c                                  |    3 -
 fs/f2fs/crypto.c                                   |    9 +--
 fs/gfs2/main.c                                     |   29 ++--------
 fs/jbd2/journal.c                                  |   15 +----
 fs/jbd2/revoke.c                                   |   12 +---
 fs/jbd2/transaction.c                              |    6 --
 fs/jffs2/malloc.c                                  |   27 +++------
 fs/nfsd/nfscache.c                                 |    6 --
 fs/nilfs2/super.c                                  |   12 +---
 fs/ocfs2/dlm/dlmlock.c                             |    3 -
 fs/ocfs2/dlm/dlmmaster.c                           |   16 +----
 fs/ocfs2/super.c                                   |   18 ++----
 fs/ocfs2/uptodate.c                                |    3 -
 lib/debugobjects.c                                 |    3 -
 net/core/sock.c                                    |   12 +---
 net/dccp/ackvec.c                                  |   12 +---
 net/dccp/ccid.c                                    |    3 -
 net/sunrpc/sched.c                                 |   12 +---
 75 files changed, 180 insertions(+), 381 deletions(-)

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [PATCH 00/39] drop null test before destroy functions
@ 2015-09-13 12:14 ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: iommu, dccp, dri-devel, intel-gfx, ecryptfs, dmaengine
  Cc: sergey.senozhatsky, kernel-janitors, Dan Williams, cluster-devel,
	intel-wired-lan, Mitch Williams, John Ronciak, Matthew Vick,
	Don Skidmore, Carolyn Wyborny, Shannon Nelson, Jesse Brandeburg,
	linux-nfs, linux-raid, netdev, linux-atm-general, linux-btrfs,
	linux-nilfs, linux-kernel, linux-mtd, linux-usb, linux-ext4,
	linux-rdma, devel, HPDD-discuss, linux-bcache, drbd-user,
	ocfs2-devel, kvm, ceph-devel, Chao Yu, linux-f2fs-devel

Recent commits to kernel/git/torvalds/linux.git have made the following
functions able to tolerate NULL arguments:

kmem_cache_destroy (commit 3942d29918522)
mempool_destroy (commit 4e3ca3e033d1)
dma_pool_destroy (commit 44d7175da6ea)

These patches remove the associated NULL tests for the files that I found
easy to compile test.  If these changes are OK, I will address the
remainder later.

---

 arch/x86/kvm/mmu.c                                 |    6 --
 block/bio-integrity.c                              |    7 --
 block/bio.c                                        |    7 --
 block/blk-core.c                                   |    3 -
 block/elevator.c                                   |    3 -
 drivers/atm/he.c                                   |    7 --
 drivers/block/aoe/aoedev.c                         |    3 -
 drivers/block/drbd/drbd_main.c                     |   21 ++-----
 drivers/block/pktcdvd.c                            |    3 -
 drivers/block/rbd.c                                |    6 --
 drivers/dma/dmaengine.c                            |    6 --
 drivers/firmware/google/gsmi.c                     |    3 -
 drivers/gpu/drm/i915/i915_dma.c                    |   19 ++----
 drivers/iommu/amd_iommu_init.c                     |    7 --
 drivers/md/bcache/bset.c                           |    3 -
 drivers/md/bcache/request.c                        |    3 -
 drivers/md/bcache/super.c                          |    9 +--
 drivers/md/dm-bufio.c                              |    3 -
 drivers/md/dm-cache-target.c                       |    3 -
 drivers/md/dm-crypt.c                              |    6 --
 drivers/md/dm-io.c                                 |    3 -
 drivers/md/dm-log-userspace-base.c                 |    3 -
 drivers/md/dm-region-hash.c                        |    4 -
 drivers/md/dm.c                                    |   13 +---
 drivers/md/multipath.c                             |    3 -
 drivers/md/raid1.c                                 |    6 --
 drivers/md/raid10.c                                |    9 +--
 drivers/md/raid5.c                                 |    3 -
 drivers/mtd/nand/nandsim.c                         |    3 -
 drivers/mtd/ubi/attach.c                           |    4 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c      |    3 -
 drivers/staging/lustre/lustre/llite/super25.c      |   16 +----
 drivers/staging/lustre/lustre/obdclass/genops.c    |   24 ++------
 drivers/staging/lustre/lustre/obdclass/lu_object.c |    6 --
 drivers/staging/rdma/hfi1/user_sdma.c              |    3 -
 drivers/thunderbolt/ctl.c                          |    3 -
 drivers/usb/gadget/udc/bdc/bdc_core.c              |    3 -
 drivers/usb/gadget/udc/gr_udc.c                    |    3 -
 drivers/usb/gadget/udc/mv_u3d_core.c               |    3 -
 drivers/usb/gadget/udc/mv_udc_core.c               |    3 -
 drivers/usb/host/fotg210-hcd.c                     |   12 +---
 drivers/usb/host/fusbh200-hcd.c                    |   12 +---
 drivers/usb/host/whci/init.c                       |    3 -
 drivers/usb/host/xhci-mem.c                        |   12 +---
 fs/btrfs/backref.c                                 |    3 -
 fs/btrfs/delayed-inode.c                           |    3 -
 fs/btrfs/delayed-ref.c                             |   12 +---
 fs/btrfs/disk-io.c                                 |    3 -
 fs/btrfs/extent_io.c                               |    6 --
 fs/btrfs/extent_map.c                              |    3 -
 fs/btrfs/file.c                                    |    3 -
 fs/btrfs/inode.c                                   |   18 ++----
 fs/btrfs/ordered-data.c                            |    3 -
 fs/dlm/memory.c                                    |    6 --
 fs/ecryptfs/main.c                                 |    3 -
 fs/ext4/crypto.c                                   |    9 +--
 fs/ext4/extents_status.c                           |    3 -
 fs/ext4/mballoc.c                                  |    3 -
 fs/f2fs/crypto.c                                   |    9 +--
 fs/gfs2/main.c                                     |   29 ++--------
 fs/jbd2/journal.c                                  |   15 +----
 fs/jbd2/revoke.c                                   |   12 +---
 fs/jbd2/transaction.c                              |    6 --
 fs/jffs2/malloc.c                                  |   27 +++------
 fs/nfsd/nfscache.c                                 |    6 --
 fs/nilfs2/super.c                                  |   12 +---
 fs/ocfs2/dlm/dlmlock.c                             |    3 -
 fs/ocfs2/dlm/dlmmaster.c                           |   16 +----
 fs/ocfs2/super.c                                   |   18 ++----
 fs/ocfs2/uptodate.c                                |    3 -
 lib/debugobjects.c                                 |    3 -
 net/core/sock.c                                    |   12 +---
 net/dccp/ackvec.c                                  |   12 +---
 net/dccp/ccid.c                                    |    3 -
 net/sunrpc/sched.c                                 |   12 +---
 75 files changed, 180 insertions(+), 381 deletions(-)

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [PATCH 00/39] drop null test before destroy functions
@ 2015-09-13 12:14 ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	dccp-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	ecryptfs-u79uwXL29TY76Z2rM5mHXA, dmaengine-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	HPDD-discuss-hn68Rpc1hR1g9hUCZPvPmw,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	ocfs2-devel-N0ozoZBvEnrZJqsBc5GL+g, Carolyn Wyborny,
	ceph-devel-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, Don Skidmore,
	linux-atm-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	Jesse Brandeburg, cluster-devel-H+wXaHxf7aLQT0dZR+AlfA,
	Matthew Vick, intel-wired-lan-qjLDD68F18P21nG7glBr7A,
	linux-ext4-u79uwXL29TY76Z2rM5mHXA, Mitch Williams, Chao Yu,
	linux-raid-u79uwXL29TY76Z2rM5mHXA,
	linux-bcache-u79uwXL29TY76Z2rM5mHXA, Dan Williams,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	Shannon Nelson, linux-kernel-u79uwXL29TaqPxH82wqD4g

Recent commits to kernel/git/torvalds/linux.git have made the following
functions able to tolerate NULL arguments:

kmem_cache_destroy (commit 3942d29918522)
mempool_destroy (commit 4e3ca3e033d1)
dma_pool_destroy (commit 44d7175da6ea)

These patches remove the associated NULL tests for the files that I found
easy to compile test.  If these changes are OK, I will address the
remainder later.

---

 arch/x86/kvm/mmu.c                                 |    6 --
 block/bio-integrity.c                              |    7 --
 block/bio.c                                        |    7 --
 block/blk-core.c                                   |    3 -
 block/elevator.c                                   |    3 -
 drivers/atm/he.c                                   |    7 --
 drivers/block/aoe/aoedev.c                         |    3 -
 drivers/block/drbd/drbd_main.c                     |   21 ++-----
 drivers/block/pktcdvd.c                            |    3 -
 drivers/block/rbd.c                                |    6 --
 drivers/dma/dmaengine.c                            |    6 --
 drivers/firmware/google/gsmi.c                     |    3 -
 drivers/gpu/drm/i915/i915_dma.c                    |   19 ++----
 drivers/iommu/amd_iommu_init.c                     |    7 --
 drivers/md/bcache/bset.c                           |    3 -
 drivers/md/bcache/request.c                        |    3 -
 drivers/md/bcache/super.c                          |    9 +--
 drivers/md/dm-bufio.c                              |    3 -
 drivers/md/dm-cache-target.c                       |    3 -
 drivers/md/dm-crypt.c                              |    6 --
 drivers/md/dm-io.c                                 |    3 -
 drivers/md/dm-log-userspace-base.c                 |    3 -
 drivers/md/dm-region-hash.c                        |    4 -
 drivers/md/dm.c                                    |   13 +---
 drivers/md/multipath.c                             |    3 -
 drivers/md/raid1.c                                 |    6 --
 drivers/md/raid10.c                                |    9 +--
 drivers/md/raid5.c                                 |    3 -
 drivers/mtd/nand/nandsim.c                         |    3 -
 drivers/mtd/ubi/attach.c                           |    4 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c      |    3 -
 drivers/staging/lustre/lustre/llite/super25.c      |   16 +----
 drivers/staging/lustre/lustre/obdclass/genops.c    |   24 ++------
 drivers/staging/lustre/lustre/obdclass/lu_object.c |    6 --
 drivers/staging/rdma/hfi1/user_sdma.c              |    3 -
 drivers/thunderbolt/ctl.c                          |    3 -
 drivers/usb/gadget/udc/bdc/bdc_core.c              |    3 -
 drivers/usb/gadget/udc/gr_udc.c                    |    3 -
 drivers/usb/gadget/udc/mv_u3d_core.c               |    3 -
 drivers/usb/gadget/udc/mv_udc_core.c               |    3 -
 drivers/usb/host/fotg210-hcd.c                     |   12 +---
 drivers/usb/host/fusbh200-hcd.c                    |   12 +---
 drivers/usb/host/whci/init.c                       |    3 -
 drivers/usb/host/xhci-mem.c                        |   12 +---
 fs/btrfs/backref.c                                 |    3 -
 fs/btrfs/delayed-inode.c                           |    3 -
 fs/btrfs/delayed-ref.c                             |   12 +---
 fs/btrfs/disk-io.c                                 |    3 -
 fs/btrfs/extent_io.c                               |    6 --
 fs/btrfs/extent_map.c                              |    3 -
 fs/btrfs/file.c                                    |    3 -
 fs/btrfs/inode.c                                   |   18 ++----
 fs/btrfs/ordered-data.c                            |    3 -
 fs/dlm/memory.c                                    |    6 --
 fs/ecryptfs/main.c                                 |    3 -
 fs/ext4/crypto.c                                   |    9 +--
 fs/ext4/extents_status.c                           |    3 -
 fs/ext4/mballoc.c                                  |    3 -
 fs/f2fs/crypto.c                                   |    9 +--
 fs/gfs2/main.c                                     |   29 ++--------
 fs/jbd2/journal.c                                  |   15 +----
 fs/jbd2/revoke.c                                   |   12 +---
 fs/jbd2/transaction.c                              |    6 --
 fs/jffs2/malloc.c                                  |   27 +++------
 fs/nfsd/nfscache.c                                 |    6 --
 fs/nilfs2/super.c                                  |   12 +---
 fs/ocfs2/dlm/dlmlock.c                             |    3 -
 fs/ocfs2/dlm/dlmmaster.c                           |   16 +----
 fs/ocfs2/super.c                                   |   18 ++----
 fs/ocfs2/uptodate.c                                |    3 -
 lib/debugobjects.c                                 |    3 -
 net/core/sock.c                                    |   12 +---
 net/dccp/ackvec.c                                  |   12 +---
 net/dccp/ccid.c                                    |    3 -
 net/sunrpc/sched.c                                 |   12 +---
 75 files changed, 180 insertions(+), 381 deletions(-)

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [PATCH 00/39] drop null test before destroy functions
@ 2015-09-13 12:14 ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	dccp-u79uwXL29TY76Z2rM5mHXA,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	ecryptfs-u79uwXL29TY76Z2rM5mHXA, dmaengine-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, kvm-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	HPDD-discuss-hn68Rpc1hR1g9hUCZPvPmw,
	linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	ocfs2-devel-N0ozoZBvEnrZJqsBc5GL+g, Carolyn Wyborny,
	ceph-devel-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, Don Skidmore,
	linux-atm-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	Jesse Brandeburg, cluster-devel-H+wXaHxf7aLQT0dZR+AlfA,
	Matthew Vick, intel-wired-lan-qjLDD68F18P21nG7glBr7A,
	linux-ext4-u79uwXL29TY76Z2rM5mHXA, Mitch Williams, Chao Yu,
	linux-raid-u79uwXL29TY76Z2rM5mHXA,
	linux-bcache-u79uwXL29TY76Z2rM5mHXA, Dan Williams,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	Shannon Nelson, linux-kernel-u79uwXL29TaqPxH82wqD4g

Recent commits to kernel/git/torvalds/linux.git have made the following
functions able to tolerate NULL arguments:

kmem_cache_destroy (commit 3942d29918522)
mempool_destroy (commit 4e3ca3e033d1)
dma_pool_destroy (commit 44d7175da6ea)

These patches remove the associated NULL tests for the files that I found
easy to compile test.  If these changes are OK, I will address the
remainder later.

---

 arch/x86/kvm/mmu.c                                 |    6 --
 block/bio-integrity.c                              |    7 --
 block/bio.c                                        |    7 --
 block/blk-core.c                                   |    3 -
 block/elevator.c                                   |    3 -
 drivers/atm/he.c                                   |    7 --
 drivers/block/aoe/aoedev.c                         |    3 -
 drivers/block/drbd/drbd_main.c                     |   21 ++-----
 drivers/block/pktcdvd.c                            |    3 -
 drivers/block/rbd.c                                |    6 --
 drivers/dma/dmaengine.c                            |    6 --
 drivers/firmware/google/gsmi.c                     |    3 -
 drivers/gpu/drm/i915/i915_dma.c                    |   19 ++----
 drivers/iommu/amd_iommu_init.c                     |    7 --
 drivers/md/bcache/bset.c                           |    3 -
 drivers/md/bcache/request.c                        |    3 -
 drivers/md/bcache/super.c                          |    9 +--
 drivers/md/dm-bufio.c                              |    3 -
 drivers/md/dm-cache-target.c                       |    3 -
 drivers/md/dm-crypt.c                              |    6 --
 drivers/md/dm-io.c                                 |    3 -
 drivers/md/dm-log-userspace-base.c                 |    3 -
 drivers/md/dm-region-hash.c                        |    4 -
 drivers/md/dm.c                                    |   13 +---
 drivers/md/multipath.c                             |    3 -
 drivers/md/raid1.c                                 |    6 --
 drivers/md/raid10.c                                |    9 +--
 drivers/md/raid5.c                                 |    3 -
 drivers/mtd/nand/nandsim.c                         |    3 -
 drivers/mtd/ubi/attach.c                           |    4 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c      |    3 -
 drivers/staging/lustre/lustre/llite/super25.c      |   16 +----
 drivers/staging/lustre/lustre/obdclass/genops.c    |   24 ++------
 drivers/staging/lustre/lustre/obdclass/lu_object.c |    6 --
 drivers/staging/rdma/hfi1/user_sdma.c              |    3 -
 drivers/thunderbolt/ctl.c                          |    3 -
 drivers/usb/gadget/udc/bdc/bdc_core.c              |    3 -
 drivers/usb/gadget/udc/gr_udc.c                    |    3 -
 drivers/usb/gadget/udc/mv_u3d_core.c               |    3 -
 drivers/usb/gadget/udc/mv_udc_core.c               |    3 -
 drivers/usb/host/fotg210-hcd.c                     |   12 +---
 drivers/usb/host/fusbh200-hcd.c                    |   12 +---
 drivers/usb/host/whci/init.c                       |    3 -
 drivers/usb/host/xhci-mem.c                        |   12 +---
 fs/btrfs/backref.c                                 |    3 -
 fs/btrfs/delayed-inode.c                           |    3 -
 fs/btrfs/delayed-ref.c                             |   12 +---
 fs/btrfs/disk-io.c                                 |    3 -
 fs/btrfs/extent_io.c                               |    6 --
 fs/btrfs/extent_map.c                              |    3 -
 fs/btrfs/file.c                                    |    3 -
 fs/btrfs/inode.c                                   |   18 ++----
 fs/btrfs/ordered-data.c                            |    3 -
 fs/dlm/memory.c                                    |    6 --
 fs/ecryptfs/main.c                                 |    3 -
 fs/ext4/crypto.c                                   |    9 +--
 fs/ext4/extents_status.c                           |    3 -
 fs/ext4/mballoc.c                                  |    3 -
 fs/f2fs/crypto.c                                   |    9 +--
 fs/gfs2/main.c                                     |   29 ++--------
 fs/jbd2/journal.c                                  |   15 +----
 fs/jbd2/revoke.c                                   |   12 +---
 fs/jbd2/transaction.c                              |    6 --
 fs/jffs2/malloc.c                                  |   27 +++------
 fs/nfsd/nfscache.c                                 |    6 --
 fs/nilfs2/super.c                                  |   12 +---
 fs/ocfs2/dlm/dlmlock.c                             |    3 -
 fs/ocfs2/dlm/dlmmaster.c                           |   16 +----
 fs/ocfs2/super.c                                   |   18 ++----
 fs/ocfs2/uptodate.c                                |    3 -
 lib/debugobjects.c                                 |    3 -
 net/core/sock.c                                    |   12 +---
 net/dccp/ackvec.c                                  |   12 +---
 net/dccp/ccid.c                                    |    3 -
 net/sunrpc/sched.c                                 |   12 +---
 75 files changed, 180 insertions(+), 381 deletions(-)

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [Intel-wired-lan] [PATCH 00/39] drop null test before destroy functions
@ 2015-09-13 12:14 ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: intel-wired-lan

Recent commits to kernel/git/torvalds/linux.git have made the following
functions able to tolerate NULL arguments:

kmem_cache_destroy (commit 3942d29918522)
mempool_destroy (commit 4e3ca3e033d1)
dma_pool_destroy (commit 44d7175da6ea)

These patches remove the associated NULL tests for the files that I found
easy to compile test.  If these changes are OK, I will address the
remainder later.

---

 arch/x86/kvm/mmu.c                                 |    6 --
 block/bio-integrity.c                              |    7 --
 block/bio.c                                        |    7 --
 block/blk-core.c                                   |    3 -
 block/elevator.c                                   |    3 -
 drivers/atm/he.c                                   |    7 --
 drivers/block/aoe/aoedev.c                         |    3 -
 drivers/block/drbd/drbd_main.c                     |   21 ++-----
 drivers/block/pktcdvd.c                            |    3 -
 drivers/block/rbd.c                                |    6 --
 drivers/dma/dmaengine.c                            |    6 --
 drivers/firmware/google/gsmi.c                     |    3 -
 drivers/gpu/drm/i915/i915_dma.c                    |   19 ++----
 drivers/iommu/amd_iommu_init.c                     |    7 --
 drivers/md/bcache/bset.c                           |    3 -
 drivers/md/bcache/request.c                        |    3 -
 drivers/md/bcache/super.c                          |    9 +--
 drivers/md/dm-bufio.c                              |    3 -
 drivers/md/dm-cache-target.c                       |    3 -
 drivers/md/dm-crypt.c                              |    6 --
 drivers/md/dm-io.c                                 |    3 -
 drivers/md/dm-log-userspace-base.c                 |    3 -
 drivers/md/dm-region-hash.c                        |    4 -
 drivers/md/dm.c                                    |   13 +---
 drivers/md/multipath.c                             |    3 -
 drivers/md/raid1.c                                 |    6 --
 drivers/md/raid10.c                                |    9 +--
 drivers/md/raid5.c                                 |    3 -
 drivers/mtd/nand/nandsim.c                         |    3 -
 drivers/mtd/ubi/attach.c                           |    4 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c      |    3 -
 drivers/staging/lustre/lustre/llite/super25.c      |   16 +----
 drivers/staging/lustre/lustre/obdclass/genops.c    |   24 ++------
 drivers/staging/lustre/lustre/obdclass/lu_object.c |    6 --
 drivers/staging/rdma/hfi1/user_sdma.c              |    3 -
 drivers/thunderbolt/ctl.c                          |    3 -
 drivers/usb/gadget/udc/bdc/bdc_core.c              |    3 -
 drivers/usb/gadget/udc/gr_udc.c                    |    3 -
 drivers/usb/gadget/udc/mv_u3d_core.c               |    3 -
 drivers/usb/gadget/udc/mv_udc_core.c               |    3 -
 drivers/usb/host/fotg210-hcd.c                     |   12 +---
 drivers/usb/host/fusbh200-hcd.c                    |   12 +---
 drivers/usb/host/whci/init.c                       |    3 -
 drivers/usb/host/xhci-mem.c                        |   12 +---
 fs/btrfs/backref.c                                 |    3 -
 fs/btrfs/delayed-inode.c                           |    3 -
 fs/btrfs/delayed-ref.c                             |   12 +---
 fs/btrfs/disk-io.c                                 |    3 -
 fs/btrfs/extent_io.c                               |    6 --
 fs/btrfs/extent_map.c                              |    3 -
 fs/btrfs/file.c                                    |    3 -
 fs/btrfs/inode.c                                   |   18 ++----
 fs/btrfs/ordered-data.c                            |    3 -
 fs/dlm/memory.c                                    |    6 --
 fs/ecryptfs/main.c                                 |    3 -
 fs/ext4/crypto.c                                   |    9 +--
 fs/ext4/extents_status.c                           |    3 -
 fs/ext4/mballoc.c                                  |    3 -
 fs/f2fs/crypto.c                                   |    9 +--
 fs/gfs2/main.c                                     |   29 ++--------
 fs/jbd2/journal.c                                  |   15 +----
 fs/jbd2/revoke.c                                   |   12 +---
 fs/jbd2/transaction.c                              |    6 --
 fs/jffs2/malloc.c                                  |   27 +++------
 fs/nfsd/nfscache.c                                 |    6 --
 fs/nilfs2/super.c                                  |   12 +---
 fs/ocfs2/dlm/dlmlock.c                             |    3 -
 fs/ocfs2/dlm/dlmmaster.c                           |   16 +----
 fs/ocfs2/super.c                                   |   18 ++----
 fs/ocfs2/uptodate.c                                |    3 -
 lib/debugobjects.c                                 |    3 -
 net/core/sock.c                                    |   12 +---
 net/dccp/ackvec.c                                  |   12 +---
 net/dccp/ccid.c                                    |    3 -
 net/sunrpc/sched.c                                 |   12 +---
 75 files changed, 180 insertions(+), 381 deletions(-)

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [Cluster-devel] [PATCH 00/39] drop null test before destroy functions
@ 2015-09-13 12:14 ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Recent commits to kernel/git/torvalds/linux.git have made the following
functions able to tolerate NULL arguments:

kmem_cache_destroy (commit 3942d29918522)
mempool_destroy (commit 4e3ca3e033d1)
dma_pool_destroy (commit 44d7175da6ea)

These patches remove the associated NULL tests for the files that I found
easy to compile test.  If these changes are OK, I will address the
remainder later.

---

 arch/x86/kvm/mmu.c                                 |    6 --
 block/bio-integrity.c                              |    7 --
 block/bio.c                                        |    7 --
 block/blk-core.c                                   |    3 -
 block/elevator.c                                   |    3 -
 drivers/atm/he.c                                   |    7 --
 drivers/block/aoe/aoedev.c                         |    3 -
 drivers/block/drbd/drbd_main.c                     |   21 ++-----
 drivers/block/pktcdvd.c                            |    3 -
 drivers/block/rbd.c                                |    6 --
 drivers/dma/dmaengine.c                            |    6 --
 drivers/firmware/google/gsmi.c                     |    3 -
 drivers/gpu/drm/i915/i915_dma.c                    |   19 ++----
 drivers/iommu/amd_iommu_init.c                     |    7 --
 drivers/md/bcache/bset.c                           |    3 -
 drivers/md/bcache/request.c                        |    3 -
 drivers/md/bcache/super.c                          |    9 +--
 drivers/md/dm-bufio.c                              |    3 -
 drivers/md/dm-cache-target.c                       |    3 -
 drivers/md/dm-crypt.c                              |    6 --
 drivers/md/dm-io.c                                 |    3 -
 drivers/md/dm-log-userspace-base.c                 |    3 -
 drivers/md/dm-region-hash.c                        |    4 -
 drivers/md/dm.c                                    |   13 +---
 drivers/md/multipath.c                             |    3 -
 drivers/md/raid1.c                                 |    6 --
 drivers/md/raid10.c                                |    9 +--
 drivers/md/raid5.c                                 |    3 -
 drivers/mtd/nand/nandsim.c                         |    3 -
 drivers/mtd/ubi/attach.c                           |    4 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c      |    3 -
 drivers/staging/lustre/lustre/llite/super25.c      |   16 +----
 drivers/staging/lustre/lustre/obdclass/genops.c    |   24 ++------
 drivers/staging/lustre/lustre/obdclass/lu_object.c |    6 --
 drivers/staging/rdma/hfi1/user_sdma.c              |    3 -
 drivers/thunderbolt/ctl.c                          |    3 -
 drivers/usb/gadget/udc/bdc/bdc_core.c              |    3 -
 drivers/usb/gadget/udc/gr_udc.c                    |    3 -
 drivers/usb/gadget/udc/mv_u3d_core.c               |    3 -
 drivers/usb/gadget/udc/mv_udc_core.c               |    3 -
 drivers/usb/host/fotg210-hcd.c                     |   12 +---
 drivers/usb/host/fusbh200-hcd.c                    |   12 +---
 drivers/usb/host/whci/init.c                       |    3 -
 drivers/usb/host/xhci-mem.c                        |   12 +---
 fs/btrfs/backref.c                                 |    3 -
 fs/btrfs/delayed-inode.c                           |    3 -
 fs/btrfs/delayed-ref.c                             |   12 +---
 fs/btrfs/disk-io.c                                 |    3 -
 fs/btrfs/extent_io.c                               |    6 --
 fs/btrfs/extent_map.c                              |    3 -
 fs/btrfs/file.c                                    |    3 -
 fs/btrfs/inode.c                                   |   18 ++----
 fs/btrfs/ordered-data.c                            |    3 -
 fs/dlm/memory.c                                    |    6 --
 fs/ecryptfs/main.c                                 |    3 -
 fs/ext4/crypto.c                                   |    9 +--
 fs/ext4/extents_status.c                           |    3 -
 fs/ext4/mballoc.c                                  |    3 -
 fs/f2fs/crypto.c                                   |    9 +--
 fs/gfs2/main.c                                     |   29 ++--------
 fs/jbd2/journal.c                                  |   15 +----
 fs/jbd2/revoke.c                                   |   12 +---
 fs/jbd2/transaction.c                              |    6 --
 fs/jffs2/malloc.c                                  |   27 +++------
 fs/nfsd/nfscache.c                                 |    6 --
 fs/nilfs2/super.c                                  |   12 +---
 fs/ocfs2/dlm/dlmlock.c                             |    3 -
 fs/ocfs2/dlm/dlmmaster.c                           |   16 +----
 fs/ocfs2/super.c                                   |   18 ++----
 fs/ocfs2/uptodate.c                                |    3 -
 lib/debugobjects.c                                 |    3 -
 net/core/sock.c                                    |   12 +---
 net/dccp/ackvec.c                                  |   12 +---
 net/dccp/ccid.c                                    |    3 -
 net/sunrpc/sched.c                                 |   12 +---
 75 files changed, 180 insertions(+), 381 deletions(-)



^ permalink raw reply	[flat|nested] 163+ messages in thread

* [PATCH 00/39] drop null test before destroy functions
@ 2015-09-13 12:14 ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: dccp

Recent commits to kernel/git/torvalds/linux.git have made the following
functions able to tolerate NULL arguments:

kmem_cache_destroy (commit 3942d29918522)
mempool_destroy (commit 4e3ca3e033d1)
dma_pool_destroy (commit 44d7175da6ea)

These patches remove the associated NULL tests for the files that I found
easy to compile test.  If these changes are OK, I will address the
remainder later.

---

 arch/x86/kvm/mmu.c                                 |    6 --
 block/bio-integrity.c                              |    7 --
 block/bio.c                                        |    7 --
 block/blk-core.c                                   |    3 -
 block/elevator.c                                   |    3 -
 drivers/atm/he.c                                   |    7 --
 drivers/block/aoe/aoedev.c                         |    3 -
 drivers/block/drbd/drbd_main.c                     |   21 ++-----
 drivers/block/pktcdvd.c                            |    3 -
 drivers/block/rbd.c                                |    6 --
 drivers/dma/dmaengine.c                            |    6 --
 drivers/firmware/google/gsmi.c                     |    3 -
 drivers/gpu/drm/i915/i915_dma.c                    |   19 ++----
 drivers/iommu/amd_iommu_init.c                     |    7 --
 drivers/md/bcache/bset.c                           |    3 -
 drivers/md/bcache/request.c                        |    3 -
 drivers/md/bcache/super.c                          |    9 +--
 drivers/md/dm-bufio.c                              |    3 -
 drivers/md/dm-cache-target.c                       |    3 -
 drivers/md/dm-crypt.c                              |    6 --
 drivers/md/dm-io.c                                 |    3 -
 drivers/md/dm-log-userspace-base.c                 |    3 -
 drivers/md/dm-region-hash.c                        |    4 -
 drivers/md/dm.c                                    |   13 +---
 drivers/md/multipath.c                             |    3 -
 drivers/md/raid1.c                                 |    6 --
 drivers/md/raid10.c                                |    9 +--
 drivers/md/raid5.c                                 |    3 -
 drivers/mtd/nand/nandsim.c                         |    3 -
 drivers/mtd/ubi/attach.c                           |    4 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c      |    3 -
 drivers/staging/lustre/lustre/llite/super25.c      |   16 +----
 drivers/staging/lustre/lustre/obdclass/genops.c    |   24 ++------
 drivers/staging/lustre/lustre/obdclass/lu_object.c |    6 --
 drivers/staging/rdma/hfi1/user_sdma.c              |    3 -
 drivers/thunderbolt/ctl.c                          |    3 -
 drivers/usb/gadget/udc/bdc/bdc_core.c              |    3 -
 drivers/usb/gadget/udc/gr_udc.c                    |    3 -
 drivers/usb/gadget/udc/mv_u3d_core.c               |    3 -
 drivers/usb/gadget/udc/mv_udc_core.c               |    3 -
 drivers/usb/host/fotg210-hcd.c                     |   12 +---
 drivers/usb/host/fusbh200-hcd.c                    |   12 +---
 drivers/usb/host/whci/init.c                       |    3 -
 drivers/usb/host/xhci-mem.c                        |   12 +---
 fs/btrfs/backref.c                                 |    3 -
 fs/btrfs/delayed-inode.c                           |    3 -
 fs/btrfs/delayed-ref.c                             |   12 +---
 fs/btrfs/disk-io.c                                 |    3 -
 fs/btrfs/extent_io.c                               |    6 --
 fs/btrfs/extent_map.c                              |    3 -
 fs/btrfs/file.c                                    |    3 -
 fs/btrfs/inode.c                                   |   18 ++----
 fs/btrfs/ordered-data.c                            |    3 -
 fs/dlm/memory.c                                    |    6 --
 fs/ecryptfs/main.c                                 |    3 -
 fs/ext4/crypto.c                                   |    9 +--
 fs/ext4/extents_status.c                           |    3 -
 fs/ext4/mballoc.c                                  |    3 -
 fs/f2fs/crypto.c                                   |    9 +--
 fs/gfs2/main.c                                     |   29 ++--------
 fs/jbd2/journal.c                                  |   15 +----
 fs/jbd2/revoke.c                                   |   12 +---
 fs/jbd2/transaction.c                              |    6 --
 fs/jffs2/malloc.c                                  |   27 +++------
 fs/nfsd/nfscache.c                                 |    6 --
 fs/nilfs2/super.c                                  |   12 +---
 fs/ocfs2/dlm/dlmlock.c                             |    3 -
 fs/ocfs2/dlm/dlmmaster.c                           |   16 +----
 fs/ocfs2/super.c                                   |   18 ++----
 fs/ocfs2/uptodate.c                                |    3 -
 lib/debugobjects.c                                 |    3 -
 net/core/sock.c                                    |   12 +---
 net/dccp/ackvec.c                                  |   12 +---
 net/dccp/ccid.c                                    |    3 -
 net/sunrpc/sched.c                                 |   12 +---
 75 files changed, 180 insertions(+), 381 deletions(-)

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [PATCH 01/39] mtd: nandsim: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:14   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: David Woodhouse
  Cc: sergey.senozhatsky, kernel-janitors, Brian Norris, linux-mtd,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/mtd/nand/nandsim.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index 95d0cc4..b16d70a 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -649,8 +649,7 @@ static void free_device(struct nandsim *ns)
 				kmem_cache_free(ns->nand_pages_slab,
 						ns->pages[i].byte);
 		}
-		if (ns->nand_pages_slab)
-			kmem_cache_destroy(ns->nand_pages_slab);
+		kmem_cache_destroy(ns->nand_pages_slab);
 		vfree(ns->pages);
 	}
 }


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 01/39] mtd: nandsim: drop null test before destroy functions
@ 2015-09-13 12:14   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: David Woodhouse
  Cc: sergey.senozhatsky, kernel-janitors, Brian Norris, linux-mtd,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/mtd/nand/nandsim.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c
index 95d0cc4..b16d70a 100644
--- a/drivers/mtd/nand/nandsim.c
+++ b/drivers/mtd/nand/nandsim.c
@@ -649,8 +649,7 @@ static void free_device(struct nandsim *ns)
 				kmem_cache_free(ns->nand_pages_slab,
 						ns->pages[i].byte);
 		}
-		if (ns->nand_pages_slab)
-			kmem_cache_destroy(ns->nand_pages_slab);
+		kmem_cache_destroy(ns->nand_pages_slab);
 		vfree(ns->pages);
 	}
 }


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 02/39] nilfs2: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
  (?)
@ 2015-09-13 12:14   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: Ryusuke Konishi
  Cc: sergey.senozhatsky, kernel-janitors, linux-nilfs, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/nilfs2/super.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index f47585b..c69455a 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -1405,14 +1405,10 @@ static void nilfs_destroy_cachep(void)
 	 */
 	rcu_barrier();
 
-	if (nilfs_inode_cachep)
-		kmem_cache_destroy(nilfs_inode_cachep);
-	if (nilfs_transaction_cachep)
-		kmem_cache_destroy(nilfs_transaction_cachep);
-	if (nilfs_segbuf_cachep)
-		kmem_cache_destroy(nilfs_segbuf_cachep);
-	if (nilfs_btree_path_cache)
-		kmem_cache_destroy(nilfs_btree_path_cache);
+	kmem_cache_destroy(nilfs_inode_cachep);
+	kmem_cache_destroy(nilfs_transaction_cachep);
+	kmem_cache_destroy(nilfs_segbuf_cachep);
+	kmem_cache_destroy(nilfs_btree_path_cache);
 }
 
 static int __init nilfs_init_cachep(void)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 02/39] nilfs2: drop null test before destroy functions
@ 2015-09-13 12:14   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: Ryusuke Konishi
  Cc: sergey.senozhatsky, kernel-janitors, linux-nilfs, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/nilfs2/super.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index f47585b..c69455a 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -1405,14 +1405,10 @@ static void nilfs_destroy_cachep(void)
 	 */
 	rcu_barrier();
 
-	if (nilfs_inode_cachep)
-		kmem_cache_destroy(nilfs_inode_cachep);
-	if (nilfs_transaction_cachep)
-		kmem_cache_destroy(nilfs_transaction_cachep);
-	if (nilfs_segbuf_cachep)
-		kmem_cache_destroy(nilfs_segbuf_cachep);
-	if (nilfs_btree_path_cache)
-		kmem_cache_destroy(nilfs_btree_path_cache);
+	kmem_cache_destroy(nilfs_inode_cachep);
+	kmem_cache_destroy(nilfs_transaction_cachep);
+	kmem_cache_destroy(nilfs_segbuf_cachep);
+	kmem_cache_destroy(nilfs_btree_path_cache);
 }
 
 static int __init nilfs_init_cachep(void)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 02/39] nilfs2: drop null test before destroy functions
@ 2015-09-13 12:14   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: Ryusuke Konishi
  Cc: sergey.senozhatsky-Re5JQEeQqe8AvxtiuMwx3w,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>

---
 fs/nilfs2/super.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index f47585b..c69455a 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -1405,14 +1405,10 @@ static void nilfs_destroy_cachep(void)
 	 */
 	rcu_barrier();
 
-	if (nilfs_inode_cachep)
-		kmem_cache_destroy(nilfs_inode_cachep);
-	if (nilfs_transaction_cachep)
-		kmem_cache_destroy(nilfs_transaction_cachep);
-	if (nilfs_segbuf_cachep)
-		kmem_cache_destroy(nilfs_segbuf_cachep);
-	if (nilfs_btree_path_cache)
-		kmem_cache_destroy(nilfs_btree_path_cache);
+	kmem_cache_destroy(nilfs_inode_cachep);
+	kmem_cache_destroy(nilfs_transaction_cachep);
+	kmem_cache_destroy(nilfs_segbuf_cachep);
+	kmem_cache_destroy(nilfs_btree_path_cache);
 }
 
 static int __init nilfs_init_cachep(void)

--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 03/39] firmware: google: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:14   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: sergey.senozhatsky, kernel-janitors

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/firmware/google/gsmi.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c
index f1ab05e..c463871 100644
--- a/drivers/firmware/google/gsmi.c
+++ b/drivers/firmware/google/gsmi.c
@@ -910,8 +910,7 @@ out_err:
 	gsmi_buf_free(gsmi_dev.param_buf);
 	gsmi_buf_free(gsmi_dev.data_buf);
 	gsmi_buf_free(gsmi_dev.name_buf);
-	if (gsmi_dev.dma_pool)
-		dma_pool_destroy(gsmi_dev.dma_pool);
+	dma_pool_destroy(gsmi_dev.dma_pool);
 	platform_device_unregister(gsmi_dev.pdev);
 	pr_info("gsmi: failed to load: %d\n", ret);
 	return ret;


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 03/39] firmware: google: drop null test before destroy functions
@ 2015-09-13 12:14   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: sergey.senozhatsky, kernel-janitors

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/firmware/google/gsmi.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c
index f1ab05e..c463871 100644
--- a/drivers/firmware/google/gsmi.c
+++ b/drivers/firmware/google/gsmi.c
@@ -910,8 +910,7 @@ out_err:
 	gsmi_buf_free(gsmi_dev.param_buf);
 	gsmi_buf_free(gsmi_dev.data_buf);
 	gsmi_buf_free(gsmi_dev.name_buf);
-	if (gsmi_dev.dma_pool)
-		dma_pool_destroy(gsmi_dev.dma_pool);
+	dma_pool_destroy(gsmi_dev.dma_pool);
 	platform_device_unregister(gsmi_dev.pdev);
 	pr_info("gsmi: failed to load: %d\n", ret);
 	return ret;


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 04/39] debugobjects: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:14   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: sergey.senozhatsky, kernel-janitors

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 lib/debugobjects.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 547f7f9..7bf529f 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -1089,8 +1089,7 @@ void __init debug_objects_mem_init(void)
 
 	if (!obj_cache || debug_objects_replace_static_objects()) {
 		debug_objects_enabled = 0;
-		if (obj_cache)
-			kmem_cache_destroy(obj_cache);
+		kmem_cache_destroy(obj_cache);
 		pr_warn("out of memory.\n");
 	} else
 		debug_objects_selftest();


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 04/39] debugobjects: drop null test before destroy functions
@ 2015-09-13 12:14   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: sergey.senozhatsky, kernel-janitors

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 lib/debugobjects.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 547f7f9..7bf529f 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -1089,8 +1089,7 @@ void __init debug_objects_mem_init(void)
 
 	if (!obj_cache || debug_objects_replace_static_objects()) {
 		debug_objects_enabled = 0;
-		if (obj_cache)
-			kmem_cache_destroy(obj_cache);
+		kmem_cache_destroy(obj_cache);
 		pr_warn("out of memory.\n");
 	} else
 		debug_objects_selftest();


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 05/39] xhci: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:14   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: Mathias Nyman
  Cc: sergey.senozhatsky, kernel-janitors, Greg Kroah-Hartman,
	linux-usb, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/host/xhci-mem.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 9a8c936..40618d1 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1829,24 +1829,20 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
 	for (i = 1; i < MAX_HC_SLOTS; ++i)
 		xhci_free_virt_device(xhci, i);
 
-	if (xhci->segment_pool)
-		dma_pool_destroy(xhci->segment_pool);
+	dma_pool_destroy(xhci->segment_pool);
 	xhci->segment_pool = NULL;
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed segment pool");
 
-	if (xhci->device_pool)
-		dma_pool_destroy(xhci->device_pool);
+	dma_pool_destroy(xhci->device_pool);
 	xhci->device_pool = NULL;
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed device context pool");
 
-	if (xhci->small_streams_pool)
-		dma_pool_destroy(xhci->small_streams_pool);
+	dma_pool_destroy(xhci->small_streams_pool);
 	xhci->small_streams_pool = NULL;
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init,
 			"Freed small stream array pool");
 
-	if (xhci->medium_streams_pool)
-		dma_pool_destroy(xhci->medium_streams_pool);
+	dma_pool_destroy(xhci->medium_streams_pool);
 	xhci->medium_streams_pool = NULL;
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init,
 			"Freed medium stream array pool");


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 05/39] xhci: drop null test before destroy functions
@ 2015-09-13 12:14   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: Mathias Nyman
  Cc: sergey.senozhatsky, kernel-janitors, Greg Kroah-Hartman,
	linux-usb, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/host/xhci-mem.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 9a8c936..40618d1 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1829,24 +1829,20 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
 	for (i = 1; i < MAX_HC_SLOTS; ++i)
 		xhci_free_virt_device(xhci, i);
 
-	if (xhci->segment_pool)
-		dma_pool_destroy(xhci->segment_pool);
+	dma_pool_destroy(xhci->segment_pool);
 	xhci->segment_pool = NULL;
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed segment pool");
 
-	if (xhci->device_pool)
-		dma_pool_destroy(xhci->device_pool);
+	dma_pool_destroy(xhci->device_pool);
 	xhci->device_pool = NULL;
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Freed device context pool");
 
-	if (xhci->small_streams_pool)
-		dma_pool_destroy(xhci->small_streams_pool);
+	dma_pool_destroy(xhci->small_streams_pool);
 	xhci->small_streams_pool = NULL;
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init,
 			"Freed small stream array pool");
 
-	if (xhci->medium_streams_pool)
-		dma_pool_destroy(xhci->medium_streams_pool);
+	dma_pool_destroy(xhci->medium_streams_pool);
 	xhci->medium_streams_pool = NULL;
 	xhci_dbg_trace(xhci, trace_xhci_dbg_init,
 			"Freed medium stream array pool");


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 06/39] Btrfs: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:14   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: Chris Mason
  Cc: sergey.senozhatsky, kernel-janitors, Josef Bacik, David Sterba,
	linux-btrfs, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/btrfs/backref.c       |    3 +--
 fs/btrfs/delayed-inode.c |    3 +--
 fs/btrfs/delayed-ref.c   |   12 ++++--------
 fs/btrfs/disk-io.c       |    3 +--
 fs/btrfs/extent_io.c     |    6 ++----
 fs/btrfs/extent_map.c    |    3 +--
 fs/btrfs/file.c          |    3 +--
 fs/btrfs/inode.c         |   18 ++++++------------
 fs/btrfs/ordered-data.c  |    3 +--
 9 files changed, 18 insertions(+), 36 deletions(-)

diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 6a98bdd..6416c11 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -20,8 +20,7 @@ int __init extent_map_init(void)
 
 void extent_map_exit(void)
 {
-	if (extent_map_cache)
-		kmem_cache_destroy(extent_map_cache);
+	kmem_cache_destroy(extent_map_cache);
 }
 
 /**
diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
index ac3e81d..54ae98d 100644
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -787,14 +787,10 @@ btrfs_find_delayed_ref_head(struct btrfs_trans_handle *trans, u64 bytenr)
 
 void btrfs_delayed_ref_exit(void)
 {
-	if (btrfs_delayed_ref_head_cachep)
-		kmem_cache_destroy(btrfs_delayed_ref_head_cachep);
-	if (btrfs_delayed_tree_ref_cachep)
-		kmem_cache_destroy(btrfs_delayed_tree_ref_cachep);
-	if (btrfs_delayed_data_ref_cachep)
-		kmem_cache_destroy(btrfs_delayed_data_ref_cachep);
-	if (btrfs_delayed_extent_op_cachep)
-		kmem_cache_destroy(btrfs_delayed_extent_op_cachep);
+	kmem_cache_destroy(btrfs_delayed_ref_head_cachep);
+	kmem_cache_destroy(btrfs_delayed_tree_ref_cachep);
+	kmem_cache_destroy(btrfs_delayed_data_ref_cachep);
+	kmem_cache_destroy(btrfs_delayed_extent_op_cachep);
 }
 
 int btrfs_delayed_ref_init(void)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 0d98aee..6cc044d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -103,8 +103,7 @@ int __init btrfs_end_io_wq_init(void)
 
 void btrfs_end_io_wq_exit(void)
 {
-	if (btrfs_end_io_wq_cache)
-		kmem_cache_destroy(btrfs_end_io_wq_cache);
+	kmem_cache_destroy(btrfs_end_io_wq_cache);
 }
 
 /*
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index a2ae427..1fb6ce3 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -43,8 +43,7 @@ int __init btrfs_delayed_inode_init(void)
 
 void btrfs_delayed_inode_exit(void)
 {
-	if (delayed_node_cache)
-		kmem_cache_destroy(delayed_node_cache);
+	kmem_cache_destroy(delayed_node_cache);
 }
 
 static inline void btrfs_init_delayed_node(
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index b823fac..c8d0210 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -2820,8 +2820,7 @@ const struct file_operations btrfs_file_operations = {
 
 void btrfs_auto_defrag_exit(void)
 {
-	if (btrfs_inode_defrag_cachep)
-		kmem_cache_destroy(btrfs_inode_defrag_cachep);
+	kmem_cache_destroy(btrfs_inode_defrag_cachep);
 }
 
 int btrfs_auto_defrag_init(void)
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index 52170cf..2e5a1e1 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -1072,6 +1072,5 @@ int __init ordered_data_init(void)
 
 void ordered_data_exit(void)
 {
-	if (btrfs_ordered_extent_cache)
-		kmem_cache_destroy(btrfs_ordered_extent_cache);
+	kmem_cache_destroy(btrfs_ordered_extent_cache);
 }
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a0fa725..c7904d3 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9031,18 +9031,12 @@ void btrfs_destroy_cachep(void)
 	 * destroy cache.
 	 */
 	rcu_barrier();
-	if (btrfs_inode_cachep)
-		kmem_cache_destroy(btrfs_inode_cachep);
-	if (btrfs_trans_handle_cachep)
-		kmem_cache_destroy(btrfs_trans_handle_cachep);
-	if (btrfs_transaction_cachep)
-		kmem_cache_destroy(btrfs_transaction_cachep);
-	if (btrfs_path_cachep)
-		kmem_cache_destroy(btrfs_path_cachep);
-	if (btrfs_free_space_cachep)
-		kmem_cache_destroy(btrfs_free_space_cachep);
-	if (btrfs_delalloc_work_cachep)
-		kmem_cache_destroy(btrfs_delalloc_work_cachep);
+	kmem_cache_destroy(btrfs_inode_cachep);
+	kmem_cache_destroy(btrfs_trans_handle_cachep);
+	kmem_cache_destroy(btrfs_transaction_cachep);
+	kmem_cache_destroy(btrfs_path_cachep);
+	kmem_cache_destroy(btrfs_free_space_cachep);
+	kmem_cache_destroy(btrfs_delalloc_work_cachep);
 }
 
 int btrfs_init_cachep(void)
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index ecbc63d..6763b1f 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -148,8 +148,7 @@ int __init btrfs_prelim_ref_init(void)
 
 void btrfs_prelim_ref_exit(void)
 {
-	if (btrfs_prelim_ref_cache)
-		kmem_cache_destroy(btrfs_prelim_ref_cache);
+	kmem_cache_destroy(btrfs_prelim_ref_cache);
 }
 
 /*
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index f1018cf..b538b3e 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -187,10 +187,8 @@ void extent_io_exit(void)
 	 * destroy caches.
 	 */
 	rcu_barrier();
-	if (extent_state_cache)
-		kmem_cache_destroy(extent_state_cache);
-	if (extent_buffer_cache)
-		kmem_cache_destroy(extent_buffer_cache);
+	kmem_cache_destroy(extent_state_cache);
+	kmem_cache_destroy(extent_buffer_cache);
 	if (btrfs_bioset)
 		bioset_free(btrfs_bioset);
 }


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 06/39] Btrfs: drop null test before destroy functions
@ 2015-09-13 12:14   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:14 UTC (permalink / raw)
  To: Chris Mason
  Cc: sergey.senozhatsky, kernel-janitors, Josef Bacik, David Sterba,
	linux-btrfs, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/btrfs/backref.c       |    3 +--
 fs/btrfs/delayed-inode.c |    3 +--
 fs/btrfs/delayed-ref.c   |   12 ++++--------
 fs/btrfs/disk-io.c       |    3 +--
 fs/btrfs/extent_io.c     |    6 ++----
 fs/btrfs/extent_map.c    |    3 +--
 fs/btrfs/file.c          |    3 +--
 fs/btrfs/inode.c         |   18 ++++++------------
 fs/btrfs/ordered-data.c  |    3 +--
 9 files changed, 18 insertions(+), 36 deletions(-)

diff --git a/fs/btrfs/extent_map.c b/fs/btrfs/extent_map.c
index 6a98bdd..6416c11 100644
--- a/fs/btrfs/extent_map.c
+++ b/fs/btrfs/extent_map.c
@@ -20,8 +20,7 @@ int __init extent_map_init(void)
 
 void extent_map_exit(void)
 {
-	if (extent_map_cache)
-		kmem_cache_destroy(extent_map_cache);
+	kmem_cache_destroy(extent_map_cache);
 }
 
 /**
diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
index ac3e81d..54ae98d 100644
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -787,14 +787,10 @@ btrfs_find_delayed_ref_head(struct btrfs_trans_handle *trans, u64 bytenr)
 
 void btrfs_delayed_ref_exit(void)
 {
-	if (btrfs_delayed_ref_head_cachep)
-		kmem_cache_destroy(btrfs_delayed_ref_head_cachep);
-	if (btrfs_delayed_tree_ref_cachep)
-		kmem_cache_destroy(btrfs_delayed_tree_ref_cachep);
-	if (btrfs_delayed_data_ref_cachep)
-		kmem_cache_destroy(btrfs_delayed_data_ref_cachep);
-	if (btrfs_delayed_extent_op_cachep)
-		kmem_cache_destroy(btrfs_delayed_extent_op_cachep);
+	kmem_cache_destroy(btrfs_delayed_ref_head_cachep);
+	kmem_cache_destroy(btrfs_delayed_tree_ref_cachep);
+	kmem_cache_destroy(btrfs_delayed_data_ref_cachep);
+	kmem_cache_destroy(btrfs_delayed_extent_op_cachep);
 }
 
 int btrfs_delayed_ref_init(void)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 0d98aee..6cc044d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -103,8 +103,7 @@ int __init btrfs_end_io_wq_init(void)
 
 void btrfs_end_io_wq_exit(void)
 {
-	if (btrfs_end_io_wq_cache)
-		kmem_cache_destroy(btrfs_end_io_wq_cache);
+	kmem_cache_destroy(btrfs_end_io_wq_cache);
 }
 
 /*
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index a2ae427..1fb6ce3 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -43,8 +43,7 @@ int __init btrfs_delayed_inode_init(void)
 
 void btrfs_delayed_inode_exit(void)
 {
-	if (delayed_node_cache)
-		kmem_cache_destroy(delayed_node_cache);
+	kmem_cache_destroy(delayed_node_cache);
 }
 
 static inline void btrfs_init_delayed_node(
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index b823fac..c8d0210 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -2820,8 +2820,7 @@ const struct file_operations btrfs_file_operations = {
 
 void btrfs_auto_defrag_exit(void)
 {
-	if (btrfs_inode_defrag_cachep)
-		kmem_cache_destroy(btrfs_inode_defrag_cachep);
+	kmem_cache_destroy(btrfs_inode_defrag_cachep);
 }
 
 int btrfs_auto_defrag_init(void)
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index 52170cf..2e5a1e1 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -1072,6 +1072,5 @@ int __init ordered_data_init(void)
 
 void ordered_data_exit(void)
 {
-	if (btrfs_ordered_extent_cache)
-		kmem_cache_destroy(btrfs_ordered_extent_cache);
+	kmem_cache_destroy(btrfs_ordered_extent_cache);
 }
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a0fa725..c7904d3 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9031,18 +9031,12 @@ void btrfs_destroy_cachep(void)
 	 * destroy cache.
 	 */
 	rcu_barrier();
-	if (btrfs_inode_cachep)
-		kmem_cache_destroy(btrfs_inode_cachep);
-	if (btrfs_trans_handle_cachep)
-		kmem_cache_destroy(btrfs_trans_handle_cachep);
-	if (btrfs_transaction_cachep)
-		kmem_cache_destroy(btrfs_transaction_cachep);
-	if (btrfs_path_cachep)
-		kmem_cache_destroy(btrfs_path_cachep);
-	if (btrfs_free_space_cachep)
-		kmem_cache_destroy(btrfs_free_space_cachep);
-	if (btrfs_delalloc_work_cachep)
-		kmem_cache_destroy(btrfs_delalloc_work_cachep);
+	kmem_cache_destroy(btrfs_inode_cachep);
+	kmem_cache_destroy(btrfs_trans_handle_cachep);
+	kmem_cache_destroy(btrfs_transaction_cachep);
+	kmem_cache_destroy(btrfs_path_cachep);
+	kmem_cache_destroy(btrfs_free_space_cachep);
+	kmem_cache_destroy(btrfs_delalloc_work_cachep);
 }
 
 int btrfs_init_cachep(void)
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index ecbc63d..6763b1f 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -148,8 +148,7 @@ int __init btrfs_prelim_ref_init(void)
 
 void btrfs_prelim_ref_exit(void)
 {
-	if (btrfs_prelim_ref_cache)
-		kmem_cache_destroy(btrfs_prelim_ref_cache);
+	kmem_cache_destroy(btrfs_prelim_ref_cache);
 }
 
 /*
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index f1018cf..b538b3e 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -187,10 +187,8 @@ void extent_io_exit(void)
 	 * destroy caches.
 	 */
 	rcu_barrier();
-	if (extent_state_cache)
-		kmem_cache_destroy(extent_state_cache);
-	if (extent_buffer_cache)
-		kmem_cache_destroy(extent_buffer_cache);
+	kmem_cache_destroy(extent_state_cache);
+	kmem_cache_destroy(extent_buffer_cache);
 	if (btrfs_bioset)
 		bioset_free(btrfs_bioset);
 }


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 07/39] fs: ext4: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Theodore Ts'o
  Cc: sergey.senozhatsky, kernel-janitors, Andreas Dilger, linux-ext4,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/ext4/crypto.c         |    9 +++------
 fs/ext4/extents_status.c |    3 +--
 fs/ext4/mballoc.c        |    3 +--
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index 26724ae..42096d3 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -161,8 +161,7 @@ int __init ext4_init_es(void)
 
 void ext4_exit_es(void)
 {
-	if (ext4_es_cachep)
-		kmem_cache_destroy(ext4_es_cachep);
+	kmem_cache_destroy(ext4_es_cachep);
 }
 
 void ext4_es_init_tree(struct ext4_es_tree *tree)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 34b610e..b5adfb9 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2520,8 +2520,7 @@ static void ext4_groupinfo_destroy_slabs(void)
 	int i;
 
 	for (i = 0; i < NR_GRPINFO_CACHES; i++) {
-		if (ext4_groupinfo_caches[i])
-			kmem_cache_destroy(ext4_groupinfo_caches[i]);
+		kmem_cache_destroy(ext4_groupinfo_caches[i]);
 		ext4_groupinfo_caches[i] = NULL;
 	}
 }
diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c
index 4573155..e4d6d30 100644
--- a/fs/ext4/crypto.c
+++ b/fs/ext4/crypto.c
@@ -153,17 +153,14 @@ void ext4_exit_crypto(void)
 	list_for_each_entry_safe(pos, n, &ext4_free_crypto_ctxs, free_list)
 		kmem_cache_free(ext4_crypto_ctx_cachep, pos);
 	INIT_LIST_HEAD(&ext4_free_crypto_ctxs);
-	if (ext4_bounce_page_pool)
-		mempool_destroy(ext4_bounce_page_pool);
+	mempool_destroy(ext4_bounce_page_pool);
 	ext4_bounce_page_pool = NULL;
 	if (ext4_read_workqueue)
 		destroy_workqueue(ext4_read_workqueue);
 	ext4_read_workqueue = NULL;
-	if (ext4_crypto_ctx_cachep)
-		kmem_cache_destroy(ext4_crypto_ctx_cachep);
+	kmem_cache_destroy(ext4_crypto_ctx_cachep);
 	ext4_crypto_ctx_cachep = NULL;
-	if (ext4_crypt_info_cachep)
-		kmem_cache_destroy(ext4_crypt_info_cachep);
+	kmem_cache_destroy(ext4_crypt_info_cachep);
 	ext4_crypt_info_cachep = NULL;
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 07/39] fs: ext4: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Theodore Ts'o
  Cc: sergey.senozhatsky, kernel-janitors, Andreas Dilger, linux-ext4,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/ext4/crypto.c         |    9 +++------
 fs/ext4/extents_status.c |    3 +--
 fs/ext4/mballoc.c        |    3 +--
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
index 26724ae..42096d3 100644
--- a/fs/ext4/extents_status.c
+++ b/fs/ext4/extents_status.c
@@ -161,8 +161,7 @@ int __init ext4_init_es(void)
 
 void ext4_exit_es(void)
 {
-	if (ext4_es_cachep)
-		kmem_cache_destroy(ext4_es_cachep);
+	kmem_cache_destroy(ext4_es_cachep);
 }
 
 void ext4_es_init_tree(struct ext4_es_tree *tree)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 34b610e..b5adfb9 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2520,8 +2520,7 @@ static void ext4_groupinfo_destroy_slabs(void)
 	int i;
 
 	for (i = 0; i < NR_GRPINFO_CACHES; i++) {
-		if (ext4_groupinfo_caches[i])
-			kmem_cache_destroy(ext4_groupinfo_caches[i]);
+		kmem_cache_destroy(ext4_groupinfo_caches[i]);
 		ext4_groupinfo_caches[i] = NULL;
 	}
 }
diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c
index 4573155..e4d6d30 100644
--- a/fs/ext4/crypto.c
+++ b/fs/ext4/crypto.c
@@ -153,17 +153,14 @@ void ext4_exit_crypto(void)
 	list_for_each_entry_safe(pos, n, &ext4_free_crypto_ctxs, free_list)
 		kmem_cache_free(ext4_crypto_ctx_cachep, pos);
 	INIT_LIST_HEAD(&ext4_free_crypto_ctxs);
-	if (ext4_bounce_page_pool)
-		mempool_destroy(ext4_bounce_page_pool);
+	mempool_destroy(ext4_bounce_page_pool);
 	ext4_bounce_page_pool = NULL;
 	if (ext4_read_workqueue)
 		destroy_workqueue(ext4_read_workqueue);
 	ext4_read_workqueue = NULL;
-	if (ext4_crypto_ctx_cachep)
-		kmem_cache_destroy(ext4_crypto_ctx_cachep);
+	kmem_cache_destroy(ext4_crypto_ctx_cachep);
 	ext4_crypto_ctx_cachep = NULL;
-	if (ext4_crypt_info_cachep)
-		kmem_cache_destroy(ext4_crypt_info_cachep);
+	kmem_cache_destroy(ext4_crypt_info_cachep);
 	ext4_crypt_info_cachep = NULL;
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 08/39] pktcdvd: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: sergey.senozhatsky, kernel-janitors, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/block/pktcdvd.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 7be2375..cd813f9 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2803,8 +2803,7 @@ out_new_dev:
 out_mem2:
 	put_disk(disk);
 out_mem:
-	if (pd->rb_pool)
-		mempool_destroy(pd->rb_pool);
+	mempool_destroy(pd->rb_pool);
 	kfree(pd);
 out_mutex:
 	mutex_unlock(&ctl_mutex);


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 08/39] pktcdvd: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: sergey.senozhatsky, kernel-janitors, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/block/pktcdvd.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 7be2375..cd813f9 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2803,8 +2803,7 @@ out_new_dev:
 out_mem2:
 	put_disk(disk);
 out_mem:
-	if (pd->rb_pool)
-		mempool_destroy(pd->rb_pool);
+	mempool_destroy(pd->rb_pool);
 	kfree(pd);
 out_mutex:
 	mutex_unlock(&ctl_mutex);


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 09/39] aoe: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Ed L. Cashin; +Cc: sergey.senozhatsky, kernel-janitors, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/block/aoe/aoedev.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index ffd1947..efc8a8a 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -285,8 +285,7 @@ freedev(struct aoedev *d)
 	e = t + d->ntargets;
 	for (; t < e && *t; t++)
 		freetgt(d, *t);
-	if (d->bufpool)
-		mempool_destroy(d->bufpool);
+	mempool_destroy(d->bufpool);
 	skbpoolfree(d);
 	minor_free(d->sysminor);
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 09/39] aoe: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Ed L. Cashin; +Cc: sergey.senozhatsky, kernel-janitors, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/block/aoe/aoedev.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index ffd1947..efc8a8a 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -285,8 +285,7 @@ freedev(struct aoedev *d)
 	e = t + d->ntargets;
 	for (; t < e && *t; t++)
 		freetgt(d, *t);
-	if (d->bufpool)
-		mempool_destroy(d->bufpool);
+	mempool_destroy(d->bufpool);
 	skbpoolfree(d);
 	minor_free(d->sysminor);
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 10/39] atm: he: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Chas Williams
  Cc: sergey.senozhatsky, kernel-janitors, linux-atm-general, netdev,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/atm/he.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index a8da3a5..0f5cb37 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -1578,9 +1578,7 @@ he_stop(struct he_dev *he_dev)
 
 	kfree(he_dev->rbpl_virt);
 	kfree(he_dev->rbpl_table);
-
-	if (he_dev->rbpl_pool)
-		dma_pool_destroy(he_dev->rbpl_pool);
+	dma_pool_destroy(he_dev->rbpl_pool);
 
 	if (he_dev->rbrq_base)
 		dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq),
@@ -1594,8 +1592,7 @@ he_stop(struct he_dev *he_dev)
 		dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq),
 				  he_dev->tpdrq_base, he_dev->tpdrq_phys);
 
-	if (he_dev->tpd_pool)
-		dma_pool_destroy(he_dev->tpd_pool);
+	dma_pool_destroy(he_dev->tpd_pool);
 
 	if (he_dev->pci_dev) {
 		pci_read_config_word(he_dev->pci_dev, PCI_COMMAND, &command);


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 10/39] atm: he: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Chas Williams
  Cc: sergey.senozhatsky, kernel-janitors, linux-atm-general, netdev,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/atm/he.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index a8da3a5..0f5cb37 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -1578,9 +1578,7 @@ he_stop(struct he_dev *he_dev)
 
 	kfree(he_dev->rbpl_virt);
 	kfree(he_dev->rbpl_table);
-
-	if (he_dev->rbpl_pool)
-		dma_pool_destroy(he_dev->rbpl_pool);
+	dma_pool_destroy(he_dev->rbpl_pool);
 
 	if (he_dev->rbrq_base)
 		dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq),
@@ -1594,8 +1592,7 @@ he_stop(struct he_dev *he_dev)
 		dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq),
 				  he_dev->tpdrq_base, he_dev->tpdrq_phys);
 
-	if (he_dev->tpd_pool)
-		dma_pool_destroy(he_dev->tpd_pool);
+	dma_pool_destroy(he_dev->tpd_pool);
 
 	if (he_dev->pci_dev) {
 		pci_read_config_word(he_dev->pci_dev, PCI_COMMAND, &command);


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 11/39] hfi1: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
  (?)
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Mike Marciniszyn
  Cc: sergey.senozhatsky, kernel-janitors, Doug Ledford, Sean Hefty,
	Hal Rosenstock, Greg Kroah-Hartman, linux-rdma, devel,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/staging/rdma/hfi1/user_sdma.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rdma/hfi1/user_sdma.c b/drivers/staging/rdma/hfi1/user_sdma.c
index 5552661..6620262 100644
--- a/drivers/staging/rdma/hfi1/user_sdma.c
+++ b/drivers/staging/rdma/hfi1/user_sdma.c
@@ -486,8 +486,7 @@ int hfi1_user_sdma_free_queues(struct hfi1_filedata *fd)
 			}
 			kfree(pq->reqs);
 		}
-		if (pq->txreq_cache)
-			kmem_cache_destroy(pq->txreq_cache);
+		kmem_cache_destroy(pq->txreq_cache);
 		kfree(pq);
 		fd->pq = NULL;
 	}


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 11/39] hfi1: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Mike Marciniszyn
  Cc: devel, linux-rdma, Greg Kroah-Hartman, kernel-janitors,
	linux-kernel, Doug Ledford, Sean Hefty, Hal Rosenstock

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/staging/rdma/hfi1/user_sdma.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rdma/hfi1/user_sdma.c b/drivers/staging/rdma/hfi1/user_sdma.c
index 5552661..6620262 100644
--- a/drivers/staging/rdma/hfi1/user_sdma.c
+++ b/drivers/staging/rdma/hfi1/user_sdma.c
@@ -486,8 +486,7 @@ int hfi1_user_sdma_free_queues(struct hfi1_filedata *fd)
 			}
 			kfree(pq->reqs);
 		}
-		if (pq->txreq_cache)
-			kmem_cache_destroy(pq->txreq_cache);
+		kmem_cache_destroy(pq->txreq_cache);
 		kfree(pq);
 		fd->pq = NULL;
 	}

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 11/39] hfi1: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Mike Marciniszyn
  Cc: devel, linux-rdma, Greg Kroah-Hartman, kernel-janitors,
	linux-kernel, Doug Ledford, Sean Hefty, Hal Rosenstock

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/staging/rdma/hfi1/user_sdma.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rdma/hfi1/user_sdma.c b/drivers/staging/rdma/hfi1/user_sdma.c
index 5552661..6620262 100644
--- a/drivers/staging/rdma/hfi1/user_sdma.c
+++ b/drivers/staging/rdma/hfi1/user_sdma.c
@@ -486,8 +486,7 @@ int hfi1_user_sdma_free_queues(struct hfi1_filedata *fd)
 			}
 			kfree(pq->reqs);
 		}
-		if (pq->txreq_cache)
-			kmem_cache_destroy(pq->txreq_cache);
+		kmem_cache_destroy(pq->txreq_cache);
 		kfree(pq);
 		fd->pq = NULL;
 	}


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 12/39] dm: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Alasdair Kergon
  Cc: sergey.senozhatsky, kernel-janitors, Mike Snitzer, dm-devel,
	Neil Brown, linux-raid, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/md/dm-bufio.c              |    3 +--
 drivers/md/dm-cache-target.c       |    3 +--
 drivers/md/dm-crypt.c              |    6 ++----
 drivers/md/dm-io.c                 |    3 +--
 drivers/md/dm-log-userspace-base.c |    3 +--
 drivers/md/dm-region-hash.c        |    4 +---
 drivers/md/dm.c                    |   13 ++++---------
 7 files changed, 11 insertions(+), 24 deletions(-)

diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index 83cc52e..8ad39b6 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -1864,8 +1864,7 @@ static void __exit dm_bufio_exit(void)
 	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
 		struct kmem_cache *kc = dm_bufio_caches[i];
 
-		if (kc)
-			kmem_cache_destroy(kc);
+		kmem_cache_destroy(kc);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(dm_bufio_cache_names); i++)
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 6264781..163de31 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2220,10 +2220,8 @@ static void cleanup_mapped_device(struct mapped_device *md)
 		destroy_workqueue(md->wq);
 	if (md->kworker_task)
 		kthread_stop(md->kworker_task);
-	if (md->io_pool)
-		mempool_destroy(md->io_pool);
-	if (md->rq_pool)
-		mempool_destroy(md->rq_pool);
+	mempool_destroy(md->io_pool);
+	mempool_destroy(md->rq_pool);
 	if (md->bs)
 		bioset_free(md->bs);
 
@@ -3508,11 +3506,8 @@ void dm_free_md_mempools(struct dm_md_mempools *pools)
 	if (!pools)
 		return;
 
-	if (pools->io_pool)
-		mempool_destroy(pools->io_pool);
-
-	if (pools->rq_pool)
-		mempool_destroy(pools->rq_pool);
+	mempool_destroy(pools->io_pool);
+	mempool_destroy(pools->rq_pool);
 
 	if (pools->bs)
 		bioset_free(pools->bs);
diff --git a/drivers/md/dm-log-userspace-base.c b/drivers/md/dm-log-userspace-base.c
index 058256d..53b7b06 100644
--- a/drivers/md/dm-log-userspace-base.c
+++ b/drivers/md/dm-log-userspace-base.c
@@ -313,8 +313,7 @@ static int userspace_ctr(struct dm_dirty_log *log, struct dm_target *ti,
 out:
 	kfree(devices_rdata);
 	if (r) {
-		if (lc->flush_entry_pool)
-			mempool_destroy(lc->flush_entry_pool);
+		mempool_destroy(lc->flush_entry_pool);
 		kfree(lc);
 		kfree(ctr_str);
 	} else {
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c
index 6f8e83b..81c5e1a 100644
--- a/drivers/md/dm-io.c
+++ b/drivers/md/dm-io.c
@@ -65,8 +65,7 @@ struct dm_io_client *dm_io_client_create(void)
 	return client;
 
    bad:
-	if (client->pool)
-		mempool_destroy(client->pool);
+	mempool_destroy(client->pool);
 	kfree(client);
 	return ERR_PTR(-ENOMEM);
 }
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index dd90d12..2fd4c82 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -2309,8 +2309,7 @@ static void destroy(struct cache *cache)
 {
 	unsigned i;
 
-	if (cache->migration_pool)
-		mempool_destroy(cache->migration_pool);
+	mempool_destroy(cache->migration_pool);
 
 	if (cache->all_io_ds)
 		dm_deferred_set_destroy(cache->all_io_ds);
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index d60c88d..cf91a96 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1543,10 +1543,8 @@ static void crypt_dtr(struct dm_target *ti)
 	if (cc->bs)
 		bioset_free(cc->bs);
 
-	if (cc->page_pool)
-		mempool_destroy(cc->page_pool);
-	if (cc->req_pool)
-		mempool_destroy(cc->req_pool);
+	mempool_destroy(cc->page_pool);
+	mempool_destroy(cc->req_pool);
 
 	if (cc->iv_gen_ops && cc->iv_gen_ops->dtr)
 		cc->iv_gen_ops->dtr(cc);
diff --git a/drivers/md/dm-region-hash.c b/drivers/md/dm-region-hash.c
index b929fd5..f3d608b 100644
--- a/drivers/md/dm-region-hash.c
+++ b/drivers/md/dm-region-hash.c
@@ -249,9 +249,7 @@ void dm_region_hash_destroy(struct dm_region_hash *rh)
 	if (rh->log)
 		dm_dirty_log_destroy(rh->log);
 
-	if (rh->region_pool)
-		mempool_destroy(rh->region_pool);
-
+	mempool_destroy(rh->region_pool);
 	vfree(rh->buckets);
 	kfree(rh);
 }


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 12/39] dm: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Alasdair Kergon
  Cc: sergey.senozhatsky, kernel-janitors, Mike Snitzer, dm-devel,
	Neil Brown, linux-raid, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/md/dm-bufio.c              |    3 +--
 drivers/md/dm-cache-target.c       |    3 +--
 drivers/md/dm-crypt.c              |    6 ++----
 drivers/md/dm-io.c                 |    3 +--
 drivers/md/dm-log-userspace-base.c |    3 +--
 drivers/md/dm-region-hash.c        |    4 +---
 drivers/md/dm.c                    |   13 ++++---------
 7 files changed, 11 insertions(+), 24 deletions(-)

diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index 83cc52e..8ad39b6 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -1864,8 +1864,7 @@ static void __exit dm_bufio_exit(void)
 	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
 		struct kmem_cache *kc = dm_bufio_caches[i];
 
-		if (kc)
-			kmem_cache_destroy(kc);
+		kmem_cache_destroy(kc);
 	}
 
 	for (i = 0; i < ARRAY_SIZE(dm_bufio_cache_names); i++)
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 6264781..163de31 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2220,10 +2220,8 @@ static void cleanup_mapped_device(struct mapped_device *md)
 		destroy_workqueue(md->wq);
 	if (md->kworker_task)
 		kthread_stop(md->kworker_task);
-	if (md->io_pool)
-		mempool_destroy(md->io_pool);
-	if (md->rq_pool)
-		mempool_destroy(md->rq_pool);
+	mempool_destroy(md->io_pool);
+	mempool_destroy(md->rq_pool);
 	if (md->bs)
 		bioset_free(md->bs);
 
@@ -3508,11 +3506,8 @@ void dm_free_md_mempools(struct dm_md_mempools *pools)
 	if (!pools)
 		return;
 
-	if (pools->io_pool)
-		mempool_destroy(pools->io_pool);
-
-	if (pools->rq_pool)
-		mempool_destroy(pools->rq_pool);
+	mempool_destroy(pools->io_pool);
+	mempool_destroy(pools->rq_pool);
 
 	if (pools->bs)
 		bioset_free(pools->bs);
diff --git a/drivers/md/dm-log-userspace-base.c b/drivers/md/dm-log-userspace-base.c
index 058256d..53b7b06 100644
--- a/drivers/md/dm-log-userspace-base.c
+++ b/drivers/md/dm-log-userspace-base.c
@@ -313,8 +313,7 @@ static int userspace_ctr(struct dm_dirty_log *log, struct dm_target *ti,
 out:
 	kfree(devices_rdata);
 	if (r) {
-		if (lc->flush_entry_pool)
-			mempool_destroy(lc->flush_entry_pool);
+		mempool_destroy(lc->flush_entry_pool);
 		kfree(lc);
 		kfree(ctr_str);
 	} else {
diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c
index 6f8e83b..81c5e1a 100644
--- a/drivers/md/dm-io.c
+++ b/drivers/md/dm-io.c
@@ -65,8 +65,7 @@ struct dm_io_client *dm_io_client_create(void)
 	return client;
 
    bad:
-	if (client->pool)
-		mempool_destroy(client->pool);
+	mempool_destroy(client->pool);
 	kfree(client);
 	return ERR_PTR(-ENOMEM);
 }
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index dd90d12..2fd4c82 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -2309,8 +2309,7 @@ static void destroy(struct cache *cache)
 {
 	unsigned i;
 
-	if (cache->migration_pool)
-		mempool_destroy(cache->migration_pool);
+	mempool_destroy(cache->migration_pool);
 
 	if (cache->all_io_ds)
 		dm_deferred_set_destroy(cache->all_io_ds);
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index d60c88d..cf91a96 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1543,10 +1543,8 @@ static void crypt_dtr(struct dm_target *ti)
 	if (cc->bs)
 		bioset_free(cc->bs);
 
-	if (cc->page_pool)
-		mempool_destroy(cc->page_pool);
-	if (cc->req_pool)
-		mempool_destroy(cc->req_pool);
+	mempool_destroy(cc->page_pool);
+	mempool_destroy(cc->req_pool);
 
 	if (cc->iv_gen_ops && cc->iv_gen_ops->dtr)
 		cc->iv_gen_ops->dtr(cc);
diff --git a/drivers/md/dm-region-hash.c b/drivers/md/dm-region-hash.c
index b929fd5..f3d608b 100644
--- a/drivers/md/dm-region-hash.c
+++ b/drivers/md/dm-region-hash.c
@@ -249,9 +249,7 @@ void dm_region_hash_destroy(struct dm_region_hash *rh)
 	if (rh->log)
 		dm_dirty_log_destroy(rh->log);
 
-	if (rh->region_pool)
-		mempool_destroy(rh->region_pool);
-
+	mempool_destroy(rh->region_pool);
 	vfree(rh->buckets);
 	kfree(rh);
 }


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 13/39] staging: lustre: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Oleg Drokin
  Cc: sergey.senozhatsky, kernel-janitors, Andreas Dilger,
	Greg Kroah-Hartman, HPDD-discuss, devel, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);

@@
expression x;
@@

-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/staging/lustre/lustre/llite/super25.c      |   16 +++-----------
 drivers/staging/lustre/lustre/obdclass/genops.c    |   24 +++++++--------------
 drivers/staging/lustre/lustre/obdclass/lu_object.c |    6 +----
 3 files changed, 14 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c
index 8e47232..e8101fe 100644
--- a/drivers/staging/lustre/lustre/obdclass/lu_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c
@@ -2052,10 +2052,8 @@ EXPORT_SYMBOL(lu_kmem_init);
 void lu_kmem_fini(struct lu_kmem_descr *caches)
 {
 	for (; caches->ckd_cache != NULL; ++caches) {
-		if (*caches->ckd_cache != NULL) {
-			kmem_cache_destroy(*caches->ckd_cache);
-			*caches->ckd_cache = NULL;
-		}
+		kmem_cache_destroy(*caches->ckd_cache);
+		*caches->ckd_cache = NULL;
 	}
 }
 EXPORT_SYMBOL(lu_kmem_fini);
diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c
index 0ca7309..ad78a04 100644
--- a/drivers/staging/lustre/lustre/obdclass/genops.c
+++ b/drivers/staging/lustre/lustre/obdclass/genops.c
@@ -638,22 +638,14 @@ EXPORT_SYMBOL(class_notify_sptlrpc_conf);
 
 void obd_cleanup_caches(void)
 {
-	if (obd_device_cachep) {
-		kmem_cache_destroy(obd_device_cachep);
-		obd_device_cachep = NULL;
-	}
-	if (obdo_cachep) {
-		kmem_cache_destroy(obdo_cachep);
-		obdo_cachep = NULL;
-	}
-	if (import_cachep) {
-		kmem_cache_destroy(import_cachep);
-		import_cachep = NULL;
-	}
-	if (capa_cachep) {
-		kmem_cache_destroy(capa_cachep);
-		capa_cachep = NULL;
-	}
+	kmem_cache_destroy(obd_device_cachep);
+	obd_device_cachep = NULL;
+	kmem_cache_destroy(obdo_cachep);
+	obdo_cachep = NULL;
+	kmem_cache_destroy(import_cachep);
+	import_cachep = NULL;
+	kmem_cache_destroy(capa_cachep);
+	capa_cachep = NULL;
 }
 
 int obd_init_caches(void)
diff --git a/drivers/staging/lustre/lustre/llite/super25.c b/drivers/staging/lustre/lustre/llite/super25.c
index e4020ce..4cf7af2 100644
--- a/drivers/staging/lustre/lustre/llite/super25.c
+++ b/drivers/staging/lustre/lustre/llite/super25.c
@@ -183,18 +183,10 @@ out_sysfs:
 out_debugfs:
 	debugfs_remove(llite_root);
 out_cache:
-	if (ll_inode_cachep != NULL)
-		kmem_cache_destroy(ll_inode_cachep);
-
-	if (ll_file_data_slab != NULL)
-		kmem_cache_destroy(ll_file_data_slab);
-
-	if (ll_remote_perm_cachep != NULL)
-		kmem_cache_destroy(ll_remote_perm_cachep);
-
-	if (ll_rmtperm_hash_cachep != NULL)
-		kmem_cache_destroy(ll_rmtperm_hash_cachep);
-
+	kmem_cache_destroy(ll_inode_cachep);
+	kmem_cache_destroy(ll_file_data_slab);
+	kmem_cache_destroy(ll_remote_perm_cachep);
+	kmem_cache_destroy(ll_rmtperm_hash_cachep);
 	return rc;
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 13/39] staging: lustre: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Oleg Drokin
  Cc: sergey.senozhatsky, kernel-janitors, Andreas Dilger,
	Greg Kroah-Hartman, HPDD-discuss, devel, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);

@@
expression x;
@@

-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/staging/lustre/lustre/llite/super25.c      |   16 +++-----------
 drivers/staging/lustre/lustre/obdclass/genops.c    |   24 +++++++--------------
 drivers/staging/lustre/lustre/obdclass/lu_object.c |    6 +----
 3 files changed, 14 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c
index 8e47232..e8101fe 100644
--- a/drivers/staging/lustre/lustre/obdclass/lu_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c
@@ -2052,10 +2052,8 @@ EXPORT_SYMBOL(lu_kmem_init);
 void lu_kmem_fini(struct lu_kmem_descr *caches)
 {
 	for (; caches->ckd_cache != NULL; ++caches) {
-		if (*caches->ckd_cache != NULL) {
-			kmem_cache_destroy(*caches->ckd_cache);
-			*caches->ckd_cache = NULL;
-		}
+		kmem_cache_destroy(*caches->ckd_cache);
+		*caches->ckd_cache = NULL;
 	}
 }
 EXPORT_SYMBOL(lu_kmem_fini);
diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c
index 0ca7309..ad78a04 100644
--- a/drivers/staging/lustre/lustre/obdclass/genops.c
+++ b/drivers/staging/lustre/lustre/obdclass/genops.c
@@ -638,22 +638,14 @@ EXPORT_SYMBOL(class_notify_sptlrpc_conf);
 
 void obd_cleanup_caches(void)
 {
-	if (obd_device_cachep) {
-		kmem_cache_destroy(obd_device_cachep);
-		obd_device_cachep = NULL;
-	}
-	if (obdo_cachep) {
-		kmem_cache_destroy(obdo_cachep);
-		obdo_cachep = NULL;
-	}
-	if (import_cachep) {
-		kmem_cache_destroy(import_cachep);
-		import_cachep = NULL;
-	}
-	if (capa_cachep) {
-		kmem_cache_destroy(capa_cachep);
-		capa_cachep = NULL;
-	}
+	kmem_cache_destroy(obd_device_cachep);
+	obd_device_cachep = NULL;
+	kmem_cache_destroy(obdo_cachep);
+	obdo_cachep = NULL;
+	kmem_cache_destroy(import_cachep);
+	import_cachep = NULL;
+	kmem_cache_destroy(capa_cachep);
+	capa_cachep = NULL;
 }
 
 int obd_init_caches(void)
diff --git a/drivers/staging/lustre/lustre/llite/super25.c b/drivers/staging/lustre/lustre/llite/super25.c
index e4020ce..4cf7af2 100644
--- a/drivers/staging/lustre/lustre/llite/super25.c
+++ b/drivers/staging/lustre/lustre/llite/super25.c
@@ -183,18 +183,10 @@ out_sysfs:
 out_debugfs:
 	debugfs_remove(llite_root);
 out_cache:
-	if (ll_inode_cachep != NULL)
-		kmem_cache_destroy(ll_inode_cachep);
-
-	if (ll_file_data_slab != NULL)
-		kmem_cache_destroy(ll_file_data_slab);
-
-	if (ll_remote_perm_cachep != NULL)
-		kmem_cache_destroy(ll_remote_perm_cachep);
-
-	if (ll_rmtperm_hash_cachep != NULL)
-		kmem_cache_destroy(ll_rmtperm_hash_cachep);
-
+	kmem_cache_destroy(ll_inode_cachep);
+	kmem_cache_destroy(ll_file_data_slab);
+	kmem_cache_destroy(ll_remote_perm_cachep);
+	kmem_cache_destroy(ll_rmtperm_hash_cachep);
 	return rc;
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 14/39] SUNRPC: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: sergey.senozhatsky, kernel-janitors, Jeff Layton, Trond Myklebust,
	Anna Schumaker, David S. Miller, linux-nfs, netdev, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 net/sunrpc/sched.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index b140c09..425ca2f 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -1092,14 +1092,10 @@ void
 rpc_destroy_mempool(void)
 {
 	rpciod_stop();
-	if (rpc_buffer_mempool)
-		mempool_destroy(rpc_buffer_mempool);
-	if (rpc_task_mempool)
-		mempool_destroy(rpc_task_mempool);
-	if (rpc_task_slabp)
-		kmem_cache_destroy(rpc_task_slabp);
-	if (rpc_buffer_slabp)
-		kmem_cache_destroy(rpc_buffer_slabp);
+	mempool_destroy(rpc_buffer_mempool);
+	mempool_destroy(rpc_task_mempool);
+	kmem_cache_destroy(rpc_task_slabp);
+	kmem_cache_destroy(rpc_buffer_slabp);
 	rpc_destroy_wait_queue(&delay_queue);
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 14/39] SUNRPC: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: sergey.senozhatsky, kernel-janitors, Jeff Layton, Trond Myklebust,
	Anna Schumaker, David S. Miller, linux-nfs, netdev, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 net/sunrpc/sched.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index b140c09..425ca2f 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -1092,14 +1092,10 @@ void
 rpc_destroy_mempool(void)
 {
 	rpciod_stop();
-	if (rpc_buffer_mempool)
-		mempool_destroy(rpc_buffer_mempool);
-	if (rpc_task_mempool)
-		mempool_destroy(rpc_task_mempool);
-	if (rpc_task_slabp)
-		kmem_cache_destroy(rpc_task_slabp);
-	if (rpc_buffer_slabp)
-		kmem_cache_destroy(rpc_buffer_slabp);
+	mempool_destroy(rpc_buffer_mempool);
+	mempool_destroy(rpc_task_mempool);
+	kmem_cache_destroy(rpc_task_slabp);
+	kmem_cache_destroy(rpc_buffer_slabp);
 	rpc_destroy_wait_queue(&delay_queue);
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 15/39] bcache: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Kent Overstreet
  Cc: sergey.senozhatsky, kernel-janitors, Neil Brown, linux-bcache,
	linux-raid, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/md/bcache/bset.c    |    3 +--
 drivers/md/bcache/request.c |    3 +--
 drivers/md/bcache/super.c   |    9 +++------
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 8e9877b..bd4678c 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -1145,8 +1145,7 @@ void bch_flash_dev_request_init(struct bcache_device *d)
 
 void bch_request_exit(void)
 {
-	if (bch_search_cache)
-		kmem_cache_destroy(bch_search_cache);
+	kmem_cache_destroy(bch_search_cache);
 }
 
 int __init bch_request_init(void)
diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
index 646fe85..479117c 100644
--- a/drivers/md/bcache/bset.c
+++ b/drivers/md/bcache/bset.c
@@ -1116,8 +1116,7 @@ struct bkey *bch_btree_iter_next_filter(struct btree_iter *iter,
 
 void bch_bset_sort_state_free(struct bset_sort_state *state)
 {
-	if (state->pool)
-		mempool_destroy(state->pool);
+	mempool_destroy(state->pool);
 }
 
 int bch_bset_sort_state_init(struct bset_sort_state *state, unsigned page_order)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 679a093..c27a0ff 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1335,12 +1335,9 @@ static void cache_set_free(struct closure *cl)
 		destroy_workqueue(c->moving_gc_wq);
 	if (c->bio_split)
 		bioset_free(c->bio_split);
-	if (c->fill_iter)
-		mempool_destroy(c->fill_iter);
-	if (c->bio_meta)
-		mempool_destroy(c->bio_meta);
-	if (c->search)
-		mempool_destroy(c->search);
+	mempool_destroy(c->fill_iter);
+	mempool_destroy(c->bio_meta);
+	mempool_destroy(c->search);
 	kfree(c->devices);
 
 	mutex_lock(&bch_register_lock);


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 15/39] bcache: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Kent Overstreet
  Cc: sergey.senozhatsky, kernel-janitors, Neil Brown, linux-bcache,
	linux-raid, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/md/bcache/bset.c    |    3 +--
 drivers/md/bcache/request.c |    3 +--
 drivers/md/bcache/super.c   |    9 +++------
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 8e9877b..bd4678c 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -1145,8 +1145,7 @@ void bch_flash_dev_request_init(struct bcache_device *d)
 
 void bch_request_exit(void)
 {
-	if (bch_search_cache)
-		kmem_cache_destroy(bch_search_cache);
+	kmem_cache_destroy(bch_search_cache);
 }
 
 int __init bch_request_init(void)
diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
index 646fe85..479117c 100644
--- a/drivers/md/bcache/bset.c
+++ b/drivers/md/bcache/bset.c
@@ -1116,8 +1116,7 @@ struct bkey *bch_btree_iter_next_filter(struct btree_iter *iter,
 
 void bch_bset_sort_state_free(struct bset_sort_state *state)
 {
-	if (state->pool)
-		mempool_destroy(state->pool);
+	mempool_destroy(state->pool);
 }
 
 int bch_bset_sort_state_init(struct bset_sort_state *state, unsigned page_order)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 679a093..c27a0ff 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1335,12 +1335,9 @@ static void cache_set_free(struct closure *cl)
 		destroy_workqueue(c->moving_gc_wq);
 	if (c->bio_split)
 		bioset_free(c->bio_split);
-	if (c->fill_iter)
-		mempool_destroy(c->fill_iter);
-	if (c->bio_meta)
-		mempool_destroy(c->bio_meta);
-	if (c->search)
-		mempool_destroy(c->search);
+	mempool_destroy(c->fill_iter);
+	mempool_destroy(c->bio_meta);
+	mempool_destroy(c->search);
 	kfree(c->devices);
 
 	mutex_lock(&bch_register_lock);


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 16/39] usb: gadget: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: sergey.senozhatsky, kernel-janitors, Greg Kroah-Hartman,
	linux-usb, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/gadget/udc/bdc/bdc_core.c |    3 +--
 drivers/usb/gadget/udc/gr_udc.c       |    3 +--
 drivers/usb/gadget/udc/mv_u3d_core.c  |    3 +--
 drivers/usb/gadget/udc/mv_udc_core.c  |    3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/mv_udc_core.c
index 339af51..81b6229 100644
--- a/drivers/usb/gadget/udc/mv_udc_core.c
+++ b/drivers/usb/gadget/udc/mv_udc_core.c
@@ -2100,8 +2100,7 @@ static int mv_udc_remove(struct platform_device *pdev)
 	}
 
 	/* free memory allocated in probe */
-	if (udc->dtd_pool)
-		dma_pool_destroy(udc->dtd_pool);
+	dma_pool_destroy(udc->dtd_pool);
 
 	if (udc->ep_dqh)
 		dma_free_coherent(&pdev->dev, udc->ep_dqh_size,
diff --git a/drivers/usb/gadget/udc/gr_udc.c b/drivers/usb/gadget/udc/gr_udc.c
index 8aa2593..b9429bc 100644
--- a/drivers/usb/gadget/udc/gr_udc.c
+++ b/drivers/usb/gadget/udc/gr_udc.c
@@ -2117,8 +2117,7 @@ static int gr_remove(struct platform_device *pdev)
 		return -EBUSY;
 
 	gr_dfs_delete(dev);
-	if (dev->desc_pool)
-		dma_pool_destroy(dev->desc_pool);
+	dma_pool_destroy(dev->desc_pool);
 	platform_set_drvdata(pdev, NULL);
 
 	gr_free_request(&dev->epi[0].ep, &dev->ep0reqi->req);
diff --git a/drivers/usb/gadget/udc/mv_u3d_core.c b/drivers/usb/gadget/udc/mv_u3d_core.c
index 4c48969..dafe74e 100644
--- a/drivers/usb/gadget/udc/mv_u3d_core.c
+++ b/drivers/usb/gadget/udc/mv_u3d_core.c
@@ -1767,8 +1767,7 @@ static int mv_u3d_remove(struct platform_device *dev)
 	usb_del_gadget_udc(&u3d->gadget);
 
 	/* free memory allocated in probe */
-	if (u3d->trb_pool)
-		dma_pool_destroy(u3d->trb_pool);
+	dma_pool_destroy(u3d->trb_pool);
 
 	if (u3d->ep_context)
 		dma_free_coherent(&dev->dev, u3d->ep_context_size,
diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
index 5c8f4ef..ccb9c21 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_core.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
@@ -324,8 +324,7 @@ static void bdc_mem_free(struct bdc *bdc)
 				bdc->scratchpad.buff, bdc->scratchpad.sp_dma);
 
 	/* Destroy the dma pools */
-	if (bdc->bd_table_pool)
-		dma_pool_destroy(bdc->bd_table_pool);
+	dma_pool_destroy(bdc->bd_table_pool);
 
 	/* Free the bdc_ep array */
 	kfree(bdc->bdc_ep_array);


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 16/39] usb: gadget: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: sergey.senozhatsky, kernel-janitors, Greg Kroah-Hartman,
	linux-usb, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/gadget/udc/bdc/bdc_core.c |    3 +--
 drivers/usb/gadget/udc/gr_udc.c       |    3 +--
 drivers/usb/gadget/udc/mv_u3d_core.c  |    3 +--
 drivers/usb/gadget/udc/mv_udc_core.c  |    3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/gadget/udc/mv_udc_core.c b/drivers/usb/gadget/udc/mv_udc_core.c
index 339af51..81b6229 100644
--- a/drivers/usb/gadget/udc/mv_udc_core.c
+++ b/drivers/usb/gadget/udc/mv_udc_core.c
@@ -2100,8 +2100,7 @@ static int mv_udc_remove(struct platform_device *pdev)
 	}
 
 	/* free memory allocated in probe */
-	if (udc->dtd_pool)
-		dma_pool_destroy(udc->dtd_pool);
+	dma_pool_destroy(udc->dtd_pool);
 
 	if (udc->ep_dqh)
 		dma_free_coherent(&pdev->dev, udc->ep_dqh_size,
diff --git a/drivers/usb/gadget/udc/gr_udc.c b/drivers/usb/gadget/udc/gr_udc.c
index 8aa2593..b9429bc 100644
--- a/drivers/usb/gadget/udc/gr_udc.c
+++ b/drivers/usb/gadget/udc/gr_udc.c
@@ -2117,8 +2117,7 @@ static int gr_remove(struct platform_device *pdev)
 		return -EBUSY;
 
 	gr_dfs_delete(dev);
-	if (dev->desc_pool)
-		dma_pool_destroy(dev->desc_pool);
+	dma_pool_destroy(dev->desc_pool);
 	platform_set_drvdata(pdev, NULL);
 
 	gr_free_request(&dev->epi[0].ep, &dev->ep0reqi->req);
diff --git a/drivers/usb/gadget/udc/mv_u3d_core.c b/drivers/usb/gadget/udc/mv_u3d_core.c
index 4c48969..dafe74e 100644
--- a/drivers/usb/gadget/udc/mv_u3d_core.c
+++ b/drivers/usb/gadget/udc/mv_u3d_core.c
@@ -1767,8 +1767,7 @@ static int mv_u3d_remove(struct platform_device *dev)
 	usb_del_gadget_udc(&u3d->gadget);
 
 	/* free memory allocated in probe */
-	if (u3d->trb_pool)
-		dma_pool_destroy(u3d->trb_pool);
+	dma_pool_destroy(u3d->trb_pool);
 
 	if (u3d->ep_context)
 		dma_free_coherent(&dev->dev, u3d->ep_context_size,
diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
index 5c8f4ef..ccb9c21 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_core.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
@@ -324,8 +324,7 @@ static void bdc_mem_free(struct bdc *bdc)
 				bdc->scratchpad.buff, bdc->scratchpad.sp_dma);
 
 	/* Destroy the dma pools */
-	if (bdc->bd_table_pool)
-		dma_pool_destroy(bdc->bd_table_pool);
+	dma_pool_destroy(bdc->bd_table_pool);
 
 	/* Free the bdc_ep array */
 	kfree(bdc->bdc_ep_array);


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 17/39] md: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Neil Brown; +Cc: sergey.senozhatsky, kernel-janitors, linux-raid, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/md/multipath.c |    3 +--
 drivers/md/raid1.c     |    6 ++----
 drivers/md/raid10.c    |    9 +++------
 drivers/md/raid5.c     |    3 +--
 4 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 15ef2c6..09a12d7 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2271,8 +2271,7 @@ static void shrink_stripes(struct r5conf *conf)
 	       drop_one_stripe(conf))
 		;
 
-	if (conf->slab_cache)
-		kmem_cache_destroy(conf->slab_cache);
+	kmem_cache_destroy(conf->slab_cache);
 	conf->slab_cache = NULL;
 }
 
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 4517f06..5f4f553 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2843,8 +2843,7 @@ static struct r1conf *setup_conf(struct mddev *mddev)
 
  abort:
 	if (conf) {
-		if (conf->r1bio_pool)
-			mempool_destroy(conf->r1bio_pool);
+		mempool_destroy(conf->r1bio_pool);
 		kfree(conf->mirrors);
 		safe_put_page(conf->tmppage);
 		kfree(conf->poolinfo);
@@ -2946,8 +2945,7 @@ static void raid1_free(struct mddev *mddev, void *priv)
 {
 	struct r1conf *conf = priv;
 
-	if (conf->r1bio_pool)
-		mempool_destroy(conf->r1bio_pool);
+	mempool_destroy(conf->r1bio_pool);
 	kfree(conf->mirrors);
 	safe_put_page(conf->tmppage);
 	kfree(conf->poolinfo);
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index d222522..d132f06 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -470,8 +470,7 @@ static int multipath_run (struct mddev *mddev)
 	return 0;
 
 out_free_conf:
-	if (conf->pool)
-		mempool_destroy(conf->pool);
+	mempool_destroy(conf->pool);
 	kfree(conf->multipaths);
 	kfree(conf);
 	mddev->private = NULL;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 0fc33eb..7c99a40 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3486,8 +3486,7 @@ static struct r10conf *setup_conf(struct mddev *mddev)
 		printk(KERN_ERR "md/raid10:%s: couldn't allocate memory.\n",
 		       mdname(mddev));
 	if (conf) {
-		if (conf->r10bio_pool)
-			mempool_destroy(conf->r10bio_pool);
+		mempool_destroy(conf->r10bio_pool);
 		kfree(conf->mirrors);
 		safe_put_page(conf->tmppage);
 		kfree(conf);
@@ -3682,8 +3681,7 @@ static int run(struct mddev *mddev)
 
 out_free_conf:
 	md_unregister_thread(&mddev->thread);
-	if (conf->r10bio_pool)
-		mempool_destroy(conf->r10bio_pool);
+	mempool_destroy(conf->r10bio_pool);
 	safe_put_page(conf->tmppage);
 	kfree(conf->mirrors);
 	kfree(conf);
@@ -3696,8 +3694,7 @@ static void raid10_free(struct mddev *mddev, void *priv)
 {
 	struct r10conf *conf = priv;
 
-	if (conf->r10bio_pool)
-		mempool_destroy(conf->r10bio_pool);
+	mempool_destroy(conf->r10bio_pool);
 	safe_put_page(conf->tmppage);
 	kfree(conf->mirrors);
 	kfree(conf->mirrors_old);


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 17/39] md: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Neil Brown; +Cc: sergey.senozhatsky, kernel-janitors, linux-raid, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/md/multipath.c |    3 +--
 drivers/md/raid1.c     |    6 ++----
 drivers/md/raid10.c    |    9 +++------
 drivers/md/raid5.c     |    3 +--
 4 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 15ef2c6..09a12d7 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -2271,8 +2271,7 @@ static void shrink_stripes(struct r5conf *conf)
 	       drop_one_stripe(conf))
 		;
 
-	if (conf->slab_cache)
-		kmem_cache_destroy(conf->slab_cache);
+	kmem_cache_destroy(conf->slab_cache);
 	conf->slab_cache = NULL;
 }
 
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 4517f06..5f4f553 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -2843,8 +2843,7 @@ static struct r1conf *setup_conf(struct mddev *mddev)
 
  abort:
 	if (conf) {
-		if (conf->r1bio_pool)
-			mempool_destroy(conf->r1bio_pool);
+		mempool_destroy(conf->r1bio_pool);
 		kfree(conf->mirrors);
 		safe_put_page(conf->tmppage);
 		kfree(conf->poolinfo);
@@ -2946,8 +2945,7 @@ static void raid1_free(struct mddev *mddev, void *priv)
 {
 	struct r1conf *conf = priv;
 
-	if (conf->r1bio_pool)
-		mempool_destroy(conf->r1bio_pool);
+	mempool_destroy(conf->r1bio_pool);
 	kfree(conf->mirrors);
 	safe_put_page(conf->tmppage);
 	kfree(conf->poolinfo);
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index d222522..d132f06 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -470,8 +470,7 @@ static int multipath_run (struct mddev *mddev)
 	return 0;
 
 out_free_conf:
-	if (conf->pool)
-		mempool_destroy(conf->pool);
+	mempool_destroy(conf->pool);
 	kfree(conf->multipaths);
 	kfree(conf);
 	mddev->private = NULL;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 0fc33eb..7c99a40 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -3486,8 +3486,7 @@ static struct r10conf *setup_conf(struct mddev *mddev)
 		printk(KERN_ERR "md/raid10:%s: couldn't allocate memory.\n",
 		       mdname(mddev));
 	if (conf) {
-		if (conf->r10bio_pool)
-			mempool_destroy(conf->r10bio_pool);
+		mempool_destroy(conf->r10bio_pool);
 		kfree(conf->mirrors);
 		safe_put_page(conf->tmppage);
 		kfree(conf);
@@ -3682,8 +3681,7 @@ static int run(struct mddev *mddev)
 
 out_free_conf:
 	md_unregister_thread(&mddev->thread);
-	if (conf->r10bio_pool)
-		mempool_destroy(conf->r10bio_pool);
+	mempool_destroy(conf->r10bio_pool);
 	safe_put_page(conf->tmppage);
 	kfree(conf->mirrors);
 	kfree(conf);
@@ -3696,8 +3694,7 @@ static void raid10_free(struct mddev *mddev, void *priv)
 {
 	struct r10conf *conf = priv;
 
-	if (conf->r10bio_pool)
-		mempool_destroy(conf->r10bio_pool);
+	mempool_destroy(conf->r10bio_pool);
 	safe_put_page(conf->tmppage);
 	kfree(conf->mirrors);
 	kfree(conf->mirrors_old);


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 18/39] whci: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: sergey.senozhatsky, kernel-janitors, linux-usb, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/host/whci/init.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/host/whci/init.c b/drivers/usb/host/whci/init.c
index d3e13b6..e363723 100644
--- a/drivers/usb/host/whci/init.c
+++ b/drivers/usb/host/whci/init.c
@@ -175,8 +175,7 @@ void whc_clean_up(struct whc *whc)
 	pzl_clean_up(whc);
 	asl_clean_up(whc);
 
-	if (whc->qset_pool)
-		dma_pool_destroy(whc->qset_pool);
+	dma_pool_destroy(whc->qset_pool);
 
 	len   = resource_size(&whc->umc->resource);
 	if (whc->base)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 18/39] whci: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: sergey.senozhatsky, kernel-janitors, linux-usb, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/host/whci/init.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/host/whci/init.c b/drivers/usb/host/whci/init.c
index d3e13b6..e363723 100644
--- a/drivers/usb/host/whci/init.c
+++ b/drivers/usb/host/whci/init.c
@@ -175,8 +175,7 @@ void whc_clean_up(struct whc *whc)
 	pzl_clean_up(whc);
 	asl_clean_up(whc);
 
-	if (whc->qset_pool)
-		dma_pool_destroy(whc->qset_pool);
+	dma_pool_destroy(whc->qset_pool);
 
 	len   = resource_size(&whc->umc->resource);
 	if (whc->base)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 19/39] jbd2: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Theodore Ts'o
  Cc: sergey.senozhatsky, kernel-janitors, Jan Kara, linux-ext4,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);

@@
expression x;
@@

-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/jbd2/journal.c     |   15 +++++----------
 fs/jbd2/revoke.c      |   12 ++++--------
 fs/jbd2/transaction.c |    6 ++----
 3 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index 6b8338e..ab26122 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -51,10 +51,8 @@ int __init jbd2_journal_init_transaction_cache(void)
 
 void jbd2_journal_destroy_transaction_cache(void)
 {
-	if (transaction_cache) {
-		kmem_cache_destroy(transaction_cache);
-		transaction_cache = NULL;
-	}
+	kmem_cache_destroy(transaction_cache);
+	transaction_cache = NULL;
 }
 
 void jbd2_journal_free_transaction(transaction_t *transaction)
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 8270fe9..6b8c2c5 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -2240,8 +2240,7 @@ static void jbd2_journal_destroy_slabs(void)
 	int i;
 
 	for (i = 0; i < JBD2_MAX_SLABS; i++) {
-		if (jbd2_slab[i])
-			kmem_cache_destroy(jbd2_slab[i]);
+		kmem_cache_destroy(jbd2_slab[i]);
 		jbd2_slab[i] = NULL;
 	}
 }
@@ -2360,10 +2359,8 @@ static int jbd2_journal_init_journal_head_cache(void)
 
 static void jbd2_journal_destroy_journal_head_cache(void)
 {
-	if (jbd2_journal_head_cache) {
-		kmem_cache_destroy(jbd2_journal_head_cache);
-		jbd2_journal_head_cache = NULL;
-	}
+	kmem_cache_destroy(jbd2_journal_head_cache);
+	jbd2_journal_head_cache = NULL;
 }
 
 /*
@@ -2621,10 +2618,8 @@ static int __init jbd2_journal_init_handle_cache(void)
 
 static void jbd2_journal_destroy_handle_cache(void)
 {
-	if (jbd2_handle_cache)
-		kmem_cache_destroy(jbd2_handle_cache);
-	if (jbd2_inode_cache)
-		kmem_cache_destroy(jbd2_inode_cache);
+	kmem_cache_destroy(jbd2_handle_cache);
+	kmem_cache_destroy(jbd2_inode_cache);
 
 }
 
diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
index 0abf2e7..1e77a9d 100644
--- a/fs/jbd2/revoke.c
+++ b/fs/jbd2/revoke.c
@@ -183,14 +183,10 @@ static struct jbd2_revoke_record_s *find_revoke_record(journal_t *journal,
 
 void jbd2_journal_destroy_revoke_caches(void)
 {
-	if (jbd2_revoke_record_cache) {
-		kmem_cache_destroy(jbd2_revoke_record_cache);
-		jbd2_revoke_record_cache = NULL;
-	}
-	if (jbd2_revoke_table_cache) {
-		kmem_cache_destroy(jbd2_revoke_table_cache);
-		jbd2_revoke_table_cache = NULL;
-	}
+	kmem_cache_destroy(jbd2_revoke_record_cache);
+	jbd2_revoke_record_cache = NULL;
+	kmem_cache_destroy(jbd2_revoke_table_cache);
+	jbd2_revoke_table_cache = NULL;
 }
 
 int __init jbd2_journal_init_revoke_caches(void)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 19/39] jbd2: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Theodore Ts'o
  Cc: sergey.senozhatsky, kernel-janitors, Jan Kara, linux-ext4,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);

@@
expression x;
@@

-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/jbd2/journal.c     |   15 +++++----------
 fs/jbd2/revoke.c      |   12 ++++--------
 fs/jbd2/transaction.c |    6 ++----
 3 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index 6b8338e..ab26122 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -51,10 +51,8 @@ int __init jbd2_journal_init_transaction_cache(void)
 
 void jbd2_journal_destroy_transaction_cache(void)
 {
-	if (transaction_cache) {
-		kmem_cache_destroy(transaction_cache);
-		transaction_cache = NULL;
-	}
+	kmem_cache_destroy(transaction_cache);
+	transaction_cache = NULL;
 }
 
 void jbd2_journal_free_transaction(transaction_t *transaction)
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 8270fe9..6b8c2c5 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -2240,8 +2240,7 @@ static void jbd2_journal_destroy_slabs(void)
 	int i;
 
 	for (i = 0; i < JBD2_MAX_SLABS; i++) {
-		if (jbd2_slab[i])
-			kmem_cache_destroy(jbd2_slab[i]);
+		kmem_cache_destroy(jbd2_slab[i]);
 		jbd2_slab[i] = NULL;
 	}
 }
@@ -2360,10 +2359,8 @@ static int jbd2_journal_init_journal_head_cache(void)
 
 static void jbd2_journal_destroy_journal_head_cache(void)
 {
-	if (jbd2_journal_head_cache) {
-		kmem_cache_destroy(jbd2_journal_head_cache);
-		jbd2_journal_head_cache = NULL;
-	}
+	kmem_cache_destroy(jbd2_journal_head_cache);
+	jbd2_journal_head_cache = NULL;
 }
 
 /*
@@ -2621,10 +2618,8 @@ static int __init jbd2_journal_init_handle_cache(void)
 
 static void jbd2_journal_destroy_handle_cache(void)
 {
-	if (jbd2_handle_cache)
-		kmem_cache_destroy(jbd2_handle_cache);
-	if (jbd2_inode_cache)
-		kmem_cache_destroy(jbd2_inode_cache);
+	kmem_cache_destroy(jbd2_handle_cache);
+	kmem_cache_destroy(jbd2_inode_cache);
 
 }
 
diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
index 0abf2e7..1e77a9d 100644
--- a/fs/jbd2/revoke.c
+++ b/fs/jbd2/revoke.c
@@ -183,14 +183,10 @@ static struct jbd2_revoke_record_s *find_revoke_record(journal_t *journal,
 
 void jbd2_journal_destroy_revoke_caches(void)
 {
-	if (jbd2_revoke_record_cache) {
-		kmem_cache_destroy(jbd2_revoke_record_cache);
-		jbd2_revoke_record_cache = NULL;
-	}
-	if (jbd2_revoke_table_cache) {
-		kmem_cache_destroy(jbd2_revoke_table_cache);
-		jbd2_revoke_table_cache = NULL;
-	}
+	kmem_cache_destroy(jbd2_revoke_record_cache);
+	jbd2_revoke_record_cache = NULL;
+	kmem_cache_destroy(jbd2_revoke_table_cache);
+	jbd2_revoke_table_cache = NULL;
 }
 
 int __init jbd2_journal_init_revoke_caches(void)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 20/39] ixgbe: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
  (?)
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: sergey.senozhatsky, kernel-janitors, Jesse Brandeburg,
	Shannon Nelson, Carolyn Wyborny, Don Skidmore, Matthew Vick,
	John Ronciak, Mitch Williams, intel-wired-lan, netdev,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
index 631c603..5f98870 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
@@ -620,8 +620,7 @@ static void ixgbe_fcoe_dma_pool_free(struct ixgbe_fcoe *fcoe, unsigned int cpu)
 	struct ixgbe_fcoe_ddp_pool *ddp_pool;
 
 	ddp_pool = per_cpu_ptr(fcoe->ddp_pool, cpu);
-	if (ddp_pool->pool)
-		dma_pool_destroy(ddp_pool->pool);
+	dma_pool_destroy(ddp_pool->pool);
 	ddp_pool->pool = NULL;
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 20/39] ixgbe: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: sergey.senozhatsky, kernel-janitors, Jesse Brandeburg,
	Shannon Nelson, Carolyn Wyborny, Don Skidmore, Matthew Vick,
	John Ronciak, Mitch Williams, intel-wired-lan, netdev,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
index 631c603..5f98870 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
@@ -620,8 +620,7 @@ static void ixgbe_fcoe_dma_pool_free(struct ixgbe_fcoe *fcoe, unsigned int cpu)
 	struct ixgbe_fcoe_ddp_pool *ddp_pool;
 
 	ddp_pool = per_cpu_ptr(fcoe->ddp_pool, cpu);
-	if (ddp_pool->pool)
-		dma_pool_destroy(ddp_pool->pool);
+	dma_pool_destroy(ddp_pool->pool);
 	ddp_pool->pool = NULL;
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [Intel-wired-lan] [PATCH 20/39] ixgbe: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: intel-wired-lan

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
index 631c603..5f98870 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
@@ -620,8 +620,7 @@ static void ixgbe_fcoe_dma_pool_free(struct ixgbe_fcoe *fcoe, unsigned int cpu)
 	struct ixgbe_fcoe_ddp_pool *ddp_pool;
 
 	ddp_pool = per_cpu_ptr(fcoe->ddp_pool, cpu);
-	if (ddp_pool->pool)
-		dma_pool_destroy(ddp_pool->pool);
+	dma_pool_destroy(ddp_pool->pool);
 	ddp_pool->pool = NULL;
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 21/39] drbd: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Lars Ellenberg
  Cc: sergey.senozhatsky, kernel-janitors, drbd-user, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/block/drbd/drbd_main.c |   21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 74d97f4..d98eeec 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2034,20 +2034,13 @@ static void drbd_destroy_mempools(void)
 
 	if (drbd_md_io_bio_set)
 		bioset_free(drbd_md_io_bio_set);
-	if (drbd_md_io_page_pool)
-		mempool_destroy(drbd_md_io_page_pool);
-	if (drbd_ee_mempool)
-		mempool_destroy(drbd_ee_mempool);
-	if (drbd_request_mempool)
-		mempool_destroy(drbd_request_mempool);
-	if (drbd_ee_cache)
-		kmem_cache_destroy(drbd_ee_cache);
-	if (drbd_request_cache)
-		kmem_cache_destroy(drbd_request_cache);
-	if (drbd_bm_ext_cache)
-		kmem_cache_destroy(drbd_bm_ext_cache);
-	if (drbd_al_ext_cache)
-		kmem_cache_destroy(drbd_al_ext_cache);
+	mempool_destroy(drbd_md_io_page_pool);
+	mempool_destroy(drbd_ee_mempool);
+	mempool_destroy(drbd_request_mempool);
+	kmem_cache_destroy(drbd_ee_cache);
+	kmem_cache_destroy(drbd_request_cache);
+	kmem_cache_destroy(drbd_bm_ext_cache);
+	kmem_cache_destroy(drbd_al_ext_cache);
 
 	drbd_md_io_bio_set   = NULL;
 	drbd_md_io_page_pool = NULL;


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 21/39] drbd: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Lars Ellenberg
  Cc: sergey.senozhatsky, kernel-janitors, drbd-user, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/block/drbd/drbd_main.c |   21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 74d97f4..d98eeec 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -2034,20 +2034,13 @@ static void drbd_destroy_mempools(void)
 
 	if (drbd_md_io_bio_set)
 		bioset_free(drbd_md_io_bio_set);
-	if (drbd_md_io_page_pool)
-		mempool_destroy(drbd_md_io_page_pool);
-	if (drbd_ee_mempool)
-		mempool_destroy(drbd_ee_mempool);
-	if (drbd_request_mempool)
-		mempool_destroy(drbd_request_mempool);
-	if (drbd_ee_cache)
-		kmem_cache_destroy(drbd_ee_cache);
-	if (drbd_request_cache)
-		kmem_cache_destroy(drbd_request_cache);
-	if (drbd_bm_ext_cache)
-		kmem_cache_destroy(drbd_bm_ext_cache);
-	if (drbd_al_ext_cache)
-		kmem_cache_destroy(drbd_al_ext_cache);
+	mempool_destroy(drbd_md_io_page_pool);
+	mempool_destroy(drbd_ee_mempool);
+	mempool_destroy(drbd_request_mempool);
+	kmem_cache_destroy(drbd_ee_cache);
+	kmem_cache_destroy(drbd_request_cache);
+	kmem_cache_destroy(drbd_bm_ext_cache);
+	kmem_cache_destroy(drbd_al_ext_cache);
 
 	drbd_md_io_bio_set   = NULL;
 	drbd_md_io_page_pool = NULL;


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 22/39] nfsd: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: sergey.senozhatsky, kernel-janitors, Jeff Layton, linux-nfs,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/nfsd/nfscache.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 46ec934..116940c 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -217,10 +217,8 @@ void nfsd_reply_cache_shutdown(void)
 	drc_hashtbl = NULL;
 	drc_hashsize = 0;
 
-	if (drc_slab) {
-		kmem_cache_destroy(drc_slab);
-		drc_slab = NULL;
-	}
+	kmem_cache_destroy(drc_slab);
+	drc_slab = NULL;
 }
 
 /*


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 22/39] nfsd: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: sergey.senozhatsky, kernel-janitors, Jeff Layton, linux-nfs,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/nfsd/nfscache.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
index 46ec934..116940c 100644
--- a/fs/nfsd/nfscache.c
+++ b/fs/nfsd/nfscache.c
@@ -217,10 +217,8 @@ void nfsd_reply_cache_shutdown(void)
 	drc_hashtbl = NULL;
 	drc_hashsize = 0;
 
-	if (drc_slab) {
-		kmem_cache_destroy(drc_slab);
-		drc_slab = NULL;
-	}
+	kmem_cache_destroy(drc_slab);
+	drc_slab = NULL;
 }
 
 /*


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 23/39] UBI: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: sergey.senozhatsky, kernel-janitors, Richard Weinberger,
	David Woodhouse, Brian Norris, linux-mtd, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/mtd/ubi/attach.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index 68eea5b..c1aaf03 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -1209,9 +1209,7 @@ static void destroy_ai(struct ubi_attach_info *ai)
 		}
 	}
 
-	if (ai->aeb_slab_cache)
-		kmem_cache_destroy(ai->aeb_slab_cache);
-
+	kmem_cache_destroy(ai->aeb_slab_cache);
 	kfree(ai);
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 23/39] UBI: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: sergey.senozhatsky, kernel-janitors, Richard Weinberger,
	David Woodhouse, Brian Norris, linux-mtd, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/mtd/ubi/attach.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index 68eea5b..c1aaf03 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -1209,9 +1209,7 @@ static void destroy_ai(struct ubi_attach_info *ai)
 		}
 	}
 
-	if (ai->aeb_slab_cache)
-		kmem_cache_destroy(ai->aeb_slab_cache);
-
+	kmem_cache_destroy(ai->aeb_slab_cache);
 	kfree(ai);
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 24/39] dlm: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
  (?)
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Christine Caulfield
  Cc: sergey.senozhatsky, kernel-janitors, David Teigland,
	cluster-devel, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/dlm/memory.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/dlm/memory.c b/fs/dlm/memory.c
index 7cd24bc..0349c89 100644
--- a/fs/dlm/memory.c
+++ b/fs/dlm/memory.c
@@ -38,10 +38,8 @@ int __init dlm_memory_init(void)
 
 void dlm_memory_exit(void)
 {
-	if (lkb_cache)
-		kmem_cache_destroy(lkb_cache);
-	if (rsb_cache)
-		kmem_cache_destroy(rsb_cache);
+	kmem_cache_destroy(lkb_cache);
+	kmem_cache_destroy(rsb_cache);
 }
 
 char *dlm_allocate_lvb(struct dlm_ls *ls)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 24/39] dlm: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Christine Caulfield
  Cc: sergey.senozhatsky, kernel-janitors, David Teigland,
	cluster-devel, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/dlm/memory.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/dlm/memory.c b/fs/dlm/memory.c
index 7cd24bc..0349c89 100644
--- a/fs/dlm/memory.c
+++ b/fs/dlm/memory.c
@@ -38,10 +38,8 @@ int __init dlm_memory_init(void)
 
 void dlm_memory_exit(void)
 {
-	if (lkb_cache)
-		kmem_cache_destroy(lkb_cache);
-	if (rsb_cache)
-		kmem_cache_destroy(rsb_cache);
+	kmem_cache_destroy(lkb_cache);
+	kmem_cache_destroy(rsb_cache);
 }
 
 char *dlm_allocate_lvb(struct dlm_ls *ls)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [Cluster-devel] [PATCH 24/39] dlm: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/dlm/memory.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/dlm/memory.c b/fs/dlm/memory.c
index 7cd24bc..0349c89 100644
--- a/fs/dlm/memory.c
+++ b/fs/dlm/memory.c
@@ -38,10 +38,8 @@ int __init dlm_memory_init(void)
 
 void dlm_memory_exit(void)
 {
-	if (lkb_cache)
-		kmem_cache_destroy(lkb_cache);
-	if (rsb_cache)
-		kmem_cache_destroy(rsb_cache);
+	kmem_cache_destroy(lkb_cache);
+	kmem_cache_destroy(rsb_cache);
 }
 
 char *dlm_allocate_lvb(struct dlm_ls *ls)



^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 25/39] net: core: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: David S. Miller; +Cc: sergey.senozhatsky, kernel-janitors, netdev, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 net/core/sock.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index ca2984a..3307c02 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2740,10 +2740,8 @@ static void req_prot_cleanup(struct request_sock_ops *rsk_prot)
 		return;
 	kfree(rsk_prot->slab_name);
 	rsk_prot->slab_name = NULL;
-	if (rsk_prot->slab) {
-		kmem_cache_destroy(rsk_prot->slab);
-		rsk_prot->slab = NULL;
-	}
+	kmem_cache_destroy(rsk_prot->slab);
+	rsk_prot->slab = NULL;
 }
 
 static int req_prot_init(const struct proto *prot)
@@ -2828,10 +2826,8 @@ void proto_unregister(struct proto *prot)
 	list_del(&prot->node);
 	mutex_unlock(&proto_list_mutex);
 
-	if (prot->slab != NULL) {
-		kmem_cache_destroy(prot->slab);
-		prot->slab = NULL;
-	}
+	kmem_cache_destroy(prot->slab);
+	prot->slab = NULL;
 
 	req_prot_cleanup(prot->rsk_prot);
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 25/39] net: core: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: David S. Miller; +Cc: sergey.senozhatsky, kernel-janitors, netdev, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 net/core/sock.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/net/core/sock.c b/net/core/sock.c
index ca2984a..3307c02 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2740,10 +2740,8 @@ static void req_prot_cleanup(struct request_sock_ops *rsk_prot)
 		return;
 	kfree(rsk_prot->slab_name);
 	rsk_prot->slab_name = NULL;
-	if (rsk_prot->slab) {
-		kmem_cache_destroy(rsk_prot->slab);
-		rsk_prot->slab = NULL;
-	}
+	kmem_cache_destroy(rsk_prot->slab);
+	rsk_prot->slab = NULL;
 }
 
 static int req_prot_init(const struct proto *prot)
@@ -2828,10 +2826,8 @@ void proto_unregister(struct proto *prot)
 	list_del(&prot->node);
 	mutex_unlock(&proto_list_mutex);
 
-	if (prot->slab != NULL) {
-		kmem_cache_destroy(prot->slab);
-		prot->slab = NULL;
-	}
+	kmem_cache_destroy(prot->slab);
+	prot->slab = NULL;
 
 	req_prot_cleanup(prot->rsk_prot);
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 26/39] dmaengine: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Vinod Koul
  Cc: sergey.senozhatsky, kernel-janitors, Dan Williams, dmaengine,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/dma/dmaengine.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 3ff284c..45df9a4 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -1066,11 +1066,9 @@ static void dmaengine_destroy_unmap_pool(void)
 	for (i = 0; i < ARRAY_SIZE(unmap_pool); i++) {
 		struct dmaengine_unmap_pool *p = &unmap_pool[i];
 
-		if (p->pool)
-			mempool_destroy(p->pool);
+		mempool_destroy(p->pool);
 		p->pool = NULL;
-		if (p->cache)
-			kmem_cache_destroy(p->cache);
+		kmem_cache_destroy(p->cache);
 		p->cache = NULL;
 	}
 }


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 26/39] dmaengine: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Vinod Koul
  Cc: sergey.senozhatsky, kernel-janitors, Dan Williams, dmaengine,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/dma/dmaengine.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 3ff284c..45df9a4 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -1066,11 +1066,9 @@ static void dmaengine_destroy_unmap_pool(void)
 	for (i = 0; i < ARRAY_SIZE(unmap_pool); i++) {
 		struct dmaengine_unmap_pool *p = &unmap_pool[i];
 
-		if (p->pool)
-			mempool_destroy(p->pool);
+		mempool_destroy(p->pool);
 		p->pool = NULL;
-		if (p->cache)
-			kmem_cache_destroy(p->cache);
+		kmem_cache_destroy(p->cache);
 		p->cache = NULL;
 	}
 }


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 27/39] ocfs2: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Mark Fasheh
  Cc: sergey.senozhatsky, kernel-janitors, Joel Becker, ocfs2-devel,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);

@@
expression x;
@@

-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/ocfs2/dlm/dlmlock.c   |    3 +--
 fs/ocfs2/dlm/dlmmaster.c |   16 +++++-----------
 fs/ocfs2/super.c         |   18 ++++++------------
 fs/ocfs2/uptodate.c      |    3 +--
 4 files changed, 13 insertions(+), 27 deletions(-)

diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c
index 82e17b0..78f09c7 100644
--- a/fs/ocfs2/uptodate.c
+++ b/fs/ocfs2/uptodate.c
@@ -633,6 +633,5 @@ int __init init_ocfs2_uptodate_cache(void)
 
 void exit_ocfs2_uptodate_cache(void)
 {
-	if (ocfs2_uptodate_cachep)
-		kmem_cache_destroy(ocfs2_uptodate_cachep);
+	kmem_cache_destroy(ocfs2_uptodate_cachep);
 }
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index 46b8b2b..eb53b98 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -414,8 +414,7 @@ int dlm_init_mle_cache(void)
 
 void dlm_destroy_mle_cache(void)
 {
-	if (dlm_mle_cache)
-		kmem_cache_destroy(dlm_mle_cache);
+	kmem_cache_destroy(dlm_mle_cache);
 }
 
 static void dlm_mle_release(struct kref *kref)
@@ -472,15 +471,10 @@ bail:
 
 void dlm_destroy_master_caches(void)
 {
-	if (dlm_lockname_cache) {
-		kmem_cache_destroy(dlm_lockname_cache);
-		dlm_lockname_cache = NULL;
-	}
-
-	if (dlm_lockres_cache) {
-		kmem_cache_destroy(dlm_lockres_cache);
-		dlm_lockres_cache = NULL;
-	}
+	kmem_cache_destroy(dlm_lockname_cache);
+	dlm_lockname_cache = NULL;
+	kmem_cache_destroy(dlm_lockres_cache);
+	dlm_lockres_cache = NULL;
 }
 
 static void dlm_lockres_release(struct kref *kref)
diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c
index 66c2a49..7496231 100644
--- a/fs/ocfs2/dlm/dlmlock.c
+++ b/fs/ocfs2/dlm/dlmlock.c
@@ -77,8 +77,7 @@ int dlm_init_lock_cache(void)
 
 void dlm_destroy_lock_cache(void)
 {
-	if (dlm_lock_cache)
-		kmem_cache_destroy(dlm_lock_cache);
+	kmem_cache_destroy(dlm_lock_cache);
 }
 
 /* Tell us whether we can grant a new lock request.
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 2de4c8a..88396d2 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1786,12 +1786,9 @@ static int ocfs2_initialize_mem_caches(void)
 					NULL);
 	if (!ocfs2_inode_cachep || !ocfs2_dquot_cachep ||
 	    !ocfs2_qf_chunk_cachep) {
-		if (ocfs2_inode_cachep)
-			kmem_cache_destroy(ocfs2_inode_cachep);
-		if (ocfs2_dquot_cachep)
-			kmem_cache_destroy(ocfs2_dquot_cachep);
-		if (ocfs2_qf_chunk_cachep)
-			kmem_cache_destroy(ocfs2_qf_chunk_cachep);
+		kmem_cache_destroy(ocfs2_inode_cachep);
+		kmem_cache_destroy(ocfs2_dquot_cachep);
+		kmem_cache_destroy(ocfs2_qf_chunk_cachep);
 		return -ENOMEM;
 	}
 
@@ -1805,16 +1802,13 @@ static void ocfs2_free_mem_caches(void)
 	 * destroy cache.
 	 */
 	rcu_barrier();
-	if (ocfs2_inode_cachep)
-		kmem_cache_destroy(ocfs2_inode_cachep);
+	kmem_cache_destroy(ocfs2_inode_cachep);
 	ocfs2_inode_cachep = NULL;
 
-	if (ocfs2_dquot_cachep)
-		kmem_cache_destroy(ocfs2_dquot_cachep);
+	kmem_cache_destroy(ocfs2_dquot_cachep);
 	ocfs2_dquot_cachep = NULL;
 
-	if (ocfs2_qf_chunk_cachep)
-		kmem_cache_destroy(ocfs2_qf_chunk_cachep);
+	kmem_cache_destroy(ocfs2_qf_chunk_cachep);
 	ocfs2_qf_chunk_cachep = NULL;
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 27/39] ocfs2: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Mark Fasheh
  Cc: sergey.senozhatsky, kernel-janitors, Joel Becker, ocfs2-devel,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);

@@
expression x;
@@

-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/ocfs2/dlm/dlmlock.c   |    3 +--
 fs/ocfs2/dlm/dlmmaster.c |   16 +++++-----------
 fs/ocfs2/super.c         |   18 ++++++------------
 fs/ocfs2/uptodate.c      |    3 +--
 4 files changed, 13 insertions(+), 27 deletions(-)

diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c
index 82e17b0..78f09c7 100644
--- a/fs/ocfs2/uptodate.c
+++ b/fs/ocfs2/uptodate.c
@@ -633,6 +633,5 @@ int __init init_ocfs2_uptodate_cache(void)
 
 void exit_ocfs2_uptodate_cache(void)
 {
-	if (ocfs2_uptodate_cachep)
-		kmem_cache_destroy(ocfs2_uptodate_cachep);
+	kmem_cache_destroy(ocfs2_uptodate_cachep);
 }
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index 46b8b2b..eb53b98 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -414,8 +414,7 @@ int dlm_init_mle_cache(void)
 
 void dlm_destroy_mle_cache(void)
 {
-	if (dlm_mle_cache)
-		kmem_cache_destroy(dlm_mle_cache);
+	kmem_cache_destroy(dlm_mle_cache);
 }
 
 static void dlm_mle_release(struct kref *kref)
@@ -472,15 +471,10 @@ bail:
 
 void dlm_destroy_master_caches(void)
 {
-	if (dlm_lockname_cache) {
-		kmem_cache_destroy(dlm_lockname_cache);
-		dlm_lockname_cache = NULL;
-	}
-
-	if (dlm_lockres_cache) {
-		kmem_cache_destroy(dlm_lockres_cache);
-		dlm_lockres_cache = NULL;
-	}
+	kmem_cache_destroy(dlm_lockname_cache);
+	dlm_lockname_cache = NULL;
+	kmem_cache_destroy(dlm_lockres_cache);
+	dlm_lockres_cache = NULL;
 }
 
 static void dlm_lockres_release(struct kref *kref)
diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c
index 66c2a49..7496231 100644
--- a/fs/ocfs2/dlm/dlmlock.c
+++ b/fs/ocfs2/dlm/dlmlock.c
@@ -77,8 +77,7 @@ int dlm_init_lock_cache(void)
 
 void dlm_destroy_lock_cache(void)
 {
-	if (dlm_lock_cache)
-		kmem_cache_destroy(dlm_lock_cache);
+	kmem_cache_destroy(dlm_lock_cache);
 }
 
 /* Tell us whether we can grant a new lock request.
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 2de4c8a..88396d2 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -1786,12 +1786,9 @@ static int ocfs2_initialize_mem_caches(void)
 					NULL);
 	if (!ocfs2_inode_cachep || !ocfs2_dquot_cachep ||
 	    !ocfs2_qf_chunk_cachep) {
-		if (ocfs2_inode_cachep)
-			kmem_cache_destroy(ocfs2_inode_cachep);
-		if (ocfs2_dquot_cachep)
-			kmem_cache_destroy(ocfs2_dquot_cachep);
-		if (ocfs2_qf_chunk_cachep)
-			kmem_cache_destroy(ocfs2_qf_chunk_cachep);
+		kmem_cache_destroy(ocfs2_inode_cachep);
+		kmem_cache_destroy(ocfs2_dquot_cachep);
+		kmem_cache_destroy(ocfs2_qf_chunk_cachep);
 		return -ENOMEM;
 	}
 
@@ -1805,16 +1802,13 @@ static void ocfs2_free_mem_caches(void)
 	 * destroy cache.
 	 */
 	rcu_barrier();
-	if (ocfs2_inode_cachep)
-		kmem_cache_destroy(ocfs2_inode_cachep);
+	kmem_cache_destroy(ocfs2_inode_cachep);
 	ocfs2_inode_cachep = NULL;
 
-	if (ocfs2_dquot_cachep)
-		kmem_cache_destroy(ocfs2_dquot_cachep);
+	kmem_cache_destroy(ocfs2_dquot_cachep);
 	ocfs2_dquot_cachep = NULL;
 
-	if (ocfs2_qf_chunk_cachep)
-		kmem_cache_destroy(ocfs2_qf_chunk_cachep);
+	kmem_cache_destroy(ocfs2_qf_chunk_cachep);
 	ocfs2_qf_chunk_cachep = NULL;
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 28/39] ecryptfs: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Tyler Hicks; +Cc: sergey.senozhatsky, kernel-janitors, ecryptfs, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/ecryptfs/main.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 4f4d047..e83f31c 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -737,8 +737,7 @@ static void ecryptfs_free_kmem_caches(void)
 		struct ecryptfs_cache_info *info;
 
 		info = &ecryptfs_cache_infos[i];
-		if (*(info->cache))
-			kmem_cache_destroy(*(info->cache));
+		kmem_cache_destroy(*(info->cache));
 	}
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 28/39] ecryptfs: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Tyler Hicks; +Cc: sergey.senozhatsky, kernel-janitors, ecryptfs, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/ecryptfs/main.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 4f4d047..e83f31c 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -737,8 +737,7 @@ static void ecryptfs_free_kmem_caches(void)
 		struct ecryptfs_cache_info *info;
 
 		info = &ecryptfs_cache_infos[i];
-		if (*(info->cache))
-			kmem_cache_destroy(*(info->cache));
+		kmem_cache_destroy(*(info->cache));
 	}
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 29/39] thunderbolt: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Andreas Noever; +Cc: sergey.senozhatsky, kernel-janitors, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/thunderbolt/ctl.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
index 799634b..163b283 100644
--- a/drivers/thunderbolt/ctl.c
+++ b/drivers/thunderbolt/ctl.c
@@ -530,8 +530,7 @@ void tb_ctl_free(struct tb_ctl *ctl)
 		tb_ctl_pkg_free(ctl->rx_packets[i]);
 
 
-	if (ctl->frame_pool)
-		dma_pool_destroy(ctl->frame_pool);
+	dma_pool_destroy(ctl->frame_pool);
 	kfree(ctl);
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 29/39] thunderbolt: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Andreas Noever; +Cc: sergey.senozhatsky, kernel-janitors, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/thunderbolt/ctl.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/thunderbolt/ctl.c b/drivers/thunderbolt/ctl.c
index 799634b..163b283 100644
--- a/drivers/thunderbolt/ctl.c
+++ b/drivers/thunderbolt/ctl.c
@@ -530,8 +530,7 @@ void tb_ctl_free(struct tb_ctl *ctl)
 		tb_ctl_pkg_free(ctl->rx_packets[i]);
 
 
-	if (ctl->frame_pool)
-		dma_pool_destroy(ctl->frame_pool);
+	dma_pool_destroy(ctl->frame_pool);
 	kfree(ctl);
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 30/39] block: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Jens Axboe; +Cc: sergey.senozhatsky, kernel-janitors, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 block/bio-integrity.c |    7 ++-----
 block/bio.c           |    7 ++-----
 block/blk-core.c      |    3 +--
 block/elevator.c      |    3 +--
 4 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/block/elevator.c b/block/elevator.c
index 84d6394..e3e9021 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -847,8 +847,7 @@ int elv_register(struct elevator_type *e)
 	spin_lock(&elv_list_lock);
 	if (elevator_find(e->elevator_name)) {
 		spin_unlock(&elv_list_lock);
-		if (e->icq_cache)
-			kmem_cache_destroy(e->icq_cache);
+		kmem_cache_destroy(e->icq_cache);
 		return -EBUSY;
 	}
 	list_add_tail(&e->list, &elv_list);
diff --git a/block/bio.c b/block/bio.c
index ad3f276..aee3290 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1850,11 +1850,8 @@ void bioset_free(struct bio_set *bs)
 	if (bs->rescue_workqueue)
 		destroy_workqueue(bs->rescue_workqueue);
 
-	if (bs->bio_pool)
-		mempool_destroy(bs->bio_pool);
-
-	if (bs->bvec_pool)
-		mempool_destroy(bs->bvec_pool);
+	mempool_destroy(bs->bio_pool);
+	mempool_destroy(bs->bvec_pool);
 
 	bioset_integrity_free(bs);
 	bio_put_slab(bs);
diff --git a/block/blk-core.c b/block/blk-core.c
index 2eb722d..7dbebd9 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -619,8 +619,7 @@ int blk_init_rl(struct request_list *rl, struct request_queue *q,
 
 void blk_exit_rl(struct request_list *rl)
 {
-	if (rl->rq_pool)
-		mempool_destroy(rl->rq_pool);
+	mempool_destroy(rl->rq_pool);
 }
 
 struct request_queue *blk_alloc_queue(gfp_t gfp_mask)
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 4aecca7..d3e3046 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -490,11 +490,8 @@ EXPORT_SYMBOL(bioset_integrity_create);
 
 void bioset_integrity_free(struct bio_set *bs)
 {
-	if (bs->bio_integrity_pool)
-		mempool_destroy(bs->bio_integrity_pool);
-
-	if (bs->bvec_integrity_pool)
-		mempool_destroy(bs->bvec_integrity_pool);
+	mempool_destroy(bs->bio_integrity_pool);
+	mempool_destroy(bs->bvec_integrity_pool);
 }
 EXPORT_SYMBOL(bioset_integrity_free);
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 30/39] block: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Jens Axboe; +Cc: sergey.senozhatsky, kernel-janitors, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 block/bio-integrity.c |    7 ++-----
 block/bio.c           |    7 ++-----
 block/blk-core.c      |    3 +--
 block/elevator.c      |    3 +--
 4 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/block/elevator.c b/block/elevator.c
index 84d6394..e3e9021 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -847,8 +847,7 @@ int elv_register(struct elevator_type *e)
 	spin_lock(&elv_list_lock);
 	if (elevator_find(e->elevator_name)) {
 		spin_unlock(&elv_list_lock);
-		if (e->icq_cache)
-			kmem_cache_destroy(e->icq_cache);
+		kmem_cache_destroy(e->icq_cache);
 		return -EBUSY;
 	}
 	list_add_tail(&e->list, &elv_list);
diff --git a/block/bio.c b/block/bio.c
index ad3f276..aee3290 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1850,11 +1850,8 @@ void bioset_free(struct bio_set *bs)
 	if (bs->rescue_workqueue)
 		destroy_workqueue(bs->rescue_workqueue);
 
-	if (bs->bio_pool)
-		mempool_destroy(bs->bio_pool);
-
-	if (bs->bvec_pool)
-		mempool_destroy(bs->bvec_pool);
+	mempool_destroy(bs->bio_pool);
+	mempool_destroy(bs->bvec_pool);
 
 	bioset_integrity_free(bs);
 	bio_put_slab(bs);
diff --git a/block/blk-core.c b/block/blk-core.c
index 2eb722d..7dbebd9 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -619,8 +619,7 @@ int blk_init_rl(struct request_list *rl, struct request_queue *q,
 
 void blk_exit_rl(struct request_list *rl)
 {
-	if (rl->rq_pool)
-		mempool_destroy(rl->rq_pool);
+	mempool_destroy(rl->rq_pool);
 }
 
 struct request_queue *blk_alloc_queue(gfp_t gfp_mask)
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 4aecca7..d3e3046 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -490,11 +490,8 @@ EXPORT_SYMBOL(bioset_integrity_create);
 
 void bioset_integrity_free(struct bio_set *bs)
 {
-	if (bs->bio_integrity_pool)
-		mempool_destroy(bs->bio_integrity_pool);
-
-	if (bs->bvec_integrity_pool)
-		mempool_destroy(bs->bvec_integrity_pool);
+	mempool_destroy(bs->bio_integrity_pool);
+	mempool_destroy(bs->bvec_integrity_pool);
 }
 EXPORT_SYMBOL(bioset_integrity_free);
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 31/39] KVM: MMU: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Gleb Natapov
  Cc: sergey.senozhatsky, kernel-janitors, Paolo Bonzini,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, kvm,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 arch/x86/kvm/mmu.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 69088a1..fb0c1bd 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -4883,10 +4883,8 @@ static struct shrinker mmu_shrinker = {
 
 static void mmu_destroy_caches(void)
 {
-	if (pte_list_desc_cache)
-		kmem_cache_destroy(pte_list_desc_cache);
-	if (mmu_page_header_cache)
-		kmem_cache_destroy(mmu_page_header_cache);
+	kmem_cache_destroy(pte_list_desc_cache);
+	kmem_cache_destroy(mmu_page_header_cache);
 }
 
 int kvm_mmu_module_init(void)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 31/39] KVM: MMU: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Gleb Natapov
  Cc: sergey.senozhatsky, kernel-janitors, Paolo Bonzini,
	Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, kvm,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 arch/x86/kvm/mmu.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 69088a1..fb0c1bd 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -4883,10 +4883,8 @@ static struct shrinker mmu_shrinker = {
 
 static void mmu_destroy_caches(void)
 {
-	if (pte_list_desc_cache)
-		kmem_cache_destroy(pte_list_desc_cache);
-	if (mmu_page_header_cache)
-		kmem_cache_destroy(mmu_page_header_cache);
+	kmem_cache_destroy(pte_list_desc_cache);
+	kmem_cache_destroy(mmu_page_header_cache);
 }
 
 int kvm_mmu_module_init(void)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 32/39] drm: i915: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: sergey.senozhatsky, kernel-janitors, Jani Nikula, David Airlie,
	intel-gfx, dri-devel, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/gpu/drm/i915/i915_dma.c |   19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index ab37d11..1dc7c21 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1059,12 +1059,9 @@ out_freecsr:
 put_bridge:
 	pci_dev_put(dev_priv->bridge_dev);
 free_priv:
-	if (dev_priv->requests)
-		kmem_cache_destroy(dev_priv->requests);
-	if (dev_priv->vmas)
-		kmem_cache_destroy(dev_priv->vmas);
-	if (dev_priv->objects)
-		kmem_cache_destroy(dev_priv->objects);
+	kmem_cache_destroy(dev_priv->requests);
+	kmem_cache_destroy(dev_priv->vmas);
+	kmem_cache_destroy(dev_priv->objects);
 	kfree(dev_priv);
 	return ret;
 }
@@ -1150,13 +1147,9 @@ int i915_driver_unload(struct drm_device *dev)
 	if (dev_priv->regs != NULL)
 		pci_iounmap(dev->pdev, dev_priv->regs);
 
-	if (dev_priv->requests)
-		kmem_cache_destroy(dev_priv->requests);
-	if (dev_priv->vmas)
-		kmem_cache_destroy(dev_priv->vmas);
-	if (dev_priv->objects)
-		kmem_cache_destroy(dev_priv->objects);
-
+	kmem_cache_destroy(dev_priv->requests);
+	kmem_cache_destroy(dev_priv->vmas);
+	kmem_cache_destroy(dev_priv->objects);
 	pci_dev_put(dev_priv->bridge_dev);
 	kfree(dev_priv);
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 32/39] drm: i915: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: sergey.senozhatsky, kernel-janitors, Jani Nikula, David Airlie,
	intel-gfx, dri-devel, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/gpu/drm/i915/i915_dma.c |   19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index ab37d11..1dc7c21 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1059,12 +1059,9 @@ out_freecsr:
 put_bridge:
 	pci_dev_put(dev_priv->bridge_dev);
 free_priv:
-	if (dev_priv->requests)
-		kmem_cache_destroy(dev_priv->requests);
-	if (dev_priv->vmas)
-		kmem_cache_destroy(dev_priv->vmas);
-	if (dev_priv->objects)
-		kmem_cache_destroy(dev_priv->objects);
+	kmem_cache_destroy(dev_priv->requests);
+	kmem_cache_destroy(dev_priv->vmas);
+	kmem_cache_destroy(dev_priv->objects);
 	kfree(dev_priv);
 	return ret;
 }
@@ -1150,13 +1147,9 @@ int i915_driver_unload(struct drm_device *dev)
 	if (dev_priv->regs != NULL)
 		pci_iounmap(dev->pdev, dev_priv->regs);
 
-	if (dev_priv->requests)
-		kmem_cache_destroy(dev_priv->requests);
-	if (dev_priv->vmas)
-		kmem_cache_destroy(dev_priv->vmas);
-	if (dev_priv->objects)
-		kmem_cache_destroy(dev_priv->objects);
-
+	kmem_cache_destroy(dev_priv->requests);
+	kmem_cache_destroy(dev_priv->vmas);
+	kmem_cache_destroy(dev_priv->objects);
 	pci_dev_put(dev_priv->bridge_dev);
 	kfree(dev_priv);
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 33/39] rbd: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Ilya Dryomov
  Cc: sergey.senozhatsky, kernel-janitors, Sage Weil, Alex Elder,
	ceph-devel, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/block/rbd.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index d93a037..0507246 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5645,10 +5645,8 @@ static int rbd_slab_init(void)
 	if (rbd_segment_name_cache)
 		return 0;
 out_err:
-	if (rbd_obj_request_cache) {
-		kmem_cache_destroy(rbd_obj_request_cache);
-		rbd_obj_request_cache = NULL;
-	}
+	kmem_cache_destroy(rbd_obj_request_cache);
+	rbd_obj_request_cache = NULL;
 
 	kmem_cache_destroy(rbd_img_request_cache);
 	rbd_img_request_cache = NULL;


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 33/39] rbd: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Ilya Dryomov
  Cc: sergey.senozhatsky, kernel-janitors, Sage Weil, Alex Elder,
	ceph-devel, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/block/rbd.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index d93a037..0507246 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5645,10 +5645,8 @@ static int rbd_slab_init(void)
 	if (rbd_segment_name_cache)
 		return 0;
 out_err:
-	if (rbd_obj_request_cache) {
-		kmem_cache_destroy(rbd_obj_request_cache);
-		rbd_obj_request_cache = NULL;
-	}
+	kmem_cache_destroy(rbd_obj_request_cache);
+	rbd_obj_request_cache = NULL;
 
 	kmem_cache_destroy(rbd_img_request_cache);
 	rbd_img_request_cache = NULL;


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 34/39] dccp: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
  (?)
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Gerrit Renker
  Cc: sergey.senozhatsky, kernel-janitors, David S. Miller, dccp,
	netdev, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);

@@
expression x;
@@

-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 net/dccp/ackvec.c |   12 ++++--------
 net/dccp/ccid.c   |    3 +--
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/net/dccp/ccid.c b/net/dccp/ccid.c
index 8349897..90f77d0 100644
--- a/net/dccp/ccid.c
+++ b/net/dccp/ccid.c
@@ -95,8 +95,7 @@ static struct kmem_cache *ccid_kmem_cache_create(int obj_size, char *slab_name_f
 
 static void ccid_kmem_cache_destroy(struct kmem_cache *slab)
 {
-	if (slab != NULL)
-		kmem_cache_destroy(slab);
+	kmem_cache_destroy(slab);
 }
 
 static int __init ccid_activate(struct ccid_operations *ccid_ops)
diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c
index bd9e718..3de0d03 100644
--- a/net/dccp/ackvec.c
+++ b/net/dccp/ackvec.c
@@ -398,12 +398,8 @@ out_err:
 
 void dccp_ackvec_exit(void)
 {
-	if (dccp_ackvec_slab != NULL) {
-		kmem_cache_destroy(dccp_ackvec_slab);
-		dccp_ackvec_slab = NULL;
-	}
-	if (dccp_ackvec_record_slab != NULL) {
-		kmem_cache_destroy(dccp_ackvec_record_slab);
-		dccp_ackvec_record_slab = NULL;
-	}
+	kmem_cache_destroy(dccp_ackvec_slab);
+	dccp_ackvec_slab = NULL;
+	kmem_cache_destroy(dccp_ackvec_record_slab);
+	dccp_ackvec_record_slab = NULL;
 }


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 34/39] dccp: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Gerrit Renker
  Cc: sergey.senozhatsky, kernel-janitors, David S. Miller, dccp,
	netdev, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);

@@
expression x;
@@

-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 net/dccp/ackvec.c |   12 ++++--------
 net/dccp/ccid.c   |    3 +--
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/net/dccp/ccid.c b/net/dccp/ccid.c
index 8349897..90f77d0 100644
--- a/net/dccp/ccid.c
+++ b/net/dccp/ccid.c
@@ -95,8 +95,7 @@ static struct kmem_cache *ccid_kmem_cache_create(int obj_size, char *slab_name_f
 
 static void ccid_kmem_cache_destroy(struct kmem_cache *slab)
 {
-	if (slab != NULL)
-		kmem_cache_destroy(slab);
+	kmem_cache_destroy(slab);
 }
 
 static int __init ccid_activate(struct ccid_operations *ccid_ops)
diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c
index bd9e718..3de0d03 100644
--- a/net/dccp/ackvec.c
+++ b/net/dccp/ackvec.c
@@ -398,12 +398,8 @@ out_err:
 
 void dccp_ackvec_exit(void)
 {
-	if (dccp_ackvec_slab != NULL) {
-		kmem_cache_destroy(dccp_ackvec_slab);
-		dccp_ackvec_slab = NULL;
-	}
-	if (dccp_ackvec_record_slab != NULL) {
-		kmem_cache_destroy(dccp_ackvec_record_slab);
-		dccp_ackvec_record_slab = NULL;
-	}
+	kmem_cache_destroy(dccp_ackvec_slab);
+	dccp_ackvec_slab = NULL;
+	kmem_cache_destroy(dccp_ackvec_record_slab);
+	dccp_ackvec_record_slab = NULL;
 }


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 34/39] dccp: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: dccp

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);

@@
expression x;
@@

-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 net/dccp/ackvec.c |   12 ++++--------
 net/dccp/ccid.c   |    3 +--
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/net/dccp/ccid.c b/net/dccp/ccid.c
index 8349897..90f77d0 100644
--- a/net/dccp/ccid.c
+++ b/net/dccp/ccid.c
@@ -95,8 +95,7 @@ static struct kmem_cache *ccid_kmem_cache_create(int obj_size, char *slab_name_f
 
 static void ccid_kmem_cache_destroy(struct kmem_cache *slab)
 {
-	if (slab != NULL)
-		kmem_cache_destroy(slab);
+	kmem_cache_destroy(slab);
 }
 
 static int __init ccid_activate(struct ccid_operations *ccid_ops)
diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c
index bd9e718..3de0d03 100644
--- a/net/dccp/ackvec.c
+++ b/net/dccp/ackvec.c
@@ -398,12 +398,8 @@ out_err:
 
 void dccp_ackvec_exit(void)
 {
-	if (dccp_ackvec_slab != NULL) {
-		kmem_cache_destroy(dccp_ackvec_slab);
-		dccp_ackvec_slab = NULL;
-	}
-	if (dccp_ackvec_record_slab != NULL) {
-		kmem_cache_destroy(dccp_ackvec_record_slab);
-		dccp_ackvec_record_slab = NULL;
-	}
+	kmem_cache_destroy(dccp_ackvec_slab);
+	dccp_ackvec_slab = NULL;
+	kmem_cache_destroy(dccp_ackvec_record_slab);
+	dccp_ackvec_record_slab = NULL;
 }


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 35/39] GFS2: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
  (?)
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Steven Whitehouse
  Cc: sergey.senozhatsky, kernel-janitors, Bob Peterson, cluster-devel,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/gfs2/main.c |   29 +++++++----------------------
 1 file changed, 7 insertions(+), 22 deletions(-)

diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index 241a399..4d78c3e 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -192,28 +192,13 @@ fail:
 fail_lru:
 	unregister_shrinker(&gfs2_qd_shrinker);
 	gfs2_glock_exit();
-
-	if (gfs2_rsrv_cachep)
-		kmem_cache_destroy(gfs2_rsrv_cachep);
-
-	if (gfs2_quotad_cachep)
-		kmem_cache_destroy(gfs2_quotad_cachep);
-
-	if (gfs2_rgrpd_cachep)
-		kmem_cache_destroy(gfs2_rgrpd_cachep);
-
-	if (gfs2_bufdata_cachep)
-		kmem_cache_destroy(gfs2_bufdata_cachep);
-
-	if (gfs2_inode_cachep)
-		kmem_cache_destroy(gfs2_inode_cachep);
-
-	if (gfs2_glock_aspace_cachep)
-		kmem_cache_destroy(gfs2_glock_aspace_cachep);
-
-	if (gfs2_glock_cachep)
-		kmem_cache_destroy(gfs2_glock_cachep);
-
+	kmem_cache_destroy(gfs2_rsrv_cachep);
+	kmem_cache_destroy(gfs2_quotad_cachep);
+	kmem_cache_destroy(gfs2_rgrpd_cachep);
+	kmem_cache_destroy(gfs2_bufdata_cachep);
+	kmem_cache_destroy(gfs2_inode_cachep);
+	kmem_cache_destroy(gfs2_glock_aspace_cachep);
+	kmem_cache_destroy(gfs2_glock_cachep);
 	gfs2_sys_uninit();
 	return error;
 }


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 35/39] GFS2: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Steven Whitehouse
  Cc: sergey.senozhatsky, kernel-janitors, Bob Peterson, cluster-devel,
	linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/gfs2/main.c |   29 +++++++----------------------
 1 file changed, 7 insertions(+), 22 deletions(-)

diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index 241a399..4d78c3e 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -192,28 +192,13 @@ fail:
 fail_lru:
 	unregister_shrinker(&gfs2_qd_shrinker);
 	gfs2_glock_exit();
-
-	if (gfs2_rsrv_cachep)
-		kmem_cache_destroy(gfs2_rsrv_cachep);
-
-	if (gfs2_quotad_cachep)
-		kmem_cache_destroy(gfs2_quotad_cachep);
-
-	if (gfs2_rgrpd_cachep)
-		kmem_cache_destroy(gfs2_rgrpd_cachep);
-
-	if (gfs2_bufdata_cachep)
-		kmem_cache_destroy(gfs2_bufdata_cachep);
-
-	if (gfs2_inode_cachep)
-		kmem_cache_destroy(gfs2_inode_cachep);
-
-	if (gfs2_glock_aspace_cachep)
-		kmem_cache_destroy(gfs2_glock_aspace_cachep);
-
-	if (gfs2_glock_cachep)
-		kmem_cache_destroy(gfs2_glock_cachep);
-
+	kmem_cache_destroy(gfs2_rsrv_cachep);
+	kmem_cache_destroy(gfs2_quotad_cachep);
+	kmem_cache_destroy(gfs2_rgrpd_cachep);
+	kmem_cache_destroy(gfs2_bufdata_cachep);
+	kmem_cache_destroy(gfs2_inode_cachep);
+	kmem_cache_destroy(gfs2_glock_aspace_cachep);
+	kmem_cache_destroy(gfs2_glock_cachep);
 	gfs2_sys_uninit();
 	return error;
 }


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [Cluster-devel] [PATCH 35/39] GFS2: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/gfs2/main.c |   29 +++++++----------------------
 1 file changed, 7 insertions(+), 22 deletions(-)

diff --git a/fs/gfs2/main.c b/fs/gfs2/main.c
index 241a399..4d78c3e 100644
--- a/fs/gfs2/main.c
+++ b/fs/gfs2/main.c
@@ -192,28 +192,13 @@ fail:
 fail_lru:
 	unregister_shrinker(&gfs2_qd_shrinker);
 	gfs2_glock_exit();
-
-	if (gfs2_rsrv_cachep)
-		kmem_cache_destroy(gfs2_rsrv_cachep);
-
-	if (gfs2_quotad_cachep)
-		kmem_cache_destroy(gfs2_quotad_cachep);
-
-	if (gfs2_rgrpd_cachep)
-		kmem_cache_destroy(gfs2_rgrpd_cachep);
-
-	if (gfs2_bufdata_cachep)
-		kmem_cache_destroy(gfs2_bufdata_cachep);
-
-	if (gfs2_inode_cachep)
-		kmem_cache_destroy(gfs2_inode_cachep);
-
-	if (gfs2_glock_aspace_cachep)
-		kmem_cache_destroy(gfs2_glock_aspace_cachep);
-
-	if (gfs2_glock_cachep)
-		kmem_cache_destroy(gfs2_glock_cachep);
-
+	kmem_cache_destroy(gfs2_rsrv_cachep);
+	kmem_cache_destroy(gfs2_quotad_cachep);
+	kmem_cache_destroy(gfs2_rgrpd_cachep);
+	kmem_cache_destroy(gfs2_bufdata_cachep);
+	kmem_cache_destroy(gfs2_inode_cachep);
+	kmem_cache_destroy(gfs2_glock_aspace_cachep);
+	kmem_cache_destroy(gfs2_glock_cachep);
 	gfs2_sys_uninit();
 	return error;
 }



^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 36/39] jffs2: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: David Woodhouse
  Cc: sergey.senozhatsky, kernel-janitors, linux-mtd, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/jffs2/malloc.c |   27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/fs/jffs2/malloc.c b/fs/jffs2/malloc.c
index b8fd651..ce11897 100644
--- a/fs/jffs2/malloc.c
+++ b/fs/jffs2/malloc.c
@@ -97,25 +97,16 @@ int __init jffs2_create_slab_caches(void)
 
 void jffs2_destroy_slab_caches(void)
 {
-	if(full_dnode_slab)
-		kmem_cache_destroy(full_dnode_slab);
-	if(raw_dirent_slab)
-		kmem_cache_destroy(raw_dirent_slab);
-	if(raw_inode_slab)
-		kmem_cache_destroy(raw_inode_slab);
-	if(tmp_dnode_info_slab)
-		kmem_cache_destroy(tmp_dnode_info_slab);
-	if(raw_node_ref_slab)
-		kmem_cache_destroy(raw_node_ref_slab);
-	if(node_frag_slab)
-		kmem_cache_destroy(node_frag_slab);
-	if(inode_cache_slab)
-		kmem_cache_destroy(inode_cache_slab);
+	kmem_cache_destroy(full_dnode_slab);
+	kmem_cache_destroy(raw_dirent_slab);
+	kmem_cache_destroy(raw_inode_slab);
+	kmem_cache_destroy(tmp_dnode_info_slab);
+	kmem_cache_destroy(raw_node_ref_slab);
+	kmem_cache_destroy(node_frag_slab);
+	kmem_cache_destroy(inode_cache_slab);
 #ifdef CONFIG_JFFS2_FS_XATTR
-	if (xattr_datum_cache)
-		kmem_cache_destroy(xattr_datum_cache);
-	if (xattr_ref_cache)
-		kmem_cache_destroy(xattr_ref_cache);
+	kmem_cache_destroy(xattr_datum_cache);
+	kmem_cache_destroy(xattr_ref_cache);
 #endif
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 36/39] jffs2: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: David Woodhouse
  Cc: sergey.senozhatsky, kernel-janitors, linux-mtd, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/jffs2/malloc.c |   27 +++++++++------------------
 1 file changed, 9 insertions(+), 18 deletions(-)

diff --git a/fs/jffs2/malloc.c b/fs/jffs2/malloc.c
index b8fd651..ce11897 100644
--- a/fs/jffs2/malloc.c
+++ b/fs/jffs2/malloc.c
@@ -97,25 +97,16 @@ int __init jffs2_create_slab_caches(void)
 
 void jffs2_destroy_slab_caches(void)
 {
-	if(full_dnode_slab)
-		kmem_cache_destroy(full_dnode_slab);
-	if(raw_dirent_slab)
-		kmem_cache_destroy(raw_dirent_slab);
-	if(raw_inode_slab)
-		kmem_cache_destroy(raw_inode_slab);
-	if(tmp_dnode_info_slab)
-		kmem_cache_destroy(tmp_dnode_info_slab);
-	if(raw_node_ref_slab)
-		kmem_cache_destroy(raw_node_ref_slab);
-	if(node_frag_slab)
-		kmem_cache_destroy(node_frag_slab);
-	if(inode_cache_slab)
-		kmem_cache_destroy(inode_cache_slab);
+	kmem_cache_destroy(full_dnode_slab);
+	kmem_cache_destroy(raw_dirent_slab);
+	kmem_cache_destroy(raw_inode_slab);
+	kmem_cache_destroy(tmp_dnode_info_slab);
+	kmem_cache_destroy(raw_node_ref_slab);
+	kmem_cache_destroy(node_frag_slab);
+	kmem_cache_destroy(inode_cache_slab);
 #ifdef CONFIG_JFFS2_FS_XATTR
-	if (xattr_datum_cache)
-		kmem_cache_destroy(xattr_datum_cache);
-	if (xattr_ref_cache)
-		kmem_cache_destroy(xattr_ref_cache);
+	kmem_cache_destroy(xattr_datum_cache);
+	kmem_cache_destroy(xattr_ref_cache);
 #endif
 }
 


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 37/39] f2fs crypto: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Jaegeuk Kim
  Cc: sergey.senozhatsky, kernel-janitors, Changman Lee, Chao Yu,
	linux-f2fs-devel, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/f2fs/crypto.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/fs/f2fs/crypto.c b/fs/f2fs/crypto.c
index 4a62ef1..3c27f04 100644
--- a/fs/f2fs/crypto.c
+++ b/fs/f2fs/crypto.c
@@ -183,8 +183,7 @@ static void f2fs_crypto_destroy(void)
 	list_for_each_entry_safe(pos, n, &f2fs_free_crypto_ctxs, free_list)
 		kmem_cache_free(f2fs_crypto_ctx_cachep, pos);
 	INIT_LIST_HEAD(&f2fs_free_crypto_ctxs);
-	if (f2fs_bounce_page_pool)
-		mempool_destroy(f2fs_bounce_page_pool);
+	mempool_destroy(f2fs_bounce_page_pool);
 	f2fs_bounce_page_pool = NULL;
 }
 
@@ -240,10 +239,8 @@ void f2fs_exit_crypto(void)
 
 	if (f2fs_read_workqueue)
 		destroy_workqueue(f2fs_read_workqueue);
-	if (f2fs_crypto_ctx_cachep)
-		kmem_cache_destroy(f2fs_crypto_ctx_cachep);
-	if (f2fs_crypt_info_cachep)
-		kmem_cache_destroy(f2fs_crypt_info_cachep);
+	kmem_cache_destroy(f2fs_crypto_ctx_cachep);
+	kmem_cache_destroy(f2fs_crypt_info_cachep);
 }
 
 int __init f2fs_init_crypto(void)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 37/39] f2fs crypto: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Jaegeuk Kim
  Cc: sergey.senozhatsky, kernel-janitors, Changman Lee, Chao Yu,
	linux-f2fs-devel, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 fs/f2fs/crypto.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/fs/f2fs/crypto.c b/fs/f2fs/crypto.c
index 4a62ef1..3c27f04 100644
--- a/fs/f2fs/crypto.c
+++ b/fs/f2fs/crypto.c
@@ -183,8 +183,7 @@ static void f2fs_crypto_destroy(void)
 	list_for_each_entry_safe(pos, n, &f2fs_free_crypto_ctxs, free_list)
 		kmem_cache_free(f2fs_crypto_ctx_cachep, pos);
 	INIT_LIST_HEAD(&f2fs_free_crypto_ctxs);
-	if (f2fs_bounce_page_pool)
-		mempool_destroy(f2fs_bounce_page_pool);
+	mempool_destroy(f2fs_bounce_page_pool);
 	f2fs_bounce_page_pool = NULL;
 }
 
@@ -240,10 +239,8 @@ void f2fs_exit_crypto(void)
 
 	if (f2fs_read_workqueue)
 		destroy_workqueue(f2fs_read_workqueue);
-	if (f2fs_crypto_ctx_cachep)
-		kmem_cache_destroy(f2fs_crypto_ctx_cachep);
-	if (f2fs_crypt_info_cachep)
-		kmem_cache_destroy(f2fs_crypt_info_cachep);
+	kmem_cache_destroy(f2fs_crypto_ctx_cachep);
+	kmem_cache_destroy(f2fs_crypt_info_cachep);
 }
 
 int __init f2fs_init_crypto(void)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 38/39] iommu/amd: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Joerg Roedel; +Cc: sergey.senozhatsky, kernel-janitors, iommu, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/iommu/amd_iommu_init.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 5ef347a..5fb59cc 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -1755,11 +1755,8 @@ static void __init free_on_init_error(void)
 	free_pages((unsigned long)irq_lookup_table,
 		   get_order(rlookup_table_size));
 
-	if (amd_iommu_irq_cache) {
-		kmem_cache_destroy(amd_iommu_irq_cache);
-		amd_iommu_irq_cache = NULL;
-
-	}
+	kmem_cache_destroy(amd_iommu_irq_cache);
+	amd_iommu_irq_cache = NULL;
 
 	free_pages((unsigned long)amd_iommu_rlookup_table,
 		   get_order(rlookup_table_size));


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 38/39] iommu/amd: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: sergey.senozhatsky-Re5JQEeQqe8AvxtiuMwx3w,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>

---
 drivers/iommu/amd_iommu_init.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 5ef347a..5fb59cc 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -1755,11 +1755,8 @@ static void __init free_on_init_error(void)
 	free_pages((unsigned long)irq_lookup_table,
 		   get_order(rlookup_table_size));
 
-	if (amd_iommu_irq_cache) {
-		kmem_cache_destroy(amd_iommu_irq_cache);
-		amd_iommu_irq_cache = NULL;
-
-	}
+	kmem_cache_destroy(amd_iommu_irq_cache);
+	amd_iommu_irq_cache = NULL;
 
 	free_pages((unsigned long)amd_iommu_rlookup_table,
 		   get_order(rlookup_table_size));

^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 38/39] iommu/amd: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: sergey.senozhatsky-Re5JQEeQqe8AvxtiuMwx3w,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/iommu/amd_iommu_init.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 5ef347a..5fb59cc 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -1755,11 +1755,8 @@ static void __init free_on_init_error(void)
 	free_pages((unsigned long)irq_lookup_table,
 		   get_order(rlookup_table_size));
 
-	if (amd_iommu_irq_cache) {
-		kmem_cache_destroy(amd_iommu_irq_cache);
-		amd_iommu_irq_cache = NULL;
-
-	}
+	kmem_cache_destroy(amd_iommu_irq_cache);
+	amd_iommu_irq_cache = NULL;
 
 	free_pages((unsigned long)amd_iommu_rlookup_table,
 		   get_order(rlookup_table_size));


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 39/39] usb: host: drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
@ 2015-09-13 12:15   ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: sergey.senozhatsky, kernel-janitors, linux-usb, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);

@@
expression x;
@@

-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/host/fotg210-hcd.c  |   12 ++++--------
 drivers/usb/host/fusbh200-hcd.c |   12 ++++--------
 2 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c
index 000ed80..287d595 100644
--- a/drivers/usb/host/fotg210-hcd.c
+++ b/drivers/usb/host/fotg210-hcd.c
@@ -1976,17 +1976,13 @@ static void fotg210_mem_cleanup(struct fotg210_hcd *fotg210)
 	fotg210->dummy = NULL;
 
 	/* DMA consistent memory and pools */
-	if (fotg210->qtd_pool)
-		dma_pool_destroy(fotg210->qtd_pool);
+	dma_pool_destroy(fotg210->qtd_pool);
 	fotg210->qtd_pool = NULL;
 
-	if (fotg210->qh_pool) {
-		dma_pool_destroy(fotg210->qh_pool);
-		fotg210->qh_pool = NULL;
-	}
+	dma_pool_destroy(fotg210->qh_pool);
+	fotg210->qh_pool = NULL;
 
-	if (fotg210->itd_pool)
-		dma_pool_destroy(fotg210->itd_pool);
+	dma_pool_destroy(fotg210->itd_pool);
 	fotg210->itd_pool = NULL;
 
 	if (fotg210->periodic)
diff --git a/drivers/usb/host/fusbh200-hcd.c b/drivers/usb/host/fusbh200-hcd.c
index 1fd8718..b247d71 100644
--- a/drivers/usb/host/fusbh200-hcd.c
+++ b/drivers/usb/host/fusbh200-hcd.c
@@ -1927,17 +1927,13 @@ static void fusbh200_mem_cleanup (struct fusbh200_hcd *fusbh200)
 	fusbh200->dummy = NULL;
 
 	/* DMA consistent memory and pools */
-	if (fusbh200->qtd_pool)
-		dma_pool_destroy (fusbh200->qtd_pool);
+	dma_pool_destroy(fusbh200->qtd_pool);
 	fusbh200->qtd_pool = NULL;
 
-	if (fusbh200->qh_pool) {
-		dma_pool_destroy (fusbh200->qh_pool);
-		fusbh200->qh_pool = NULL;
-	}
+	dma_pool_destroy(fusbh200->qh_pool);
+	fusbh200->qh_pool = NULL;
 
-	if (fusbh200->itd_pool)
-		dma_pool_destroy (fusbh200->itd_pool);
+	dma_pool_destroy(fusbh200->itd_pool);
 	fusbh200->itd_pool = NULL;
 
 	if (fusbh200->periodic)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* [PATCH 39/39] usb: host: drop null test before destroy functions
@ 2015-09-13 12:15   ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-13 12:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: sergey.senozhatsky, kernel-janitors, linux-usb, linux-kernel

Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x;
@@

-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);

@@
expression x;
@@

-if (x != NULL) {
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
  x = NULL;
-}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/host/fotg210-hcd.c  |   12 ++++--------
 drivers/usb/host/fusbh200-hcd.c |   12 ++++--------
 2 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/fotg210-hcd.c b/drivers/usb/host/fotg210-hcd.c
index 000ed80..287d595 100644
--- a/drivers/usb/host/fotg210-hcd.c
+++ b/drivers/usb/host/fotg210-hcd.c
@@ -1976,17 +1976,13 @@ static void fotg210_mem_cleanup(struct fotg210_hcd *fotg210)
 	fotg210->dummy = NULL;
 
 	/* DMA consistent memory and pools */
-	if (fotg210->qtd_pool)
-		dma_pool_destroy(fotg210->qtd_pool);
+	dma_pool_destroy(fotg210->qtd_pool);
 	fotg210->qtd_pool = NULL;
 
-	if (fotg210->qh_pool) {
-		dma_pool_destroy(fotg210->qh_pool);
-		fotg210->qh_pool = NULL;
-	}
+	dma_pool_destroy(fotg210->qh_pool);
+	fotg210->qh_pool = NULL;
 
-	if (fotg210->itd_pool)
-		dma_pool_destroy(fotg210->itd_pool);
+	dma_pool_destroy(fotg210->itd_pool);
 	fotg210->itd_pool = NULL;
 
 	if (fotg210->periodic)
diff --git a/drivers/usb/host/fusbh200-hcd.c b/drivers/usb/host/fusbh200-hcd.c
index 1fd8718..b247d71 100644
--- a/drivers/usb/host/fusbh200-hcd.c
+++ b/drivers/usb/host/fusbh200-hcd.c
@@ -1927,17 +1927,13 @@ static void fusbh200_mem_cleanup (struct fusbh200_hcd *fusbh200)
 	fusbh200->dummy = NULL;
 
 	/* DMA consistent memory and pools */
-	if (fusbh200->qtd_pool)
-		dma_pool_destroy (fusbh200->qtd_pool);
+	dma_pool_destroy(fusbh200->qtd_pool);
 	fusbh200->qtd_pool = NULL;
 
-	if (fusbh200->qh_pool) {
-		dma_pool_destroy (fusbh200->qh_pool);
-		fusbh200->qh_pool = NULL;
-	}
+	dma_pool_destroy(fusbh200->qh_pool);
+	fusbh200->qh_pool = NULL;
 
-	if (fusbh200->itd_pool)
-		dma_pool_destroy (fusbh200->itd_pool);
+	dma_pool_destroy(fusbh200->itd_pool);
 	fusbh200->itd_pool = NULL;
 
 	if (fusbh200->periodic)


^ permalink raw reply related	[flat|nested] 163+ messages in thread

* Re: [PATCH 02/39] nilfs2: drop null test before destroy functions
  2015-09-13 12:14   ` Julia Lawall
  (?)
@ 2015-09-14  3:29     ` Ryusuke Konishi
  -1 siblings, 0 replies; 163+ messages in thread
From: Ryusuke Konishi @ 2015-09-14  3:29 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky, kernel-janitors, linux-nilfs, linux-kernel

On Sun, 13 Sep 2015 14:14:55 +0200, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Looks OK.  I'll queue this in my tree.

Thanks,
Ryusuke Konishi

> 
> ---
>  fs/nilfs2/super.c |   12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
> index f47585b..c69455a 100644
> --- a/fs/nilfs2/super.c
> +++ b/fs/nilfs2/super.c
> @@ -1405,14 +1405,10 @@ static void nilfs_destroy_cachep(void)
>  	 */
>  	rcu_barrier();
>  
> -	if (nilfs_inode_cachep)
> -		kmem_cache_destroy(nilfs_inode_cachep);
> -	if (nilfs_transaction_cachep)
> -		kmem_cache_destroy(nilfs_transaction_cachep);
> -	if (nilfs_segbuf_cachep)
> -		kmem_cache_destroy(nilfs_segbuf_cachep);
> -	if (nilfs_btree_path_cache)
> -		kmem_cache_destroy(nilfs_btree_path_cache);
> +	kmem_cache_destroy(nilfs_inode_cachep);
> +	kmem_cache_destroy(nilfs_transaction_cachep);
> +	kmem_cache_destroy(nilfs_segbuf_cachep);
> +	kmem_cache_destroy(nilfs_btree_path_cache);
>  }
>  
>  static int __init nilfs_init_cachep(void)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 02/39] nilfs2: drop null test before destroy functions
@ 2015-09-14  3:29     ` Ryusuke Konishi
  0 siblings, 0 replies; 163+ messages in thread
From: Ryusuke Konishi @ 2015-09-14  3:29 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky, kernel-janitors, linux-nilfs, linux-kernel

On Sun, 13 Sep 2015 14:14:55 +0200, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Looks OK.  I'll queue this in my tree.

Thanks,
Ryusuke Konishi

> 
> ---
>  fs/nilfs2/super.c |   12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
> index f47585b..c69455a 100644
> --- a/fs/nilfs2/super.c
> +++ b/fs/nilfs2/super.c
> @@ -1405,14 +1405,10 @@ static void nilfs_destroy_cachep(void)
>  	 */
>  	rcu_barrier();
>  
> -	if (nilfs_inode_cachep)
> -		kmem_cache_destroy(nilfs_inode_cachep);
> -	if (nilfs_transaction_cachep)
> -		kmem_cache_destroy(nilfs_transaction_cachep);
> -	if (nilfs_segbuf_cachep)
> -		kmem_cache_destroy(nilfs_segbuf_cachep);
> -	if (nilfs_btree_path_cache)
> -		kmem_cache_destroy(nilfs_btree_path_cache);
> +	kmem_cache_destroy(nilfs_inode_cachep);
> +	kmem_cache_destroy(nilfs_transaction_cachep);
> +	kmem_cache_destroy(nilfs_segbuf_cachep);
> +	kmem_cache_destroy(nilfs_btree_path_cache);
>  }
>  
>  static int __init nilfs_init_cachep(void)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 02/39] nilfs2: drop null test before destroy functions
@ 2015-09-14  3:29     ` Ryusuke Konishi
  0 siblings, 0 replies; 163+ messages in thread
From: Ryusuke Konishi @ 2015-09-14  3:29 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky-Re5JQEeQqe8AvxtiuMwx3w,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-nilfs-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Sun, 13 Sep 2015 14:14:55 +0200, Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org> wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>

Looks OK.  I'll queue this in my tree.

Thanks,
Ryusuke Konishi

> 
> ---
>  fs/nilfs2/super.c |   12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
> index f47585b..c69455a 100644
> --- a/fs/nilfs2/super.c
> +++ b/fs/nilfs2/super.c
> @@ -1405,14 +1405,10 @@ static void nilfs_destroy_cachep(void)
>  	 */
>  	rcu_barrier();
>  
> -	if (nilfs_inode_cachep)
> -		kmem_cache_destroy(nilfs_inode_cachep);
> -	if (nilfs_transaction_cachep)
> -		kmem_cache_destroy(nilfs_transaction_cachep);
> -	if (nilfs_segbuf_cachep)
> -		kmem_cache_destroy(nilfs_segbuf_cachep);
> -	if (nilfs_btree_path_cache)
> -		kmem_cache_destroy(nilfs_btree_path_cache);
> +	kmem_cache_destroy(nilfs_inode_cachep);
> +	kmem_cache_destroy(nilfs_transaction_cachep);
> +	kmem_cache_destroy(nilfs_segbuf_cachep);
> +	kmem_cache_destroy(nilfs_btree_path_cache);
>  }
>  
>  static int __init nilfs_init_cachep(void)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 31/39] KVM: MMU: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-14  8:30     ` Paolo Bonzini
  -1 siblings, 0 replies; 163+ messages in thread
From: Paolo Bonzini @ 2015-09-14  8:30 UTC (permalink / raw)
  To: Julia Lawall, Gleb Natapov
  Cc: sergey.senozhatsky, kernel-janitors, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, kvm, linux-kernel



On 13/09/2015 14:15, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  arch/x86/kvm/mmu.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index 69088a1..fb0c1bd 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -4883,10 +4883,8 @@ static struct shrinker mmu_shrinker = {
>  
>  static void mmu_destroy_caches(void)
>  {
> -	if (pte_list_desc_cache)
> -		kmem_cache_destroy(pte_list_desc_cache);
> -	if (mmu_page_header_cache)
> -		kmem_cache_destroy(mmu_page_header_cache);
> +	kmem_cache_destroy(pte_list_desc_cache);
> +	kmem_cache_destroy(mmu_page_header_cache);
>  }
>  
>  int kvm_mmu_module_init(void)
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 31/39] KVM: MMU: drop null test before destroy functions
@ 2015-09-14  8:30     ` Paolo Bonzini
  0 siblings, 0 replies; 163+ messages in thread
From: Paolo Bonzini @ 2015-09-14  8:30 UTC (permalink / raw)
  To: Julia Lawall, Gleb Natapov
  Cc: sergey.senozhatsky, kernel-janitors, Thomas Gleixner, Ingo Molnar,
	H. Peter Anvin, x86, kvm, linux-kernel



On 13/09/2015 14:15, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  arch/x86/kvm/mmu.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index 69088a1..fb0c1bd 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -4883,10 +4883,8 @@ static struct shrinker mmu_shrinker = {
>  
>  static void mmu_destroy_caches(void)
>  {
> -	if (pte_list_desc_cache)
> -		kmem_cache_destroy(pte_list_desc_cache);
> -	if (mmu_page_header_cache)
> -		kmem_cache_destroy(mmu_page_header_cache);
> +	kmem_cache_destroy(pte_list_desc_cache);
> +	kmem_cache_destroy(mmu_page_header_cache);
>  }
>  
>  int kvm_mmu_module_init(void)
> 

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 15/39] bcache: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-14  9:08     ` Johannes Thumshirn
  -1 siblings, 0 replies; 163+ messages in thread
From: Johannes Thumshirn @ 2015-09-14  9:08 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Kent Overstreet, sergey.senozhatsky, kernel-janitors, Neil Brown,
	linux-bcache, linux-raid, linux-kernel

Julia Lawall <Julia.Lawall@lip6.fr> writes:

> Remove unneeded NULL test.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

>
> ---
>  drivers/md/bcache/bset.c    |    3 +--
>  drivers/md/bcache/request.c |    3 +--
>  drivers/md/bcache/super.c   |    9 +++------
>  3 files changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
> index 8e9877b..bd4678c 100644
> --- a/drivers/md/bcache/request.c
> +++ b/drivers/md/bcache/request.c
> @@ -1145,8 +1145,7 @@ void bch_flash_dev_request_init(struct bcache_device *d)
>  
>  void bch_request_exit(void)
>  {
> -	if (bch_search_cache)
> -		kmem_cache_destroy(bch_search_cache);
> +	kmem_cache_destroy(bch_search_cache);
>  }
>  
>  int __init bch_request_init(void)
> diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
> index 646fe85..479117c 100644
> --- a/drivers/md/bcache/bset.c
> +++ b/drivers/md/bcache/bset.c
> @@ -1116,8 +1116,7 @@ struct bkey *bch_btree_iter_next_filter(struct btree_iter *iter,
>  
>  void bch_bset_sort_state_free(struct bset_sort_state *state)
>  {
> -	if (state->pool)
> -		mempool_destroy(state->pool);
> +	mempool_destroy(state->pool);
>  }
>  
>  int bch_bset_sort_state_init(struct bset_sort_state *state, unsigned page_order)
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index 679a093..c27a0ff 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -1335,12 +1335,9 @@ static void cache_set_free(struct closure *cl)
>  		destroy_workqueue(c->moving_gc_wq);
>  	if (c->bio_split)
>  		bioset_free(c->bio_split);
> -	if (c->fill_iter)
> -		mempool_destroy(c->fill_iter);
> -	if (c->bio_meta)
> -		mempool_destroy(c->bio_meta);
> -	if (c->search)
> -		mempool_destroy(c->search);
> +	mempool_destroy(c->fill_iter);
> +	mempool_destroy(c->bio_meta);
> +	mempool_destroy(c->search);
>  	kfree(c->devices);
>  
>  	mutex_lock(&bch_register_lock);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Johannes Thumshirn                                           Storage
jthumshirn@suse.de                                 +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600  D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 15/39] bcache: drop null test before destroy functions
@ 2015-09-14  9:08     ` Johannes Thumshirn
  0 siblings, 0 replies; 163+ messages in thread
From: Johannes Thumshirn @ 2015-09-14  9:08 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Kent Overstreet, sergey.senozhatsky, kernel-janitors, Neil Brown,
	linux-bcache, linux-raid, linux-kernel

Julia Lawall <Julia.Lawall@lip6.fr> writes:

> Remove unneeded NULL test.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

>
> ---
>  drivers/md/bcache/bset.c    |    3 +--
>  drivers/md/bcache/request.c |    3 +--
>  drivers/md/bcache/super.c   |    9 +++------
>  3 files changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
> index 8e9877b..bd4678c 100644
> --- a/drivers/md/bcache/request.c
> +++ b/drivers/md/bcache/request.c
> @@ -1145,8 +1145,7 @@ void bch_flash_dev_request_init(struct bcache_device *d)
>  
>  void bch_request_exit(void)
>  {
> -	if (bch_search_cache)
> -		kmem_cache_destroy(bch_search_cache);
> +	kmem_cache_destroy(bch_search_cache);
>  }
>  
>  int __init bch_request_init(void)
> diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
> index 646fe85..479117c 100644
> --- a/drivers/md/bcache/bset.c
> +++ b/drivers/md/bcache/bset.c
> @@ -1116,8 +1116,7 @@ struct bkey *bch_btree_iter_next_filter(struct btree_iter *iter,
>  
>  void bch_bset_sort_state_free(struct bset_sort_state *state)
>  {
> -	if (state->pool)
> -		mempool_destroy(state->pool);
> +	mempool_destroy(state->pool);
>  }
>  
>  int bch_bset_sort_state_init(struct bset_sort_state *state, unsigned page_order)
> diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
> index 679a093..c27a0ff 100644
> --- a/drivers/md/bcache/super.c
> +++ b/drivers/md/bcache/super.c
> @@ -1335,12 +1335,9 @@ static void cache_set_free(struct closure *cl)
>  		destroy_workqueue(c->moving_gc_wq);
>  	if (c->bio_split)
>  		bioset_free(c->bio_split);
> -	if (c->fill_iter)
> -		mempool_destroy(c->fill_iter);
> -	if (c->bio_meta)
> -		mempool_destroy(c->bio_meta);
> -	if (c->search)
> -		mempool_destroy(c->search);
> +	mempool_destroy(c->fill_iter);
> +	mempool_destroy(c->bio_meta);
> +	mempool_destroy(c->search);
>  	kfree(c->devices);
>  
>  	mutex_lock(&bch_register_lock);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Johannes Thumshirn                                           Storage
jthumshirn@suse.de                                 +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600  D0D0 0393 969D 2D76 0850

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 33/39] rbd: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-14  9:53     ` Ilya Dryomov
  -1 siblings, 0 replies; 163+ messages in thread
From: Ilya Dryomov @ 2015-09-14  9:53 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky, kernel-janitors, Sage Weil, Alex Elder,
	Ceph Development, linux-kernel@vger.kernel.org

On Sun, Sep 13, 2015 at 3:15 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> Remove unneeded NULL test.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@ expression x; @@
> -if (x != NULL) {
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>   x = NULL;
> -}
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
>  drivers/block/rbd.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index d93a037..0507246 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -5645,10 +5645,8 @@ static int rbd_slab_init(void)
>         if (rbd_segment_name_cache)
>                 return 0;
>  out_err:
> -       if (rbd_obj_request_cache) {
> -               kmem_cache_destroy(rbd_obj_request_cache);
> -               rbd_obj_request_cache = NULL;
> -       }
> +       kmem_cache_destroy(rbd_obj_request_cache);
> +       rbd_obj_request_cache = NULL;
>
>         kmem_cache_destroy(rbd_img_request_cache);
>         rbd_img_request_cache = NULL;

Applied.

Thanks,

                Ilya

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 33/39] rbd: drop null test before destroy functions
@ 2015-09-14  9:53     ` Ilya Dryomov
  0 siblings, 0 replies; 163+ messages in thread
From: Ilya Dryomov @ 2015-09-14  9:53 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky, kernel-janitors, Sage Weil, Alex Elder,
	Ceph Development, linux-kernel@vger.kernel.org

On Sun, Sep 13, 2015 at 3:15 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> Remove unneeded NULL test.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@ expression x; @@
> -if (x != NULL) {
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>   x = NULL;
> -}
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
>  drivers/block/rbd.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index d93a037..0507246 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -5645,10 +5645,8 @@ static int rbd_slab_init(void)
>         if (rbd_segment_name_cache)
>                 return 0;
>  out_err:
> -       if (rbd_obj_request_cache) {
> -               kmem_cache_destroy(rbd_obj_request_cache);
> -               rbd_obj_request_cache = NULL;
> -       }
> +       kmem_cache_destroy(rbd_obj_request_cache);
> +       rbd_obj_request_cache = NULL;
>
>         kmem_cache_destroy(rbd_img_request_cache);
>         rbd_img_request_cache = NULL;

Applied.

Thanks,

                Ilya

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/39] drop null test before destroy functions
  2015-09-13 12:14 ` Julia Lawall
                     ` (5 preceding siblings ...)
  (?)
@ 2015-09-14 11:55   ` SF Markus Elfring
  -1 siblings, 0 replies; 163+ messages in thread
From: SF Markus Elfring @ 2015-09-14 11:55 UTC (permalink / raw)
  To: Julia Lawall, kernel-janitors
  Cc: iommu, dccp, dri-devel, intel-gfx, ecryptfs, dmaengine,
	sergey.senozhatsky, Dan Williams, cluster-devel, intel-wired-lan,
	Mitch Williams, John Ronciak, Matthew Vick, Don Skidmore,
	Carolyn Wyborny, Shannon Nelson, Jesse Brandeburg, linux-nfs,
	linux-raid, netdev, linux-atm-general, linux-btrfs, linux-nilfs,
	linux-kernel, linux-mtd, linux-usb, linux-ext4, linux-rdma, devel,
	HPDD-discuss, linux-bcache, drbd-user, ocfs2-devel, kvm,
	ceph-devel, Chao Yu, linux-f2fs-devel

> Recent commits to kernel/git/torvalds/linux.git have made the following
> functions able to tolerate NULL arguments:
>
> kmem_cache_destroy (commit 3942d29918522)
> mempool_destroy (commit 4e3ca3e033d1)
> dma_pool_destroy (commit 44d7175da6ea)

How do you think about to extend an other SmPL script?

Related topic:
scripts/coccinelle/free: Delete NULL test before freeing functions
https://systeme.lip6.fr/pipermail/cocci/2015-May/001960.html
https://www.mail-archive.com/cocci@systeme.lip6.fr/msg01855.html


> If these changes are OK, I will address the remainder later.

Would anybody like to reuse my general SmPL approach for similar source
code clean-up?

Regards,
Markus

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/39] drop null test before destroy functions
@ 2015-09-14 11:55   ` SF Markus Elfring
  0 siblings, 0 replies; 163+ messages in thread
From: SF Markus Elfring @ 2015-09-14 11:55 UTC (permalink / raw)
  To: Julia Lawall, kernel-janitors
  Cc: iommu, dccp, dri-devel, intel-gfx, ecryptfs, dmaengine,
	sergey.senozhatsky, Dan Williams, cluster-devel, intel-wired-lan,
	Mitch Williams, John Ronciak, Matthew Vick, Don Skidmore,
	Carolyn Wyborny, Shannon Nelson, Jesse Brandeburg, linux-nfs,
	linux-raid, netdev, linux-atm-general, linux-btrfs, linux-nilfs,
	linux-kernel, linux-mtd, linux-usb, linux-ext4, linux-rdma, devel,
	HPDD-discuss, linux-bcache, drbd-user, ocfs2-devel, kvm,
	ceph-devel, Chao Yu, linux-f2fs-devel

> Recent commits to kernel/git/torvalds/linux.git have made the following
> functions able to tolerate NULL arguments:
>
> kmem_cache_destroy (commit 3942d29918522)
> mempool_destroy (commit 4e3ca3e033d1)
> dma_pool_destroy (commit 44d7175da6ea)

How do you think about to extend an other SmPL script?

Related topic:
scripts/coccinelle/free: Delete NULL test before freeing functions
https://systeme.lip6.fr/pipermail/cocci/2015-May/001960.html
https://www.mail-archive.com/cocci@systeme.lip6.fr/msg01855.html


> If these changes are OK, I will address the remainder later.

Would anybody like to reuse my general SmPL approach for similar source
code clean-up?

Regards,
Markus

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/39] drop null test before destroy functions
@ 2015-09-14 11:55   ` SF Markus Elfring
  0 siblings, 0 replies; 163+ messages in thread
From: SF Markus Elfring @ 2015-09-14 11:55 UTC (permalink / raw)
  To: Julia Lawall, kernel-janitors
  Cc: iommu, dccp, dri-devel, intel-gfx, ecryptfs, dmaengine,
	sergey.senozhatsky, Dan Williams, cluster-devel, intel-wired-lan,
	Mitch Williams, John Ronciak, Matthew Vick, Don Skidmore,
	Carolyn Wyborny, Shannon Nelson, Jesse Brandeburg, linux-nfs,
	linux-raid, netdev, linux-atm-general, linux-btrfs, linux-nilfs,
	linux-kernel, linux-mtd, linux-usb

> Recent commits to kernel/git/torvalds/linux.git have made the following
> functions able to tolerate NULL arguments:
>
> kmem_cache_destroy (commit 3942d29918522)
> mempool_destroy (commit 4e3ca3e033d1)
> dma_pool_destroy (commit 44d7175da6ea)

How do you think about to extend an other SmPL script?

Related topic:
scripts/coccinelle/free: Delete NULL test before freeing functions
https://systeme.lip6.fr/pipermail/cocci/2015-May/001960.html
https://www.mail-archive.com/cocci@systeme.lip6.fr/msg01855.html


> If these changes are OK, I will address the remainder later.

Would anybody like to reuse my general SmPL approach for similar source
code clean-up?

Regards,
Markus

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/39] drop null test before destroy functions
@ 2015-09-14 11:55   ` SF Markus Elfring
  0 siblings, 0 replies; 163+ messages in thread
From: SF Markus Elfring @ 2015-09-14 11:55 UTC (permalink / raw)
  To: Julia Lawall, kernel-janitors
  Cc: iommu, dccp, dri-devel, intel-gfx, ecryptfs, dmaengine,
	sergey.senozhatsky, Dan Williams, cluster-devel, intel-wired-lan,
	Mitch Williams, John Ronciak, Matthew Vick, Don Skidmore,
	Carolyn Wyborny, Shannon Nelson, Jesse Brandeburg, linux-nfs,
	linux-raid, netdev, linux-atm-general, linux-btrfs, linux-nilfs,
	linux-kernel, linux-mtd, linux-usb, linux

> Recent commits to kernel/git/torvalds/linux.git have made the following
> functions able to tolerate NULL arguments:
>
> kmem_cache_destroy (commit 3942d29918522)
> mempool_destroy (commit 4e3ca3e033d1)
> dma_pool_destroy (commit 44d7175da6ea)

How do you think about to extend an other SmPL script?

Related topic:
scripts/coccinelle/free: Delete NULL test before freeing functions
https://systeme.lip6.fr/pipermail/cocci/2015-May/001960.html
https://www.mail-archive.com/cocci@systeme.lip6.fr/msg01855.html


> If these changes are OK, I will address the remainder later.

Would anybody like to reuse my general SmPL approach for similar source
code clean-up?

Regards,
Markus

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/39] drop null test before destroy functions
@ 2015-09-14 11:55   ` SF Markus Elfring
  0 siblings, 0 replies; 163+ messages in thread
From: SF Markus Elfring @ 2015-09-14 11:55 UTC (permalink / raw)
  To: Julia Lawall, kernel-janitors
  Cc: iommu, dccp, dri-devel, intel-gfx, ecryptfs, dmaengine,
	sergey.senozhatsky, Dan Williams, cluster-devel, intel-wired-lan,
	Mitch Williams, John Ronciak, Matthew Vick, Don Skidmore,
	Carolyn Wyborny, Shannon Nelson, Jesse Brandeburg, linux-nfs,
	linux-raid, netdev, linux-atm-general, linux-btrfs, linux-nilfs,
	linux-kernel, linux-mtd, linux-usb

> Recent commits to kernel/git/torvalds/linux.git have made the following
> functions able to tolerate NULL arguments:
>
> kmem_cache_destroy (commit 3942d29918522)
> mempool_destroy (commit 4e3ca3e033d1)
> dma_pool_destroy (commit 44d7175da6ea)

How do you think about to extend an other SmPL script?

Related topic:
scripts/coccinelle/free: Delete NULL test before freeing functions
https://systeme.lip6.fr/pipermail/cocci/2015-May/001960.html
https://www.mail-archive.com/cocci@systeme.lip6.fr/msg01855.html


> If these changes are OK, I will address the remainder later.

Would anybody like to reuse my general SmPL approach for similar source
code clean-up?

Regards,
Markus

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [Intel-wired-lan] [PATCH 00/39] drop null test before destroy functions
@ 2015-09-14 11:55   ` SF Markus Elfring
  0 siblings, 0 replies; 163+ messages in thread
From: SF Markus Elfring @ 2015-09-14 11:55 UTC (permalink / raw)
  To: intel-wired-lan

> Recent commits to kernel/git/torvalds/linux.git have made the following
> functions able to tolerate NULL arguments:
>
> kmem_cache_destroy (commit 3942d29918522)
> mempool_destroy (commit 4e3ca3e033d1)
> dma_pool_destroy (commit 44d7175da6ea)

How do you think about to extend an other SmPL script?

Related topic:
scripts/coccinelle/free: Delete NULL test before freeing functions
https://systeme.lip6.fr/pipermail/cocci/2015-May/001960.html
https://www.mail-archive.com/cocci at systeme.lip6.fr/msg01855.html


> If these changes are OK, I will address the remainder later.

Would anybody like to reuse my general SmPL approach for similar source
code clean-up?

Regards,
Markus

^ permalink raw reply	[flat|nested] 163+ messages in thread

* [Cluster-devel] [PATCH 00/39] drop null test before destroy functions
@ 2015-09-14 11:55   ` SF Markus Elfring
  0 siblings, 0 replies; 163+ messages in thread
From: SF Markus Elfring @ 2015-09-14 11:55 UTC (permalink / raw)
  To: cluster-devel.redhat.com

> Recent commits to kernel/git/torvalds/linux.git have made the following
> functions able to tolerate NULL arguments:
>
> kmem_cache_destroy (commit 3942d29918522)
> mempool_destroy (commit 4e3ca3e033d1)
> dma_pool_destroy (commit 44d7175da6ea)

How do you think about to extend an other SmPL script?

Related topic:
scripts/coccinelle/free: Delete NULL test before freeing functions
https://systeme.lip6.fr/pipermail/cocci/2015-May/001960.html
https://www.mail-archive.com/cocci at systeme.lip6.fr/msg01855.html


> If these changes are OK, I will address the remainder later.

Would anybody like to reuse my general SmPL approach for similar source
code clean-up?

Regards,
Markus



^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 00/39] drop null test before destroy functions
@ 2015-09-14 11:55   ` SF Markus Elfring
  0 siblings, 0 replies; 163+ messages in thread
From: SF Markus Elfring @ 2015-09-14 11:55 UTC (permalink / raw)
  To: dccp

> Recent commits to kernel/git/torvalds/linux.git have made the following
> functions able to tolerate NULL arguments:
>
> kmem_cache_destroy (commit 3942d29918522)
> mempool_destroy (commit 4e3ca3e033d1)
> dma_pool_destroy (commit 44d7175da6ea)

How do you think about to extend an other SmPL script?

Related topic:
scripts/coccinelle/free: Delete NULL test before freeing functions
https://systeme.lip6.fr/pipermail/cocci/2015-May/001960.html
https://www.mail-archive.com/cocci@systeme.lip6.fr/msg01855.html


> If these changes are OK, I will address the remainder later.

Would anybody like to reuse my general SmPL approach for similar source
code clean-up?

Regards,
Markus

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [dm-devel] [PATCH 12/39] dm: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-14 13:46     ` Mikulas Patocka
  -1 siblings, 0 replies; 163+ messages in thread
From: Mikulas Patocka @ 2015-09-14 13:46 UTC (permalink / raw)
  To: device-mapper development
  Cc: Alasdair Kergon, Mike Snitzer, kernel-janitors, Neil Brown,
	linux-kernel, linux-raid, sergey.senozhatsky



On Sun, 13 Sep 2015, Julia Lawall wrote:

> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/md/dm-bufio.c              |    3 +--
>  drivers/md/dm-cache-target.c       |    3 +--
>  drivers/md/dm-crypt.c              |    6 ++----
>  drivers/md/dm-io.c                 |    3 +--
>  drivers/md/dm-log-userspace-base.c |    3 +--
>  drivers/md/dm-region-hash.c        |    4 +---
>  drivers/md/dm.c                    |   13 ++++---------
>  7 files changed, 11 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
> index 83cc52e..8ad39b6 100644
> --- a/drivers/md/dm-bufio.c
> +++ b/drivers/md/dm-bufio.c
> @@ -1864,8 +1864,7 @@ static void __exit dm_bufio_exit(void)
>  	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
>  		struct kmem_cache *kc = dm_bufio_caches[i];
>  
> -		if (kc)
> -			kmem_cache_destroy(kc);
> +		kmem_cache_destroy(kc);
>  	}

The variable here can be NULL. I don't know how did you conclude that it 
cannot. It seems that you didn't test the patch, if you did, you'd hit 
NULL pointer dereference here.

>  	for (i = 0; i < ARRAY_SIZE(dm_bufio_cache_names); i++)
> diff --git a/drivers/md/dm.c b/drivers/md/dm.c
> index 6264781..163de31 100644
> --- a/drivers/md/dm.c
> +++ b/drivers/md/dm.c
> @@ -2220,10 +2220,8 @@ static void cleanup_mapped_device(struct mapped_device *md)
>  		destroy_workqueue(md->wq);
>  	if (md->kworker_task)
>  		kthread_stop(md->kworker_task);
> -	if (md->io_pool)
> -		mempool_destroy(md->io_pool);
> -	if (md->rq_pool)
> -		mempool_destroy(md->rq_pool);
> +	mempool_destroy(md->io_pool);
> +	mempool_destroy(md->rq_pool);

Likewise, these variables can be NULL.

>  	if (md->bs)
>  		bioset_free(md->bs);
>  
> @@ -3508,11 +3506,8 @@ void dm_free_md_mempools(struct dm_md_mempools *pools)
>  	if (!pools)
>  		return;
>  
> -	if (pools->io_pool)
> -		mempool_destroy(pools->io_pool);
> -
> -	if (pools->rq_pool)
> -		mempool_destroy(pools->rq_pool);
> +	mempool_destroy(pools->io_pool);
> +	mempool_destroy(pools->rq_pool);
>  
>  	if (pools->bs)
>  		bioset_free(pools->bs);

Likewise, it can be NULL, see for example this code path:
                pools->io_pool = mempool_create_slab_pool(pool_size, cachep);
                if (!pools->io_pool)
                        goto out;
out:
        dm_free_md_mempools(pools);
dm_free_md_mempools:
        if (pools->io_pool)
                mempool_destroy(pools->io_pool);

It seems that you set up the cocinelle tool incorrectly, so that it 
produces many bogus suggestions.

Mikulas

> diff --git a/drivers/md/dm-log-userspace-base.c b/drivers/md/dm-log-userspace-base.c
> index 058256d..53b7b06 100644
> --- a/drivers/md/dm-log-userspace-base.c
> +++ b/drivers/md/dm-log-userspace-base.c
> @@ -313,8 +313,7 @@ static int userspace_ctr(struct dm_dirty_log *log, struct dm_target *ti,
>  out:
>  	kfree(devices_rdata);
>  	if (r) {
> -		if (lc->flush_entry_pool)
> -			mempool_destroy(lc->flush_entry_pool);
> +		mempool_destroy(lc->flush_entry_pool);
>  		kfree(lc);
>  		kfree(ctr_str);
>  	} else {
> diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c
> index 6f8e83b..81c5e1a 100644
> --- a/drivers/md/dm-io.c
> +++ b/drivers/md/dm-io.c
> @@ -65,8 +65,7 @@ struct dm_io_client *dm_io_client_create(void)
>  	return client;
>  
>     bad:
> -	if (client->pool)
> -		mempool_destroy(client->pool);
> +	mempool_destroy(client->pool);
>  	kfree(client);
>  	return ERR_PTR(-ENOMEM);
>  }
> diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
> index dd90d12..2fd4c82 100644
> --- a/drivers/md/dm-cache-target.c
> +++ b/drivers/md/dm-cache-target.c
> @@ -2309,8 +2309,7 @@ static void destroy(struct cache *cache)
>  {
>  	unsigned i;
>  
> -	if (cache->migration_pool)
> -		mempool_destroy(cache->migration_pool);
> +	mempool_destroy(cache->migration_pool);
>  
>  	if (cache->all_io_ds)
>  		dm_deferred_set_destroy(cache->all_io_ds);
> diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
> index d60c88d..cf91a96 100644
> --- a/drivers/md/dm-crypt.c
> +++ b/drivers/md/dm-crypt.c
> @@ -1543,10 +1543,8 @@ static void crypt_dtr(struct dm_target *ti)
>  	if (cc->bs)
>  		bioset_free(cc->bs);
>  
> -	if (cc->page_pool)
> -		mempool_destroy(cc->page_pool);
> -	if (cc->req_pool)
> -		mempool_destroy(cc->req_pool);
> +	mempool_destroy(cc->page_pool);
> +	mempool_destroy(cc->req_pool);
>  
>  	if (cc->iv_gen_ops && cc->iv_gen_ops->dtr)
>  		cc->iv_gen_ops->dtr(cc);
> diff --git a/drivers/md/dm-region-hash.c b/drivers/md/dm-region-hash.c
> index b929fd5..f3d608b 100644
> --- a/drivers/md/dm-region-hash.c
> +++ b/drivers/md/dm-region-hash.c
> @@ -249,9 +249,7 @@ void dm_region_hash_destroy(struct dm_region_hash *rh)
>  	if (rh->log)
>  		dm_dirty_log_destroy(rh->log);
>  
> -	if (rh->region_pool)
> -		mempool_destroy(rh->region_pool);
> -
> +	mempool_destroy(rh->region_pool);
>  	vfree(rh->buckets);
>  	kfree(rh);
>  }
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
> 

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [dm-devel] [PATCH 12/39] dm: drop null test before destroy functions
@ 2015-09-14 13:46     ` Mikulas Patocka
  0 siblings, 0 replies; 163+ messages in thread
From: Mikulas Patocka @ 2015-09-14 13:46 UTC (permalink / raw)
  To: device-mapper development
  Cc: Alasdair Kergon, Mike Snitzer, kernel-janitors, Neil Brown,
	linux-kernel, linux-raid, sergey.senozhatsky



On Sun, 13 Sep 2015, Julia Lawall wrote:

> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/md/dm-bufio.c              |    3 +--
>  drivers/md/dm-cache-target.c       |    3 +--
>  drivers/md/dm-crypt.c              |    6 ++----
>  drivers/md/dm-io.c                 |    3 +--
>  drivers/md/dm-log-userspace-base.c |    3 +--
>  drivers/md/dm-region-hash.c        |    4 +---
>  drivers/md/dm.c                    |   13 ++++---------
>  7 files changed, 11 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
> index 83cc52e..8ad39b6 100644
> --- a/drivers/md/dm-bufio.c
> +++ b/drivers/md/dm-bufio.c
> @@ -1864,8 +1864,7 @@ static void __exit dm_bufio_exit(void)
>  	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
>  		struct kmem_cache *kc = dm_bufio_caches[i];
>  
> -		if (kc)
> -			kmem_cache_destroy(kc);
> +		kmem_cache_destroy(kc);
>  	}

The variable here can be NULL. I don't know how did you conclude that it 
cannot. It seems that you didn't test the patch, if you did, you'd hit 
NULL pointer dereference here.

>  	for (i = 0; i < ARRAY_SIZE(dm_bufio_cache_names); i++)
> diff --git a/drivers/md/dm.c b/drivers/md/dm.c
> index 6264781..163de31 100644
> --- a/drivers/md/dm.c
> +++ b/drivers/md/dm.c
> @@ -2220,10 +2220,8 @@ static void cleanup_mapped_device(struct mapped_device *md)
>  		destroy_workqueue(md->wq);
>  	if (md->kworker_task)
>  		kthread_stop(md->kworker_task);
> -	if (md->io_pool)
> -		mempool_destroy(md->io_pool);
> -	if (md->rq_pool)
> -		mempool_destroy(md->rq_pool);
> +	mempool_destroy(md->io_pool);
> +	mempool_destroy(md->rq_pool);

Likewise, these variables can be NULL.

>  	if (md->bs)
>  		bioset_free(md->bs);
>  
> @@ -3508,11 +3506,8 @@ void dm_free_md_mempools(struct dm_md_mempools *pools)
>  	if (!pools)
>  		return;
>  
> -	if (pools->io_pool)
> -		mempool_destroy(pools->io_pool);
> -
> -	if (pools->rq_pool)
> -		mempool_destroy(pools->rq_pool);
> +	mempool_destroy(pools->io_pool);
> +	mempool_destroy(pools->rq_pool);
>  
>  	if (pools->bs)
>  		bioset_free(pools->bs);

Likewise, it can be NULL, see for example this code path:
                pools->io_pool = mempool_create_slab_pool(pool_size, cachep);
                if (!pools->io_pool)
                        goto out;
out:
        dm_free_md_mempools(pools);
dm_free_md_mempools:
        if (pools->io_pool)
                mempool_destroy(pools->io_pool);

It seems that you set up the cocinelle tool incorrectly, so that it 
produces many bogus suggestions.

Mikulas

> diff --git a/drivers/md/dm-log-userspace-base.c b/drivers/md/dm-log-userspace-base.c
> index 058256d..53b7b06 100644
> --- a/drivers/md/dm-log-userspace-base.c
> +++ b/drivers/md/dm-log-userspace-base.c
> @@ -313,8 +313,7 @@ static int userspace_ctr(struct dm_dirty_log *log, struct dm_target *ti,
>  out:
>  	kfree(devices_rdata);
>  	if (r) {
> -		if (lc->flush_entry_pool)
> -			mempool_destroy(lc->flush_entry_pool);
> +		mempool_destroy(lc->flush_entry_pool);
>  		kfree(lc);
>  		kfree(ctr_str);
>  	} else {
> diff --git a/drivers/md/dm-io.c b/drivers/md/dm-io.c
> index 6f8e83b..81c5e1a 100644
> --- a/drivers/md/dm-io.c
> +++ b/drivers/md/dm-io.c
> @@ -65,8 +65,7 @@ struct dm_io_client *dm_io_client_create(void)
>  	return client;
>  
>     bad:
> -	if (client->pool)
> -		mempool_destroy(client->pool);
> +	mempool_destroy(client->pool);
>  	kfree(client);
>  	return ERR_PTR(-ENOMEM);
>  }
> diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
> index dd90d12..2fd4c82 100644
> --- a/drivers/md/dm-cache-target.c
> +++ b/drivers/md/dm-cache-target.c
> @@ -2309,8 +2309,7 @@ static void destroy(struct cache *cache)
>  {
>  	unsigned i;
>  
> -	if (cache->migration_pool)
> -		mempool_destroy(cache->migration_pool);
> +	mempool_destroy(cache->migration_pool);
>  
>  	if (cache->all_io_ds)
>  		dm_deferred_set_destroy(cache->all_io_ds);
> diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
> index d60c88d..cf91a96 100644
> --- a/drivers/md/dm-crypt.c
> +++ b/drivers/md/dm-crypt.c
> @@ -1543,10 +1543,8 @@ static void crypt_dtr(struct dm_target *ti)
>  	if (cc->bs)
>  		bioset_free(cc->bs);
>  
> -	if (cc->page_pool)
> -		mempool_destroy(cc->page_pool);
> -	if (cc->req_pool)
> -		mempool_destroy(cc->req_pool);
> +	mempool_destroy(cc->page_pool);
> +	mempool_destroy(cc->req_pool);
>  
>  	if (cc->iv_gen_ops && cc->iv_gen_ops->dtr)
>  		cc->iv_gen_ops->dtr(cc);
> diff --git a/drivers/md/dm-region-hash.c b/drivers/md/dm-region-hash.c
> index b929fd5..f3d608b 100644
> --- a/drivers/md/dm-region-hash.c
> +++ b/drivers/md/dm-region-hash.c
> @@ -249,9 +249,7 @@ void dm_region_hash_destroy(struct dm_region_hash *rh)
>  	if (rh->log)
>  		dm_dirty_log_destroy(rh->log);
>  
> -	if (rh->region_pool)
> -		mempool_destroy(rh->region_pool);
> -
> +	mempool_destroy(rh->region_pool);
>  	vfree(rh->buckets);
>  	kfree(rh);
>  }
> 
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
> 

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 12/39] dm: drop null test before destroy functions
  2015-09-14 13:46     ` Mikulas Patocka
@ 2015-09-14 14:00       ` Mike Snitzer
  -1 siblings, 0 replies; 163+ messages in thread
From: Mike Snitzer @ 2015-09-14 14:00 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: device-mapper development, Alasdair Kergon, kernel-janitors,
	Neil Brown, linux-kernel, linux-raid, sergey.senozhatsky

On Mon, Sep 14 2015 at  9:46am -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:

> 
> 
> On Sun, 13 Sep 2015, Julia Lawall wrote:
> 
> > Remove unneeded NULL test.
> > 
> > The semantic patch that makes this change is as follows:
> > (http://coccinelle.lip6.fr/)
> > 
> > // <smpl>
> > @@ expression x; @@
> > -if (x != NULL)
> >   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> > // </smpl>
> > 
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > 
> > ---
> >  drivers/md/dm-bufio.c              |    3 +--
> >  drivers/md/dm-cache-target.c       |    3 +--
> >  drivers/md/dm-crypt.c              |    6 ++----
> >  drivers/md/dm-io.c                 |    3 +--
> >  drivers/md/dm-log-userspace-base.c |    3 +--
> >  drivers/md/dm-region-hash.c        |    4 +---
> >  drivers/md/dm.c                    |   13 ++++---------
> >  7 files changed, 11 insertions(+), 24 deletions(-)
> > 
> > diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
> > index 83cc52e..8ad39b6 100644
> > --- a/drivers/md/dm-bufio.c
> > +++ b/drivers/md/dm-bufio.c
> > @@ -1864,8 +1864,7 @@ static void __exit dm_bufio_exit(void)
> >  	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
> >  		struct kmem_cache *kc = dm_bufio_caches[i];
> >  
> > -		if (kc)
> > -			kmem_cache_destroy(kc);
> > +		kmem_cache_destroy(kc);
> >  	}
> 
> The variable here can be NULL. I don't know how did you conclude that it 
> cannot. It seems that you didn't test the patch, if you did, you'd hit 
> NULL pointer dereference here.

kmem_cache_destroy(), mempool_destroy(), etc all check for NULL and just
return.  So there is no need for the callers to check for NULL too.

Mike

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 12/39] dm: drop null test before destroy functions
@ 2015-09-14 14:00       ` Mike Snitzer
  0 siblings, 0 replies; 163+ messages in thread
From: Mike Snitzer @ 2015-09-14 14:00 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: device-mapper development, Alasdair Kergon, kernel-janitors,
	Neil Brown, linux-kernel, linux-raid, sergey.senozhatsky

On Mon, Sep 14 2015 at  9:46am -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:

> 
> 
> On Sun, 13 Sep 2015, Julia Lawall wrote:
> 
> > Remove unneeded NULL test.
> > 
> > The semantic patch that makes this change is as follows:
> > (http://coccinelle.lip6.fr/)
> > 
> > // <smpl>
> > @@ expression x; @@
> > -if (x != NULL)
> >   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> > // </smpl>
> > 
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > 
> > ---
> >  drivers/md/dm-bufio.c              |    3 +--
> >  drivers/md/dm-cache-target.c       |    3 +--
> >  drivers/md/dm-crypt.c              |    6 ++----
> >  drivers/md/dm-io.c                 |    3 +--
> >  drivers/md/dm-log-userspace-base.c |    3 +--
> >  drivers/md/dm-region-hash.c        |    4 +---
> >  drivers/md/dm.c                    |   13 ++++---------
> >  7 files changed, 11 insertions(+), 24 deletions(-)
> > 
> > diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
> > index 83cc52e..8ad39b6 100644
> > --- a/drivers/md/dm-bufio.c
> > +++ b/drivers/md/dm-bufio.c
> > @@ -1864,8 +1864,7 @@ static void __exit dm_bufio_exit(void)
> >  	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
> >  		struct kmem_cache *kc = dm_bufio_caches[i];
> >  
> > -		if (kc)
> > -			kmem_cache_destroy(kc);
> > +		kmem_cache_destroy(kc);
> >  	}
> 
> The variable here can be NULL. I don't know how did you conclude that it 
> cannot. It seems that you didn't test the patch, if you did, you'd hit 
> NULL pointer dereference here.

kmem_cache_destroy(), mempool_destroy(), etc all check for NULL and just
return.  So there is no need for the callers to check for NULL too.

Mike

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 12/39] dm: drop null test before destroy functions
  2015-09-14 14:00       ` Mike Snitzer
@ 2015-09-14 14:05         ` Mikulas Patocka
  -1 siblings, 0 replies; 163+ messages in thread
From: Mikulas Patocka @ 2015-09-14 14:05 UTC (permalink / raw)
  To: Mike Snitzer
  Cc: device-mapper development, Alasdair Kergon, kernel-janitors,
	Neil Brown, linux-kernel, linux-raid, sergey.senozhatsky



On Mon, 14 Sep 2015, Mike Snitzer wrote:

> On Mon, Sep 14 2015 at  9:46am -0400,
> Mikulas Patocka <mpatocka@redhat.com> wrote:
> 
> > 
> > 
> > On Sun, 13 Sep 2015, Julia Lawall wrote:
> > 
> > > Remove unneeded NULL test.
> > > 
> > > The semantic patch that makes this change is as follows:
> > > (http://coccinelle.lip6.fr/)
> > > 
> > > // <smpl>
> > > @@ expression x; @@
> > > -if (x != NULL)
> > >   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> > > // </smpl>
> > > 
> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > > 
> > > ---
> > >  drivers/md/dm-bufio.c              |    3 +--
> > >  drivers/md/dm-cache-target.c       |    3 +--
> > >  drivers/md/dm-crypt.c              |    6 ++----
> > >  drivers/md/dm-io.c                 |    3 +--
> > >  drivers/md/dm-log-userspace-base.c |    3 +--
> > >  drivers/md/dm-region-hash.c        |    4 +---
> > >  drivers/md/dm.c                    |   13 ++++---------
> > >  7 files changed, 11 insertions(+), 24 deletions(-)
> > > 
> > > diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
> > > index 83cc52e..8ad39b6 100644
> > > --- a/drivers/md/dm-bufio.c
> > > +++ b/drivers/md/dm-bufio.c
> > > @@ -1864,8 +1864,7 @@ static void __exit dm_bufio_exit(void)
> > >  	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
> > >  		struct kmem_cache *kc = dm_bufio_caches[i];
> > >  
> > > -		if (kc)
> > > -			kmem_cache_destroy(kc);
> > > +		kmem_cache_destroy(kc);
> > >  	}
> > 
> > The variable here can be NULL. I don't know how did you conclude that it 
> > cannot. It seems that you didn't test the patch, if you did, you'd hit 
> > NULL pointer dereference here.
> 
> kmem_cache_destroy(), mempool_destroy(), etc all check for NULL and just
> return.  So there is no need for the callers to check for NULL too.
> 
> Mike

I see. It was recent change that I missed.

Mikulas

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 12/39] dm: drop null test before destroy functions
@ 2015-09-14 14:05         ` Mikulas Patocka
  0 siblings, 0 replies; 163+ messages in thread
From: Mikulas Patocka @ 2015-09-14 14:05 UTC (permalink / raw)
  To: Mike Snitzer
  Cc: device-mapper development, Alasdair Kergon, kernel-janitors,
	Neil Brown, linux-kernel, linux-raid, sergey.senozhatsky



On Mon, 14 Sep 2015, Mike Snitzer wrote:

> On Mon, Sep 14 2015 at  9:46am -0400,
> Mikulas Patocka <mpatocka@redhat.com> wrote:
> 
> > 
> > 
> > On Sun, 13 Sep 2015, Julia Lawall wrote:
> > 
> > > Remove unneeded NULL test.
> > > 
> > > The semantic patch that makes this change is as follows:
> > > (http://coccinelle.lip6.fr/)
> > > 
> > > // <smpl>
> > > @@ expression x; @@
> > > -if (x != NULL)
> > >   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> > > // </smpl>
> > > 
> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > > 
> > > ---
> > >  drivers/md/dm-bufio.c              |    3 +--
> > >  drivers/md/dm-cache-target.c       |    3 +--
> > >  drivers/md/dm-crypt.c              |    6 ++----
> > >  drivers/md/dm-io.c                 |    3 +--
> > >  drivers/md/dm-log-userspace-base.c |    3 +--
> > >  drivers/md/dm-region-hash.c        |    4 +---
> > >  drivers/md/dm.c                    |   13 ++++---------
> > >  7 files changed, 11 insertions(+), 24 deletions(-)
> > > 
> > > diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
> > > index 83cc52e..8ad39b6 100644
> > > --- a/drivers/md/dm-bufio.c
> > > +++ b/drivers/md/dm-bufio.c
> > > @@ -1864,8 +1864,7 @@ static void __exit dm_bufio_exit(void)
> > >  	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
> > >  		struct kmem_cache *kc = dm_bufio_caches[i];
> > >  
> > > -		if (kc)
> > > -			kmem_cache_destroy(kc);
> > > +		kmem_cache_destroy(kc);
> > >  	}
> > 
> > The variable here can be NULL. I don't know how did you conclude that it 
> > cannot. It seems that you didn't test the patch, if you did, you'd hit 
> > NULL pointer dereference here.
> 
> kmem_cache_destroy(), mempool_destroy(), etc all check for NULL and just
> return.  So there is no need for the callers to check for NULL too.
> 
> Mike

I see. It was recent change that I missed.

Mikulas

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [dm-devel] [PATCH 12/39] dm: drop null test before destroy functions
  2015-09-14 13:46     ` Mikulas Patocka
@ 2015-09-14 14:23       ` walter harms
  -1 siblings, 0 replies; 163+ messages in thread
From: walter harms @ 2015-09-14 14:23 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: device-mapper development, Alasdair Kergon, Mike Snitzer,
	kernel-janitors, Neil Brown, linux-kernel, linux-raid,
	sergey.senozhatsky



Am 14.09.2015 15:46, schrieb Mikulas Patocka:
> 
> On Sun, 13 Sep 2015, Julia Lawall wrote:
> 
>> > Remove unneeded NULL test.
>> > 
>> > The semantic patch that makes this change is as follows:
>> > (http://coccinelle.lip6.fr/)
>> > 
>> > // <smpl>
>> > @@ expression x; @@
>> > -if (x != NULL)
>> >   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>> > // </smpl>
>> > 
>> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>> > 
>> > ---
>> >  drivers/md/dm-bufio.c              |    3 +--
>> >  drivers/md/dm-cache-target.c       |    3 +--
>> >  drivers/md/dm-crypt.c              |    6 ++----
>> >  drivers/md/dm-io.c                 |    3 +--
>> >  drivers/md/dm-log-userspace-base.c |    3 +--
>> >  drivers/md/dm-region-hash.c        |    4 +---
>> >  drivers/md/dm.c                    |   13 ++++---------
>> >  7 files changed, 11 insertions(+), 24 deletions(-)
>> > 
>> > diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
>> > index 83cc52e..8ad39b6 100644
>> > --- a/drivers/md/dm-bufio.c
>> > +++ b/drivers/md/dm-bufio.c
>> > @@ -1864,8 +1864,7 @@ static void __exit dm_bufio_exit(void)
>> >  	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
>> >  		struct kmem_cache *kc = dm_bufio_caches[i];
>> >  
>> > -		if (kc)
>> > -			kmem_cache_destroy(kc);
>> > +		kmem_cache_destroy(kc);
>> >  	}


maybe you want to remove "kc" also
by calling kmem_cache_destroy(dm_bufio_caches[i]); directly ?

just a hint,
 wh




^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [dm-devel] [PATCH 12/39] dm: drop null test before destroy functions
@ 2015-09-14 14:23       ` walter harms
  0 siblings, 0 replies; 163+ messages in thread
From: walter harms @ 2015-09-14 14:23 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: device-mapper development, Alasdair Kergon, Mike Snitzer,
	kernel-janitors, Neil Brown, linux-kernel, linux-raid,
	sergey.senozhatsky



Am 14.09.2015 15:46, schrieb Mikulas Patocka:
> 
> On Sun, 13 Sep 2015, Julia Lawall wrote:
> 
>> > Remove unneeded NULL test.
>> > 
>> > The semantic patch that makes this change is as follows:
>> > (http://coccinelle.lip6.fr/)
>> > 
>> > // <smpl>
>> > @@ expression x; @@
>> > -if (x != NULL)
>> >   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>> > // </smpl>
>> > 
>> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>> > 
>> > ---
>> >  drivers/md/dm-bufio.c              |    3 +--
>> >  drivers/md/dm-cache-target.c       |    3 +--
>> >  drivers/md/dm-crypt.c              |    6 ++----
>> >  drivers/md/dm-io.c                 |    3 +--
>> >  drivers/md/dm-log-userspace-base.c |    3 +--
>> >  drivers/md/dm-region-hash.c        |    4 +---
>> >  drivers/md/dm.c                    |   13 ++++---------
>> >  7 files changed, 11 insertions(+), 24 deletions(-)
>> > 
>> > diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
>> > index 83cc52e..8ad39b6 100644
>> > --- a/drivers/md/dm-bufio.c
>> > +++ b/drivers/md/dm-bufio.c
>> > @@ -1864,8 +1864,7 @@ static void __exit dm_bufio_exit(void)
>> >  	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
>> >  		struct kmem_cache *kc = dm_bufio_caches[i];
>> >  
>> > -		if (kc)
>> > -			kmem_cache_destroy(kc);
>> > +		kmem_cache_destroy(kc);
>> >  	}


maybe you want to remove "kc" also
by calling kmem_cache_destroy(dm_bufio_caches[i]); directly ?

just a hint,
 wh




^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 22/39] nfsd: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-14 16:06     ` J. Bruce Fields
  -1 siblings, 0 replies; 163+ messages in thread
From: J. Bruce Fields @ 2015-09-14 16:06 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky, kernel-janitors, Jeff Layton, linux-nfs,
	linux-kernel

Thanks, applying.--b.

On Sun, Sep 13, 2015 at 02:15:15PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL) {
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>   x = NULL;
> -}
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  fs/nfsd/nfscache.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
> index 46ec934..116940c 100644
> --- a/fs/nfsd/nfscache.c
> +++ b/fs/nfsd/nfscache.c
> @@ -217,10 +217,8 @@ void nfsd_reply_cache_shutdown(void)
>  	drc_hashtbl = NULL;
>  	drc_hashsize = 0;
>  
> -	if (drc_slab) {
> -		kmem_cache_destroy(drc_slab);
> -		drc_slab = NULL;
> -	}
> +	kmem_cache_destroy(drc_slab);
> +	drc_slab = NULL;
>  }
>  
>  /*

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 22/39] nfsd: drop null test before destroy functions
@ 2015-09-14 16:06     ` J. Bruce Fields
  0 siblings, 0 replies; 163+ messages in thread
From: J. Bruce Fields @ 2015-09-14 16:06 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky, kernel-janitors, Jeff Layton, linux-nfs,
	linux-kernel

Thanks, applying.--b.

On Sun, Sep 13, 2015 at 02:15:15PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL) {
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>   x = NULL;
> -}
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  fs/nfsd/nfscache.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/nfsd/nfscache.c b/fs/nfsd/nfscache.c
> index 46ec934..116940c 100644
> --- a/fs/nfsd/nfscache.c
> +++ b/fs/nfsd/nfscache.c
> @@ -217,10 +217,8 @@ void nfsd_reply_cache_shutdown(void)
>  	drc_hashtbl = NULL;
>  	drc_hashsize = 0;
>  
> -	if (drc_slab) {
> -		kmem_cache_destroy(drc_slab);
> -		drc_slab = NULL;
> -	}
> +	kmem_cache_destroy(drc_slab);
> +	drc_slab = NULL;
>  }
>  
>  /*

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 14/39] SUNRPC: drop null test before destroy functions
@ 2015-09-14 16:07     ` J. Bruce Fields
  0 siblings, 0 replies; 163+ messages in thread
From: J. Bruce Fields @ 2015-09-14 16:07 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky, kernel-janitors, Jeff Layton, Trond Myklebust,
	Anna Schumaker, David S. Miller, linux-nfs, netdev, linux-kernel

ACK, but assuming Trond takes this one.--b.

On Sun, Sep 13, 2015 at 02:15:07PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  net/sunrpc/sched.c |   12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
> index b140c09..425ca2f 100644
> --- a/net/sunrpc/sched.c
> +++ b/net/sunrpc/sched.c
> @@ -1092,14 +1092,10 @@ void
>  rpc_destroy_mempool(void)
>  {
>  	rpciod_stop();
> -	if (rpc_buffer_mempool)
> -		mempool_destroy(rpc_buffer_mempool);
> -	if (rpc_task_mempool)
> -		mempool_destroy(rpc_task_mempool);
> -	if (rpc_task_slabp)
> -		kmem_cache_destroy(rpc_task_slabp);
> -	if (rpc_buffer_slabp)
> -		kmem_cache_destroy(rpc_buffer_slabp);
> +	mempool_destroy(rpc_buffer_mempool);
> +	mempool_destroy(rpc_task_mempool);
> +	kmem_cache_destroy(rpc_task_slabp);
> +	kmem_cache_destroy(rpc_buffer_slabp);
>  	rpc_destroy_wait_queue(&delay_queue);
>  }
>  

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 14/39] SUNRPC: drop null test before destroy functions
@ 2015-09-14 16:07     ` J. Bruce Fields
  0 siblings, 0 replies; 163+ messages in thread
From: J. Bruce Fields @ 2015-09-14 16:07 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky-Re5JQEeQqe8AvxtiuMwx3w,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA, Jeff Layton,
	Trond Myklebust, Anna Schumaker, David S. Miller,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

ACK, but assuming Trond takes this one.--b.

On Sun, Sep 13, 2015 at 02:15:07PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall-L2FTfq7BK8M@public.gmane.org>
> 
> ---
>  net/sunrpc/sched.c |   12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
> index b140c09..425ca2f 100644
> --- a/net/sunrpc/sched.c
> +++ b/net/sunrpc/sched.c
> @@ -1092,14 +1092,10 @@ void
>  rpc_destroy_mempool(void)
>  {
>  	rpciod_stop();
> -	if (rpc_buffer_mempool)
> -		mempool_destroy(rpc_buffer_mempool);
> -	if (rpc_task_mempool)
> -		mempool_destroy(rpc_task_mempool);
> -	if (rpc_task_slabp)
> -		kmem_cache_destroy(rpc_task_slabp);
> -	if (rpc_buffer_slabp)
> -		kmem_cache_destroy(rpc_buffer_slabp);
> +	mempool_destroy(rpc_buffer_mempool);
> +	mempool_destroy(rpc_task_mempool);
> +	kmem_cache_destroy(rpc_task_slabp);
> +	kmem_cache_destroy(rpc_buffer_slabp);
>  	rpc_destroy_wait_queue(&delay_queue);
>  }
>  
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 14/39] SUNRPC: drop null test before destroy functions
@ 2015-09-14 16:07     ` J. Bruce Fields
  0 siblings, 0 replies; 163+ messages in thread
From: J. Bruce Fields @ 2015-09-14 16:07 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky, kernel-janitors, Jeff Layton, Trond Myklebust,
	Anna Schumaker, David S. Miller, linux-nfs, netdev, linux-kernel

ACK, but assuming Trond takes this one.--b.

On Sun, Sep 13, 2015 at 02:15:07PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  net/sunrpc/sched.c |   12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
> index b140c09..425ca2f 100644
> --- a/net/sunrpc/sched.c
> +++ b/net/sunrpc/sched.c
> @@ -1092,14 +1092,10 @@ void
>  rpc_destroy_mempool(void)
>  {
>  	rpciod_stop();
> -	if (rpc_buffer_mempool)
> -		mempool_destroy(rpc_buffer_mempool);
> -	if (rpc_task_mempool)
> -		mempool_destroy(rpc_task_mempool);
> -	if (rpc_task_slabp)
> -		kmem_cache_destroy(rpc_task_slabp);
> -	if (rpc_buffer_slabp)
> -		kmem_cache_destroy(rpc_buffer_slabp);
> +	mempool_destroy(rpc_buffer_mempool);
> +	mempool_destroy(rpc_task_mempool);
> +	kmem_cache_destroy(rpc_task_slabp);
> +	kmem_cache_destroy(rpc_buffer_slabp);
>  	rpc_destroy_wait_queue(&delay_queue);
>  }
>  

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 14/39] SUNRPC: drop null test before destroy functions
  2015-09-14 16:07     ` J. Bruce Fields
@ 2015-09-14 16:25       ` Trond Myklebust
  -1 siblings, 0 replies; 163+ messages in thread
From: Trond Myklebust @ 2015-09-14 16:25 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Julia Lawall, sergey.senozhatsky, Kernel Janitors Mailing List,
	Jeff Layton, Anna Schumaker, David S. Miller,
	Linux NFS Mailing List, Linux Network Devel Mailing List,
	Linux Kernel Mailing List

On Mon, Sep 14, 2015 at 12:07 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> ACK, but assuming Trond takes this one.--b.

No problem. I'll pick it up...

Cheers
  Trond

> On Sun, Sep 13, 2015 at 02:15:07PM +0200, Julia Lawall wrote:
>> Remove unneeded NULL test.
>>
>> The semantic patch that makes this change is as follows:
>> (http://coccinelle.lip6.fr/)
>>
>> // <smpl>
>> @@ expression x; @@
>> -if (x != NULL)
>>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>> // </smpl>
>>
>> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>>
>> ---
>>  net/sunrpc/sched.c |   12 ++++--------
>>  1 file changed, 4 insertions(+), 8 deletions(-)
>>
>> diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
>> index b140c09..425ca2f 100644
>> --- a/net/sunrpc/sched.c
>> +++ b/net/sunrpc/sched.c
>> @@ -1092,14 +1092,10 @@ void
>>  rpc_destroy_mempool(void)
>>  {
>>       rpciod_stop();
>> -     if (rpc_buffer_mempool)
>> -             mempool_destroy(rpc_buffer_mempool);
>> -     if (rpc_task_mempool)
>> -             mempool_destroy(rpc_task_mempool);
>> -     if (rpc_task_slabp)
>> -             kmem_cache_destroy(rpc_task_slabp);
>> -     if (rpc_buffer_slabp)
>> -             kmem_cache_destroy(rpc_buffer_slabp);
>> +     mempool_destroy(rpc_buffer_mempool);
>> +     mempool_destroy(rpc_task_mempool);
>> +     kmem_cache_destroy(rpc_task_slabp);
>> +     kmem_cache_destroy(rpc_buffer_slabp);
>>       rpc_destroy_wait_queue(&delay_queue);
>>  }
>>

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 14/39] SUNRPC: drop null test before destroy functions
@ 2015-09-14 16:25       ` Trond Myklebust
  0 siblings, 0 replies; 163+ messages in thread
From: Trond Myklebust @ 2015-09-14 16:25 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: Julia Lawall, sergey.senozhatsky, Kernel Janitors Mailing List,
	Jeff Layton, Anna Schumaker, David S. Miller,
	Linux NFS Mailing List, Linux Network Devel Mailing List,
	Linux Kernel Mailing List

On Mon, Sep 14, 2015 at 12:07 PM, J. Bruce Fields <bfields@fieldses.org> wrote:
> ACK, but assuming Trond takes this one.--b.

No problem. I'll pick it up...

Cheers
  Trond

> On Sun, Sep 13, 2015 at 02:15:07PM +0200, Julia Lawall wrote:
>> Remove unneeded NULL test.
>>
>> The semantic patch that makes this change is as follows:
>> (http://coccinelle.lip6.fr/)
>>
>> // <smpl>
>> @@ expression x; @@
>> -if (x != NULL)
>>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>> // </smpl>
>>
>> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>>
>> ---
>>  net/sunrpc/sched.c |   12 ++++--------
>>  1 file changed, 4 insertions(+), 8 deletions(-)
>>
>> diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
>> index b140c09..425ca2f 100644
>> --- a/net/sunrpc/sched.c
>> +++ b/net/sunrpc/sched.c
>> @@ -1092,14 +1092,10 @@ void
>>  rpc_destroy_mempool(void)
>>  {
>>       rpciod_stop();
>> -     if (rpc_buffer_mempool)
>> -             mempool_destroy(rpc_buffer_mempool);
>> -     if (rpc_task_mempool)
>> -             mempool_destroy(rpc_task_mempool);
>> -     if (rpc_task_slabp)
>> -             kmem_cache_destroy(rpc_task_slabp);
>> -     if (rpc_buffer_slabp)
>> -             kmem_cache_destroy(rpc_buffer_slabp);
>> +     mempool_destroy(rpc_buffer_mempool);
>> +     mempool_destroy(rpc_task_mempool);
>> +     kmem_cache_destroy(rpc_task_slabp);
>> +     kmem_cache_destroy(rpc_buffer_slabp);
>>       rpc_destroy_wait_queue(&delay_queue);
>>  }
>>

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 12/39] dm: drop null test before destroy functions
  2015-09-14 14:05         ` Mikulas Patocka
@ 2015-09-14 18:50           ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-14 18:50 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: Mike Snitzer, device-mapper development, Alasdair Kergon,
	kernel-janitors, Neil Brown, linux-kernel, linux-raid,
	sergey.senozhatsky



On Mon, 14 Sep 2015, Mikulas Patocka wrote:

> 
> 
> On Mon, 14 Sep 2015, Mike Snitzer wrote:
> 
> > On Mon, Sep 14 2015 at  9:46am -0400,
> > Mikulas Patocka <mpatocka@redhat.com> wrote:
> > 
> > > 
> > > 
> > > On Sun, 13 Sep 2015, Julia Lawall wrote:
> > > 
> > > > Remove unneeded NULL test.
> > > > 
> > > > The semantic patch that makes this change is as follows:
> > > > (http://coccinelle.lip6.fr/)
> > > > 
> > > > // <smpl>
> > > > @@ expression x; @@
> > > > -if (x != NULL)
> > > >   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> > > > // </smpl>
> > > > 
> > > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > > > 
> > > > ---
> > > >  drivers/md/dm-bufio.c              |    3 +--
> > > >  drivers/md/dm-cache-target.c       |    3 +--
> > > >  drivers/md/dm-crypt.c              |    6 ++----
> > > >  drivers/md/dm-io.c                 |    3 +--
> > > >  drivers/md/dm-log-userspace-base.c |    3 +--
> > > >  drivers/md/dm-region-hash.c        |    4 +---
> > > >  drivers/md/dm.c                    |   13 ++++---------
> > > >  7 files changed, 11 insertions(+), 24 deletions(-)
> > > > 
> > > > diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
> > > > index 83cc52e..8ad39b6 100644
> > > > --- a/drivers/md/dm-bufio.c
> > > > +++ b/drivers/md/dm-bufio.c
> > > > @@ -1864,8 +1864,7 @@ static void __exit dm_bufio_exit(void)
> > > >  	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
> > > >  		struct kmem_cache *kc = dm_bufio_caches[i];
> > > >  
> > > > -		if (kc)
> > > > -			kmem_cache_destroy(kc);
> > > > +		kmem_cache_destroy(kc);
> > > >  	}
> > > 
> > > The variable here can be NULL. I don't know how did you conclude that it 
> > > cannot. It seems that you didn't test the patch, if you did, you'd hit 
> > > NULL pointer dereference here.
> > 
> > kmem_cache_destroy(), mempool_destroy(), etc all check for NULL and just
> > return.  So there is no need for the callers to check for NULL too.
> > 
> > Mike
> 
> I see. It was recent change that I missed.

The relevant commits were in the cover letter:

kmem_cache_destroy (commit 3942d29918522)
mempool_destroy (commit 4e3ca3e033d1)
dma_pool_destroy (commit 44d7175da6ea)

julia

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 12/39] dm: drop null test before destroy functions
@ 2015-09-14 18:50           ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-14 18:50 UTC (permalink / raw)
  To: Mikulas Patocka
  Cc: Mike Snitzer, device-mapper development, Alasdair Kergon,
	kernel-janitors, Neil Brown, linux-kernel, linux-raid,
	sergey.senozhatsky



On Mon, 14 Sep 2015, Mikulas Patocka wrote:

> 
> 
> On Mon, 14 Sep 2015, Mike Snitzer wrote:
> 
> > On Mon, Sep 14 2015 at  9:46am -0400,
> > Mikulas Patocka <mpatocka@redhat.com> wrote:
> > 
> > > 
> > > 
> > > On Sun, 13 Sep 2015, Julia Lawall wrote:
> > > 
> > > > Remove unneeded NULL test.
> > > > 
> > > > The semantic patch that makes this change is as follows:
> > > > (http://coccinelle.lip6.fr/)
> > > > 
> > > > // <smpl>
> > > > @@ expression x; @@
> > > > -if (x != NULL)
> > > >   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> > > > // </smpl>
> > > > 
> > > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > > > 
> > > > ---
> > > >  drivers/md/dm-bufio.c              |    3 +--
> > > >  drivers/md/dm-cache-target.c       |    3 +--
> > > >  drivers/md/dm-crypt.c              |    6 ++----
> > > >  drivers/md/dm-io.c                 |    3 +--
> > > >  drivers/md/dm-log-userspace-base.c |    3 +--
> > > >  drivers/md/dm-region-hash.c        |    4 +---
> > > >  drivers/md/dm.c                    |   13 ++++---------
> > > >  7 files changed, 11 insertions(+), 24 deletions(-)
> > > > 
> > > > diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
> > > > index 83cc52e..8ad39b6 100644
> > > > --- a/drivers/md/dm-bufio.c
> > > > +++ b/drivers/md/dm-bufio.c
> > > > @@ -1864,8 +1864,7 @@ static void __exit dm_bufio_exit(void)
> > > >  	for (i = 0; i < ARRAY_SIZE(dm_bufio_caches); i++) {
> > > >  		struct kmem_cache *kc = dm_bufio_caches[i];
> > > >  
> > > > -		if (kc)
> > > > -			kmem_cache_destroy(kc);
> > > > +		kmem_cache_destroy(kc);
> > > >  	}
> > > 
> > > The variable here can be NULL. I don't know how did you conclude that it 
> > > cannot. It seems that you didn't test the patch, if you did, you'd hit 
> > > NULL pointer dereference here.
> > 
> > kmem_cache_destroy(), mempool_destroy(), etc all check for NULL and just
> > return.  So there is no need for the callers to check for NULL too.
> > 
> > Mike
> 
> I see. It was recent change that I missed.

The relevant commits were in the cover letter:

kmem_cache_destroy (commit 3942d29918522)
mempool_destroy (commit 4e3ca3e033d1)
dma_pool_destroy (commit 44d7175da6ea)

julia

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 06/39] Btrfs: drop null test before destroy functions
  2015-09-13 12:14   ` Julia Lawall
@ 2015-09-14 20:43     ` David Sterba
  -1 siblings, 0 replies; 163+ messages in thread
From: David Sterba @ 2015-09-14 20:43 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Chris Mason, sergey.senozhatsky, kernel-janitors, Josef Bacik,
	David Sterba, linux-btrfs, linux-kernel

On Sun, Sep 13, 2015 at 02:14:59PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: David Sterba <dsterba@suse.com>

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 06/39] Btrfs: drop null test before destroy functions
@ 2015-09-14 20:43     ` David Sterba
  0 siblings, 0 replies; 163+ messages in thread
From: David Sterba @ 2015-09-14 20:43 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Chris Mason, sergey.senozhatsky, kernel-janitors, Josef Bacik,
	David Sterba, linux-btrfs, linux-kernel

On Sun, Sep 13, 2015 at 02:14:59PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: David Sterba <dsterba@suse.com>

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 09/39] aoe: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-15  1:39     ` Ed Cashin
  -1 siblings, 0 replies; 163+ messages in thread
From: Ed Cashin @ 2015-09-15  1:39 UTC (permalink / raw)
  To: Julia Lawall; +Cc: sergey.senozhatsky, kernel-janitors, linux-kernel

ACK.  Thanks.

On 09/13/2015 08:15 AM, Julia Lawall wrote:
> Remove unneeded NULL test.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>    \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
>   drivers/block/aoe/aoedev.c |    3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
> index ffd1947..efc8a8a 100644
> --- a/drivers/block/aoe/aoedev.c
> +++ b/drivers/block/aoe/aoedev.c
> @@ -285,8 +285,7 @@ freedev(struct aoedev *d)
>   	e = t + d->ntargets;
>   	for (; t < e && *t; t++)
>   		freetgt(d, *t);
> -	if (d->bufpool)
> -		mempool_destroy(d->bufpool);
> +	mempool_destroy(d->bufpool);
>   	skbpoolfree(d);
>   	minor_free(d->sysminor);
>   
>


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 09/39] aoe: drop null test before destroy functions
@ 2015-09-15  1:39     ` Ed Cashin
  0 siblings, 0 replies; 163+ messages in thread
From: Ed Cashin @ 2015-09-15  1:39 UTC (permalink / raw)
  To: Julia Lawall; +Cc: sergey.senozhatsky, kernel-janitors, linux-kernel

ACK.  Thanks.

On 09/13/2015 08:15 AM, Julia Lawall wrote:
> Remove unneeded NULL test.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>    \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
>   drivers/block/aoe/aoedev.c |    3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
> index ffd1947..efc8a8a 100644
> --- a/drivers/block/aoe/aoedev.c
> +++ b/drivers/block/aoe/aoedev.c
> @@ -285,8 +285,7 @@ freedev(struct aoedev *d)
>   	e = t + d->ntargets;
>   	for (; t < e && *t; t++)
>   		freetgt(d, *t);
> -	if (d->bufpool)
> -		mempool_destroy(d->bufpool);
> +	mempool_destroy(d->bufpool);
>   	skbpoolfree(d);
>   	minor_free(d->sysminor);
>   
>


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 28/39] ecryptfs: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-15  2:08     ` Tyler Hicks
  -1 siblings, 0 replies; 163+ messages in thread
From: Tyler Hicks @ 2015-09-15  2:08 UTC (permalink / raw)
  To: Julia Lawall; +Cc: sergey.senozhatsky, kernel-janitors, ecryptfs, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

On 2015-09-13 14:15:21, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Tyler Hicks <tyhicks@canonical.com>

I assume that you'll be landing this patch set into Linus' tree all
together. Let me know if that's incorrect and I should take this single
patch into the eCryptfs dev tree.

Thanks!

Tyler

> 
> ---
>  fs/ecryptfs/main.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
> index 4f4d047..e83f31c 100644
> --- a/fs/ecryptfs/main.c
> +++ b/fs/ecryptfs/main.c
> @@ -737,8 +737,7 @@ static void ecryptfs_free_kmem_caches(void)
>  		struct ecryptfs_cache_info *info;
>  
>  		info = &ecryptfs_cache_infos[i];
> -		if (*(info->cache))
> -			kmem_cache_destroy(*(info->cache));
> +		kmem_cache_destroy(*(info->cache));
>  	}
>  }
>  
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 28/39] ecryptfs: drop null test before destroy functions
@ 2015-09-15  2:08     ` Tyler Hicks
  0 siblings, 0 replies; 163+ messages in thread
From: Tyler Hicks @ 2015-09-15  2:08 UTC (permalink / raw)
  To: Julia Lawall; +Cc: sergey.senozhatsky, kernel-janitors, ecryptfs, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]

On 2015-09-13 14:15:21, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Tyler Hicks <tyhicks@canonical.com>

I assume that you'll be landing this patch set into Linus' tree all
together. Let me know if that's incorrect and I should take this single
patch into the eCryptfs dev tree.

Thanks!

Tyler

> 
> ---
>  fs/ecryptfs/main.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
> index 4f4d047..e83f31c 100644
> --- a/fs/ecryptfs/main.c
> +++ b/fs/ecryptfs/main.c
> @@ -737,8 +737,7 @@ static void ecryptfs_free_kmem_caches(void)
>  		struct ecryptfs_cache_info *info;
>  
>  		info = &ecryptfs_cache_infos[i];
> -		if (*(info->cache))
> -			kmem_cache_destroy(*(info->cache));
> +		kmem_cache_destroy(*(info->cache));
>  	}
>  }
>  
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 28/39] ecryptfs: drop null test before destroy functions
  2015-09-15  2:08     ` Tyler Hicks
@ 2015-09-15  4:36       ` Julia Lawall
  -1 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-15  4:36 UTC (permalink / raw)
  To: Tyler Hicks; +Cc: sergey.senozhatsky, kernel-janitors, ecryptfs, linux-kernel



On Mon, 14 Sep 2015, Tyler Hicks wrote:

> On 2015-09-13 14:15:21, Julia Lawall wrote:
> > Remove unneeded NULL test.
> > 
> > The semantic patch that makes this change is as follows:
> > (http://coccinelle.lip6.fr/)
> > 
> > // <smpl>
> > @@ expression x; @@
> > -if (x != NULL)
> >   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> > // </smpl>
> > 
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Acked-by: Tyler Hicks <tyhicks@canonical.com>
> 
> I assume that you'll be landing this patch set into Linus' tree all
> together. Let me know if that's incorrect and I should take this single
> patch into the eCryptfs dev tree.

I'm not doing anythign after this point.  Some others have taken the patch
into their trees.

julia

> 
> Thanks!
> 
> Tyler
> 
> > 
> > ---
> >  fs/ecryptfs/main.c |    3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
> > index 4f4d047..e83f31c 100644
> > --- a/fs/ecryptfs/main.c
> > +++ b/fs/ecryptfs/main.c
> > @@ -737,8 +737,7 @@ static void ecryptfs_free_kmem_caches(void)
> >  		struct ecryptfs_cache_info *info;
> >  
> >  		info = &ecryptfs_cache_infos[i];
> > -		if (*(info->cache))
> > -			kmem_cache_destroy(*(info->cache));
> > +		kmem_cache_destroy(*(info->cache));
> >  	}
> >  }
> >  
> > 
> 

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 28/39] ecryptfs: drop null test before destroy functions
@ 2015-09-15  4:36       ` Julia Lawall
  0 siblings, 0 replies; 163+ messages in thread
From: Julia Lawall @ 2015-09-15  4:36 UTC (permalink / raw)
  To: Tyler Hicks; +Cc: sergey.senozhatsky, kernel-janitors, ecryptfs, linux-kernel



On Mon, 14 Sep 2015, Tyler Hicks wrote:

> On 2015-09-13 14:15:21, Julia Lawall wrote:
> > Remove unneeded NULL test.
> > 
> > The semantic patch that makes this change is as follows:
> > (http://coccinelle.lip6.fr/)
> > 
> > // <smpl>
> > @@ expression x; @@
> > -if (x != NULL)
> >   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> > // </smpl>
> > 
> > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Acked-by: Tyler Hicks <tyhicks@canonical.com>
> 
> I assume that you'll be landing this patch set into Linus' tree all
> together. Let me know if that's incorrect and I should take this single
> patch into the eCryptfs dev tree.

I'm not doing anythign after this point.  Some others have taken the patch
into their trees.

julia

> 
> Thanks!
> 
> Tyler
> 
> > 
> > ---
> >  fs/ecryptfs/main.c |    3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
> > index 4f4d047..e83f31c 100644
> > --- a/fs/ecryptfs/main.c
> > +++ b/fs/ecryptfs/main.c
> > @@ -737,8 +737,7 @@ static void ecryptfs_free_kmem_caches(void)
> >  		struct ecryptfs_cache_info *info;
> >  
> >  		info = &ecryptfs_cache_infos[i];
> > -		if (*(info->cache))
> > -			kmem_cache_destroy(*(info->cache));
> > +		kmem_cache_destroy(*(info->cache));
> >  	}
> >  }
> >  
> > 
> 

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 17/39] md: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-15  7:29     ` Neil Brown
  -1 siblings, 0 replies; 163+ messages in thread
From: Neil Brown @ 2015-09-15  7:29 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky, kernel-janitors, linux-raid, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3464 bytes --]

Julia Lawall <Julia.Lawall@lip6.fr> writes:

> Remove unneeded NULL test.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
>  drivers/md/multipath.c |    3 +--
>  drivers/md/raid1.c     |    6 ++----
>  drivers/md/raid10.c    |    9 +++------
>  drivers/md/raid5.c     |    3 +--
>  4 files changed, 7 insertions(+), 14 deletions(-)

Applied, thanks.

NeilBrown


>
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 15ef2c6..09a12d7 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -2271,8 +2271,7 @@ static void shrink_stripes(struct r5conf *conf)
>  	       drop_one_stripe(conf))
>  		;
>  
> -	if (conf->slab_cache)
> -		kmem_cache_destroy(conf->slab_cache);
> +	kmem_cache_destroy(conf->slab_cache);
>  	conf->slab_cache = NULL;
>  }
>  
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index 4517f06..5f4f553 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -2843,8 +2843,7 @@ static struct r1conf *setup_conf(struct mddev *mddev)
>  
>   abort:
>  	if (conf) {
> -		if (conf->r1bio_pool)
> -			mempool_destroy(conf->r1bio_pool);
> +		mempool_destroy(conf->r1bio_pool);
>  		kfree(conf->mirrors);
>  		safe_put_page(conf->tmppage);
>  		kfree(conf->poolinfo);
> @@ -2946,8 +2945,7 @@ static void raid1_free(struct mddev *mddev, void *priv)
>  {
>  	struct r1conf *conf = priv;
>  
> -	if (conf->r1bio_pool)
> -		mempool_destroy(conf->r1bio_pool);
> +	mempool_destroy(conf->r1bio_pool);
>  	kfree(conf->mirrors);
>  	safe_put_page(conf->tmppage);
>  	kfree(conf->poolinfo);
> diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
> index d222522..d132f06 100644
> --- a/drivers/md/multipath.c
> +++ b/drivers/md/multipath.c
> @@ -470,8 +470,7 @@ static int multipath_run (struct mddev *mddev)
>  	return 0;
>  
>  out_free_conf:
> -	if (conf->pool)
> -		mempool_destroy(conf->pool);
> +	mempool_destroy(conf->pool);
>  	kfree(conf->multipaths);
>  	kfree(conf);
>  	mddev->private = NULL;
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index 0fc33eb..7c99a40 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -3486,8 +3486,7 @@ static struct r10conf *setup_conf(struct mddev *mddev)
>  		printk(KERN_ERR "md/raid10:%s: couldn't allocate memory.\n",
>  		       mdname(mddev));
>  	if (conf) {
> -		if (conf->r10bio_pool)
> -			mempool_destroy(conf->r10bio_pool);
> +		mempool_destroy(conf->r10bio_pool);
>  		kfree(conf->mirrors);
>  		safe_put_page(conf->tmppage);
>  		kfree(conf);
> @@ -3682,8 +3681,7 @@ static int run(struct mddev *mddev)
>  
>  out_free_conf:
>  	md_unregister_thread(&mddev->thread);
> -	if (conf->r10bio_pool)
> -		mempool_destroy(conf->r10bio_pool);
> +	mempool_destroy(conf->r10bio_pool);
>  	safe_put_page(conf->tmppage);
>  	kfree(conf->mirrors);
>  	kfree(conf);
> @@ -3696,8 +3694,7 @@ static void raid10_free(struct mddev *mddev, void *priv)
>  {
>  	struct r10conf *conf = priv;
>  
> -	if (conf->r10bio_pool)
> -		mempool_destroy(conf->r10bio_pool);
> +	mempool_destroy(conf->r10bio_pool);
>  	safe_put_page(conf->tmppage);
>  	kfree(conf->mirrors);
>  	kfree(conf->mirrors_old);

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 17/39] md: drop null test before destroy functions
@ 2015-09-15  7:29     ` Neil Brown
  0 siblings, 0 replies; 163+ messages in thread
From: Neil Brown @ 2015-09-15  7:29 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky, kernel-janitors, linux-raid, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3464 bytes --]

Julia Lawall <Julia.Lawall@lip6.fr> writes:

> Remove unneeded NULL test.
>
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
>  drivers/md/multipath.c |    3 +--
>  drivers/md/raid1.c     |    6 ++----
>  drivers/md/raid10.c    |    9 +++------
>  drivers/md/raid5.c     |    3 +--
>  4 files changed, 7 insertions(+), 14 deletions(-)

Applied, thanks.

NeilBrown


>
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 15ef2c6..09a12d7 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -2271,8 +2271,7 @@ static void shrink_stripes(struct r5conf *conf)
>  	       drop_one_stripe(conf))
>  		;
>  
> -	if (conf->slab_cache)
> -		kmem_cache_destroy(conf->slab_cache);
> +	kmem_cache_destroy(conf->slab_cache);
>  	conf->slab_cache = NULL;
>  }
>  
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index 4517f06..5f4f553 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -2843,8 +2843,7 @@ static struct r1conf *setup_conf(struct mddev *mddev)
>  
>   abort:
>  	if (conf) {
> -		if (conf->r1bio_pool)
> -			mempool_destroy(conf->r1bio_pool);
> +		mempool_destroy(conf->r1bio_pool);
>  		kfree(conf->mirrors);
>  		safe_put_page(conf->tmppage);
>  		kfree(conf->poolinfo);
> @@ -2946,8 +2945,7 @@ static void raid1_free(struct mddev *mddev, void *priv)
>  {
>  	struct r1conf *conf = priv;
>  
> -	if (conf->r1bio_pool)
> -		mempool_destroy(conf->r1bio_pool);
> +	mempool_destroy(conf->r1bio_pool);
>  	kfree(conf->mirrors);
>  	safe_put_page(conf->tmppage);
>  	kfree(conf->poolinfo);
> diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
> index d222522..d132f06 100644
> --- a/drivers/md/multipath.c
> +++ b/drivers/md/multipath.c
> @@ -470,8 +470,7 @@ static int multipath_run (struct mddev *mddev)
>  	return 0;
>  
>  out_free_conf:
> -	if (conf->pool)
> -		mempool_destroy(conf->pool);
> +	mempool_destroy(conf->pool);
>  	kfree(conf->multipaths);
>  	kfree(conf);
>  	mddev->private = NULL;
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index 0fc33eb..7c99a40 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -3486,8 +3486,7 @@ static struct r10conf *setup_conf(struct mddev *mddev)
>  		printk(KERN_ERR "md/raid10:%s: couldn't allocate memory.\n",
>  		       mdname(mddev));
>  	if (conf) {
> -		if (conf->r10bio_pool)
> -			mempool_destroy(conf->r10bio_pool);
> +		mempool_destroy(conf->r10bio_pool);
>  		kfree(conf->mirrors);
>  		safe_put_page(conf->tmppage);
>  		kfree(conf);
> @@ -3682,8 +3681,7 @@ static int run(struct mddev *mddev)
>  
>  out_free_conf:
>  	md_unregister_thread(&mddev->thread);
> -	if (conf->r10bio_pool)
> -		mempool_destroy(conf->r10bio_pool);
> +	mempool_destroy(conf->r10bio_pool);
>  	safe_put_page(conf->tmppage);
>  	kfree(conf->mirrors);
>  	kfree(conf);
> @@ -3696,8 +3694,7 @@ static void raid10_free(struct mddev *mddev, void *priv)
>  {
>  	struct r10conf *conf = priv;
>  
> -	if (conf->r10bio_pool)
> -		mempool_destroy(conf->r10bio_pool);
> +	mempool_destroy(conf->r10bio_pool);
>  	safe_put_page(conf->tmppage);
>  	kfree(conf->mirrors);
>  	kfree(conf->mirrors_old);

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 163+ messages in thread

* RE: [PATCH 11/39] hfi1: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-15 13:56     ` Marciniszyn, Mike
  -1 siblings, 0 replies; 163+ messages in thread
From: Marciniszyn, Mike @ 2015-09-15 13:56 UTC (permalink / raw)
  To: Julia Lawall, infinipath
  Cc: sergey.senozhatsky@gmail.com, kernel-janitors@vger.kernel.org,
	Doug Ledford, Hefty, Sean, Hal Rosenstock, Greg Kroah-Hartman,
	linux-rdma@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org

> Subject: [PATCH 11/39] hfi1: drop null test before destroy functions
> 
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Thanks for the patch!

Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com>

^ permalink raw reply	[flat|nested] 163+ messages in thread

* RE: [PATCH 11/39] hfi1: drop null test before destroy functions
@ 2015-09-15 13:56     ` Marciniszyn, Mike
  0 siblings, 0 replies; 163+ messages in thread
From: Marciniszyn, Mike @ 2015-09-15 13:56 UTC (permalink / raw)
  To: Julia Lawall, infinipath
  Cc: devel@driverdev.osuosl.org, linux-rdma@vger.kernel.org,
	Greg Kroah-Hartman, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org, Doug Ledford, Hefty, Sean,
	Hal Rosenstock

> Subject: [PATCH 11/39] hfi1: drop null test before destroy functions
> 
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Thanks for the patch!

Acked-by: Mike Marciniszyn <mike.marciniszyn@intel.com>

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 28/39] ecryptfs: drop null test before destroy functions
  2015-09-15  4:36       ` Julia Lawall
@ 2015-09-15 14:45         ` Tyler Hicks
  -1 siblings, 0 replies; 163+ messages in thread
From: Tyler Hicks @ 2015-09-15 14:45 UTC (permalink / raw)
  To: Julia Lawall; +Cc: sergey.senozhatsky, kernel-janitors, ecryptfs, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1810 bytes --]

On 2015-09-15 06:36:30, Julia Lawall wrote:
> 
> 
> On Mon, 14 Sep 2015, Tyler Hicks wrote:
> 
> > On 2015-09-13 14:15:21, Julia Lawall wrote:
> > > Remove unneeded NULL test.
> > > 
> > > The semantic patch that makes this change is as follows:
> > > (http://coccinelle.lip6.fr/)
> > > 
> > > // <smpl>
> > > @@ expression x; @@
> > > -if (x != NULL)
> > >   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> > > // </smpl>
> > > 
> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > 
> > Acked-by: Tyler Hicks <tyhicks@canonical.com>
> > 
> > I assume that you'll be landing this patch set into Linus' tree all
> > together. Let me know if that's incorrect and I should take this single
> > patch into the eCryptfs dev tree.
> 
> I'm not doing anythign after this point.  Some others have taken the patch
> into their trees.

I've taken it into my tree. Thanks again.

Tyler

> 
> julia
> 
> > 
> > Thanks!
> > 
> > Tyler
> > 
> > > 
> > > ---
> > >  fs/ecryptfs/main.c |    3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > > 
> > > diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
> > > index 4f4d047..e83f31c 100644
> > > --- a/fs/ecryptfs/main.c
> > > +++ b/fs/ecryptfs/main.c
> > > @@ -737,8 +737,7 @@ static void ecryptfs_free_kmem_caches(void)
> > >  		struct ecryptfs_cache_info *info;
> > >  
> > >  		info = &ecryptfs_cache_infos[i];
> > > -		if (*(info->cache))
> > > -			kmem_cache_destroy(*(info->cache));
> > > +		kmem_cache_destroy(*(info->cache));
> > >  	}
> > >  }
> > >  
> > > 
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe ecryptfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 28/39] ecryptfs: drop null test before destroy functions
@ 2015-09-15 14:45         ` Tyler Hicks
  0 siblings, 0 replies; 163+ messages in thread
From: Tyler Hicks @ 2015-09-15 14:45 UTC (permalink / raw)
  To: Julia Lawall; +Cc: sergey.senozhatsky, kernel-janitors, ecryptfs, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1810 bytes --]

On 2015-09-15 06:36:30, Julia Lawall wrote:
> 
> 
> On Mon, 14 Sep 2015, Tyler Hicks wrote:
> 
> > On 2015-09-13 14:15:21, Julia Lawall wrote:
> > > Remove unneeded NULL test.
> > > 
> > > The semantic patch that makes this change is as follows:
> > > (http://coccinelle.lip6.fr/)
> > > 
> > > // <smpl>
> > > @@ expression x; @@
> > > -if (x != NULL)
> > >   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> > > // </smpl>
> > > 
> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> > 
> > Acked-by: Tyler Hicks <tyhicks@canonical.com>
> > 
> > I assume that you'll be landing this patch set into Linus' tree all
> > together. Let me know if that's incorrect and I should take this single
> > patch into the eCryptfs dev tree.
> 
> I'm not doing anythign after this point.  Some others have taken the patch
> into their trees.

I've taken it into my tree. Thanks again.

Tyler

> 
> julia
> 
> > 
> > Thanks!
> > 
> > Tyler
> > 
> > > 
> > > ---
> > >  fs/ecryptfs/main.c |    3 +--
> > >  1 file changed, 1 insertion(+), 2 deletions(-)
> > > 
> > > diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
> > > index 4f4d047..e83f31c 100644
> > > --- a/fs/ecryptfs/main.c
> > > +++ b/fs/ecryptfs/main.c
> > > @@ -737,8 +737,7 @@ static void ecryptfs_free_kmem_caches(void)
> > >  		struct ecryptfs_cache_info *info;
> > >  
> > >  		info = &ecryptfs_cache_infos[i];
> > > -		if (*(info->cache))
> > > -			kmem_cache_destroy(*(info->cache));
> > > +		kmem_cache_destroy(*(info->cache));
> > >  	}
> > >  }
> > >  
> > > 
> > 
> --
> To unsubscribe from this list: send the line "unsubscribe ecryptfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 25/39] net: core: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-15 23:50     ` David Miller
  -1 siblings, 0 replies; 163+ messages in thread
From: David Miller @ 2015-09-15 23:50 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: sergey.senozhatsky, kernel-janitors, netdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 13 Sep 2015 14:15:18 +0200

> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL) {
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>   x = NULL;
> -}
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 25/39] net: core: drop null test before destroy functions
@ 2015-09-15 23:50     ` David Miller
  0 siblings, 0 replies; 163+ messages in thread
From: David Miller @ 2015-09-15 23:50 UTC (permalink / raw)
  To: Julia.Lawall; +Cc: sergey.senozhatsky, kernel-janitors, netdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 13 Sep 2015 14:15:18 +0200

> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL) {
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>   x = NULL;
> -}
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 34/39] dccp: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
  (?)
@ 2015-09-15 23:50     ` David Miller
  -1 siblings, 0 replies; 163+ messages in thread
From: David Miller @ 2015-09-15 23:50 UTC (permalink / raw)
  To: Julia.Lawall
  Cc: gerrit, sergey.senozhatsky, kernel-janitors, dccp, netdev,
	linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 13 Sep 2015 14:15:27 +0200

> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression x;
> @@
> 
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> 
> @@
> expression x;
> @@
> 
> -if (x != NULL) {
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>   x = NULL;
> -}
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 34/39] dccp: drop null test before destroy functions
@ 2015-09-15 23:50     ` David Miller
  0 siblings, 0 replies; 163+ messages in thread
From: David Miller @ 2015-09-15 23:50 UTC (permalink / raw)
  To: Julia.Lawall
  Cc: gerrit, sergey.senozhatsky, kernel-janitors, dccp, netdev,
	linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 13 Sep 2015 14:15:27 +0200

> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression x;
> @@
> 
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> 
> @@
> expression x;
> @@
> 
> -if (x != NULL) {
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>   x = NULL;
> -}
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 34/39] dccp: drop null test before destroy functions
@ 2015-09-15 23:50     ` David Miller
  0 siblings, 0 replies; 163+ messages in thread
From: David Miller @ 2015-09-15 23:50 UTC (permalink / raw)
  To: dccp

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 13 Sep 2015 14:15:27 +0200

> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@
> expression x;
> @@
> 
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> 
> @@
> expression x;
> @@
> 
> -if (x != NULL) {
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>   x = NULL;
> -}
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 10/39] atm: he: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-15 23:50     ` David Miller
  -1 siblings, 0 replies; 163+ messages in thread
From: David Miller @ 2015-09-15 23:50 UTC (permalink / raw)
  To: Julia.Lawall
  Cc: 3chas3, sergey.senozhatsky, kernel-janitors, linux-atm-general,
	netdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 13 Sep 2015 14:15:03 +0200

> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 10/39] atm: he: drop null test before destroy functions
@ 2015-09-15 23:50     ` David Miller
  0 siblings, 0 replies; 163+ messages in thread
From: David Miller @ 2015-09-15 23:50 UTC (permalink / raw)
  To: Julia.Lawall
  Cc: 3chas3, sergey.senozhatsky, kernel-janitors, linux-atm-general,
	netdev, linux-kernel

From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Sun, 13 Sep 2015 14:15:03 +0200

> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied.

^ permalink raw reply	[flat|nested] 163+ messages in thread

* RE: [PATCH 37/39] f2fs crypto: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
  (?)
@ 2015-09-16 10:17     ` Chao Yu
  -1 siblings, 0 replies; 163+ messages in thread
From: Chao Yu @ 2015-09-16 10:17 UTC (permalink / raw)
  To: 'Julia Lawall', 'Jaegeuk Kim'
  Cc: sergey.senozhatsky, kernel-janitors, 'Changman Lee',
	linux-f2fs-devel, linux-kernel

> -----Original Message-----
> From: Julia Lawall [mailto:Julia.Lawall@lip6.fr]
> Sent: Sunday, September 13, 2015 8:16 PM
> To: Jaegeuk Kim
> Cc: sergey.senozhatsky@gmail.com; kernel-janitors@vger.kernel.org; Changman Lee; Chao Yu;
> linux-f2fs-devel@lists.sourceforge.net; linux-kernel@vger.kernel.org
> Subject: [PATCH 37/39] f2fs crypto: drop null test before destroy functions
> 
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Chao Yu <chao2.yu@samsung.com>


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 37/39] f2fs crypto: drop null test before destroy functions
@ 2015-09-16 10:17     ` Chao Yu
  0 siblings, 0 replies; 163+ messages in thread
From: Chao Yu @ 2015-09-16 10:17 UTC (permalink / raw)
  To: 'Julia Lawall', 'Jaegeuk Kim'
  Cc: sergey.senozhatsky, kernel-janitors, linux-kernel,
	linux-f2fs-devel

> -----Original Message-----
> From: Julia Lawall [mailto:Julia.Lawall@lip6.fr]
> Sent: Sunday, September 13, 2015 8:16 PM
> To: Jaegeuk Kim
> Cc: sergey.senozhatsky@gmail.com; kernel-janitors@vger.kernel.org; Changman Lee; Chao Yu;
> linux-f2fs-devel@lists.sourceforge.net; linux-kernel@vger.kernel.org
> Subject: [PATCH 37/39] f2fs crypto: drop null test before destroy functions
> 
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Chao Yu <chao2.yu@samsung.com>


------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140

^ permalink raw reply	[flat|nested] 163+ messages in thread

* RE: [PATCH 37/39] f2fs crypto: drop null test before destroy functions
@ 2015-09-16 10:17     ` Chao Yu
  0 siblings, 0 replies; 163+ messages in thread
From: Chao Yu @ 2015-09-16 10:17 UTC (permalink / raw)
  To: 'Julia Lawall', 'Jaegeuk Kim'
  Cc: sergey.senozhatsky, kernel-janitors, linux-kernel,
	linux-f2fs-devel

> -----Original Message-----
> From: Julia Lawall [mailto:Julia.Lawall@lip6.fr]
> Sent: Sunday, September 13, 2015 8:16 PM
> To: Jaegeuk Kim
> Cc: sergey.senozhatsky@gmail.com; kernel-janitors@vger.kernel.org; Changman Lee; Chao Yu;
> linux-f2fs-devel@lists.sourceforge.net; linux-kernel@vger.kernel.org
> Subject: [PATCH 37/39] f2fs crypto: drop null test before destroy functions
> 
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Chao Yu <chao2.yu@samsung.com>


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 26/39] dmaengine: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-21 17:22     ` Vinod Koul
  -1 siblings, 0 replies; 163+ messages in thread
From: Vinod Koul @ 2015-09-21 17:10 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky, kernel-janitors, Dan Williams, dmaengine,
	linux-kernel

On Sun, Sep 13, 2015 at 02:15:19PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 

Applied, thanks

-- 
~Vinod


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 26/39] dmaengine: drop null test before destroy functions
@ 2015-09-21 17:22     ` Vinod Koul
  0 siblings, 0 replies; 163+ messages in thread
From: Vinod Koul @ 2015-09-21 17:22 UTC (permalink / raw)
  To: Julia Lawall
  Cc: sergey.senozhatsky, kernel-janitors, Dan Williams, dmaengine,
	linux-kernel

On Sun, Sep 13, 2015 at 02:15:19PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 

Applied, thanks

-- 
~Vinod


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 01/39] mtd: nandsim: drop null test before destroy functions
  2015-09-13 12:14   ` Julia Lawall
@ 2015-09-22  0:07     ` Brian Norris
  -1 siblings, 0 replies; 163+ messages in thread
From: Brian Norris @ 2015-09-22  0:07 UTC (permalink / raw)
  To: Julia Lawall
  Cc: David Woodhouse, sergey.senozhatsky, kernel-janitors, linux-mtd,
	linux-kernel

On Sun, Sep 13, 2015 at 02:14:54PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied patches 1 and 36 to l2-mtd.git

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 01/39] mtd: nandsim: drop null test before destroy functions
@ 2015-09-22  0:07     ` Brian Norris
  0 siblings, 0 replies; 163+ messages in thread
From: Brian Norris @ 2015-09-22  0:07 UTC (permalink / raw)
  To: Julia Lawall
  Cc: David Woodhouse, sergey.senozhatsky, kernel-janitors, linux-mtd,
	linux-kernel

On Sun, Sep 13, 2015 at 02:14:54PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied patches 1 and 36 to l2-mtd.git

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 08/39] pktcdvd: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-29 13:02     ` Jiri Kosina
  -1 siblings, 0 replies; 163+ messages in thread
From: Jiri Kosina @ 2015-09-29 13:02 UTC (permalink / raw)
  To: Julia Lawall; +Cc: sergey.senozhatsky, kernel-janitors, linux-kernel

On Sun, 13 Sep 2015, Julia Lawall wrote:

> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 08/39] pktcdvd: drop null test before destroy functions
@ 2015-09-29 13:02     ` Jiri Kosina
  0 siblings, 0 replies; 163+ messages in thread
From: Jiri Kosina @ 2015-09-29 13:02 UTC (permalink / raw)
  To: Julia Lawall; +Cc: sergey.senozhatsky, kernel-janitors, linux-kernel

On Sun, 13 Sep 2015, Julia Lawall wrote:

> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 38/39] iommu/amd: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-09-29 13:41     ` Joerg Roedel
  -1 siblings, 0 replies; 163+ messages in thread
From: Joerg Roedel @ 2015-09-29 13:41 UTC (permalink / raw)
  To: Julia Lawall; +Cc: sergey.senozhatsky, kernel-janitors, iommu, linux-kernel

On Sun, Sep 13, 2015 at 02:15:31PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL) {
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>   x = NULL;
> -}
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/iommu/amd_iommu_init.c |    7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

Applied, thanks.


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 38/39] iommu/amd: drop null test before destroy functions
@ 2015-09-29 13:41     ` Joerg Roedel
  0 siblings, 0 replies; 163+ messages in thread
From: Joerg Roedel @ 2015-09-29 13:41 UTC (permalink / raw)
  To: Julia Lawall; +Cc: sergey.senozhatsky, kernel-janitors, iommu, linux-kernel

On Sun, Sep 13, 2015 at 02:15:31PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL) {
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
>   x = NULL;
> -}
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/iommu/amd_iommu_init.c |    7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)

Applied, thanks.


^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [Intel-gfx] [PATCH 32/39] drm: i915: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
  (?)
@ 2015-09-30  8:44     ` Daniel Vetter
  -1 siblings, 0 replies; 163+ messages in thread
From: Daniel Vetter @ 2015-09-30  8:44 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Daniel Vetter, David Airlie, intel-gfx, kernel-janitors,
	linux-kernel, dri-devel, sergey.senozhatsky

On Sun, Sep 13, 2015 at 02:15:25PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Queued for -next, thanks for the patch.
-Daniel

> 
> ---
>  drivers/gpu/drm/i915/i915_dma.c |   19 ++++++-------------
>  1 file changed, 6 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index ab37d11..1dc7c21 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1059,12 +1059,9 @@ out_freecsr:
>  put_bridge:
>  	pci_dev_put(dev_priv->bridge_dev);
>  free_priv:
> -	if (dev_priv->requests)
> -		kmem_cache_destroy(dev_priv->requests);
> -	if (dev_priv->vmas)
> -		kmem_cache_destroy(dev_priv->vmas);
> -	if (dev_priv->objects)
> -		kmem_cache_destroy(dev_priv->objects);
> +	kmem_cache_destroy(dev_priv->requests);
> +	kmem_cache_destroy(dev_priv->vmas);
> +	kmem_cache_destroy(dev_priv->objects);
>  	kfree(dev_priv);
>  	return ret;
>  }
> @@ -1150,13 +1147,9 @@ int i915_driver_unload(struct drm_device *dev)
>  	if (dev_priv->regs != NULL)
>  		pci_iounmap(dev->pdev, dev_priv->regs);
>  
> -	if (dev_priv->requests)
> -		kmem_cache_destroy(dev_priv->requests);
> -	if (dev_priv->vmas)
> -		kmem_cache_destroy(dev_priv->vmas);
> -	if (dev_priv->objects)
> -		kmem_cache_destroy(dev_priv->objects);
> -
> +	kmem_cache_destroy(dev_priv->requests);
> +	kmem_cache_destroy(dev_priv->vmas);
> +	kmem_cache_destroy(dev_priv->objects);
>  	pci_dev_put(dev_priv->bridge_dev);
>  	kfree(dev_priv);
>  
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 32/39] drm: i915: drop null test before destroy functions
@ 2015-09-30  8:44     ` Daniel Vetter
  0 siblings, 0 replies; 163+ messages in thread
From: Daniel Vetter @ 2015-09-30  8:44 UTC (permalink / raw)
  To: Julia Lawall
  Cc: David Airlie, intel-gfx, kernel-janitors, linux-kernel, dri-devel,
	sergey.senozhatsky, Daniel Vetter

On Sun, Sep 13, 2015 at 02:15:25PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Queued for -next, thanks for the patch.
-Daniel

> 
> ---
>  drivers/gpu/drm/i915/i915_dma.c |   19 ++++++-------------
>  1 file changed, 6 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index ab37d11..1dc7c21 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1059,12 +1059,9 @@ out_freecsr:
>  put_bridge:
>  	pci_dev_put(dev_priv->bridge_dev);
>  free_priv:
> -	if (dev_priv->requests)
> -		kmem_cache_destroy(dev_priv->requests);
> -	if (dev_priv->vmas)
> -		kmem_cache_destroy(dev_priv->vmas);
> -	if (dev_priv->objects)
> -		kmem_cache_destroy(dev_priv->objects);
> +	kmem_cache_destroy(dev_priv->requests);
> +	kmem_cache_destroy(dev_priv->vmas);
> +	kmem_cache_destroy(dev_priv->objects);
>  	kfree(dev_priv);
>  	return ret;
>  }
> @@ -1150,13 +1147,9 @@ int i915_driver_unload(struct drm_device *dev)
>  	if (dev_priv->regs != NULL)
>  		pci_iounmap(dev->pdev, dev_priv->regs);
>  
> -	if (dev_priv->requests)
> -		kmem_cache_destroy(dev_priv->requests);
> -	if (dev_priv->vmas)
> -		kmem_cache_destroy(dev_priv->vmas);
> -	if (dev_priv->objects)
> -		kmem_cache_destroy(dev_priv->objects);
> -
> +	kmem_cache_destroy(dev_priv->requests);
> +	kmem_cache_destroy(dev_priv->vmas);
> +	kmem_cache_destroy(dev_priv->objects);
>  	pci_dev_put(dev_priv->bridge_dev);
>  	kfree(dev_priv);
>  
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [Intel-gfx] [PATCH 32/39] drm: i915: drop null test before destroy functions
@ 2015-09-30  8:44     ` Daniel Vetter
  0 siblings, 0 replies; 163+ messages in thread
From: Daniel Vetter @ 2015-09-30  8:44 UTC (permalink / raw)
  To: Julia Lawall
  Cc: David Airlie, intel-gfx, kernel-janitors, linux-kernel, dri-devel,
	sergey.senozhatsky, Daniel Vetter

On Sun, Sep 13, 2015 at 02:15:25PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Queued for -next, thanks for the patch.
-Daniel

> 
> ---
>  drivers/gpu/drm/i915/i915_dma.c |   19 ++++++-------------
>  1 file changed, 6 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index ab37d11..1dc7c21 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1059,12 +1059,9 @@ out_freecsr:
>  put_bridge:
>  	pci_dev_put(dev_priv->bridge_dev);
>  free_priv:
> -	if (dev_priv->requests)
> -		kmem_cache_destroy(dev_priv->requests);
> -	if (dev_priv->vmas)
> -		kmem_cache_destroy(dev_priv->vmas);
> -	if (dev_priv->objects)
> -		kmem_cache_destroy(dev_priv->objects);
> +	kmem_cache_destroy(dev_priv->requests);
> +	kmem_cache_destroy(dev_priv->vmas);
> +	kmem_cache_destroy(dev_priv->objects);
>  	kfree(dev_priv);
>  	return ret;
>  }
> @@ -1150,13 +1147,9 @@ int i915_driver_unload(struct drm_device *dev)
>  	if (dev_priv->regs != NULL)
>  		pci_iounmap(dev->pdev, dev_priv->regs);
>  
> -	if (dev_priv->requests)
> -		kmem_cache_destroy(dev_priv->requests);
> -	if (dev_priv->vmas)
> -		kmem_cache_destroy(dev_priv->vmas);
> -	if (dev_priv->objects)
> -		kmem_cache_destroy(dev_priv->objects);
> -
> +	kmem_cache_destroy(dev_priv->requests);
> +	kmem_cache_destroy(dev_priv->vmas);
> +	kmem_cache_destroy(dev_priv->objects);
>  	pci_dev_put(dev_priv->bridge_dev);
>  	kfree(dev_priv);
>  
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 23/39] UBI: drop null test before destroy functions
  2015-09-13 12:15   ` Julia Lawall
@ 2015-10-03 18:36     ` Richard Weinberger
  -1 siblings, 0 replies; 163+ messages in thread
From: Richard Weinberger @ 2015-10-03 18:36 UTC (permalink / raw)
  To: Julia Lawall, Artem Bityutskiy
  Cc: sergey.senozhatsky, kernel-janitors, David Woodhouse,
	Brian Norris, linux-mtd, linux-kernel

Am 13.09.2015 um 14:15 schrieb Julia Lawall:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/mtd/ubi/attach.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
> index 68eea5b..c1aaf03 100644
> --- a/drivers/mtd/ubi/attach.c
> +++ b/drivers/mtd/ubi/attach.c
> @@ -1209,9 +1209,7 @@ static void destroy_ai(struct ubi_attach_info *ai)
>  		}
>  	}
>  
> -	if (ai->aeb_slab_cache)
> -		kmem_cache_destroy(ai->aeb_slab_cache);
> -
> +	kmem_cache_destroy(ai->aeb_slab_cache);
>  	kfree(ai);
>  }

Applied!

Thanks,
//richard

^ permalink raw reply	[flat|nested] 163+ messages in thread

* Re: [PATCH 23/39] UBI: drop null test before destroy functions
@ 2015-10-03 18:36     ` Richard Weinberger
  0 siblings, 0 replies; 163+ messages in thread
From: Richard Weinberger @ 2015-10-03 18:36 UTC (permalink / raw)
  To: Julia Lawall, Artem Bityutskiy
  Cc: sergey.senozhatsky, kernel-janitors, David Woodhouse,
	Brian Norris, linux-mtd, linux-kernel

Am 13.09.2015 um 14:15 schrieb Julia Lawall:
> Remove unneeded NULL test.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @@ expression x; @@
> -if (x != NULL)
>   \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> ---
>  drivers/mtd/ubi/attach.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
> index 68eea5b..c1aaf03 100644
> --- a/drivers/mtd/ubi/attach.c
> +++ b/drivers/mtd/ubi/attach.c
> @@ -1209,9 +1209,7 @@ static void destroy_ai(struct ubi_attach_info *ai)
>  		}
>  	}
>  
> -	if (ai->aeb_slab_cache)
> -		kmem_cache_destroy(ai->aeb_slab_cache);
> -
> +	kmem_cache_destroy(ai->aeb_slab_cache);
>  	kfree(ai);
>  }

Applied!

Thanks,
//richard

^ permalink raw reply	[flat|nested] 163+ messages in thread

end of thread, other threads:[~2015-10-03 18:36 UTC | newest]

Thread overview: 163+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-13 12:14 [PATCH 00/39] drop null test before destroy functions Julia Lawall
2015-09-13 12:14 ` Julia Lawall
2015-09-13 12:14 ` [Cluster-devel] " Julia Lawall
2015-09-13 12:14 ` [Intel-wired-lan] " Julia Lawall
2015-09-13 12:14 ` Julia Lawall
2015-09-13 12:14 ` Julia Lawall
2015-09-13 12:14 ` Julia Lawall
2015-09-13 12:14 ` [PATCH 01/39] mtd: nandsim: " Julia Lawall
2015-09-13 12:14   ` Julia Lawall
2015-09-22  0:07   ` Brian Norris
2015-09-22  0:07     ` Brian Norris
2015-09-13 12:14 ` [PATCH 02/39] nilfs2: " Julia Lawall
2015-09-13 12:14   ` Julia Lawall
2015-09-13 12:14   ` Julia Lawall
2015-09-14  3:29   ` Ryusuke Konishi
2015-09-14  3:29     ` Ryusuke Konishi
2015-09-14  3:29     ` Ryusuke Konishi
2015-09-13 12:14 ` [PATCH 03/39] firmware: google: " Julia Lawall
2015-09-13 12:14   ` Julia Lawall
2015-09-13 12:14 ` [PATCH 04/39] debugobjects: " Julia Lawall
2015-09-13 12:14   ` Julia Lawall
2015-09-13 12:14 ` [PATCH 05/39] xhci: " Julia Lawall
2015-09-13 12:14   ` Julia Lawall
2015-09-13 12:14 ` [PATCH 06/39] Btrfs: " Julia Lawall
2015-09-13 12:14   ` Julia Lawall
2015-09-14 20:43   ` David Sterba
2015-09-14 20:43     ` David Sterba
2015-09-13 12:15 ` [PATCH 07/39] fs: ext4: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15 ` [PATCH 08/39] pktcdvd: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-29 13:02   ` Jiri Kosina
2015-09-29 13:02     ` Jiri Kosina
2015-09-13 12:15 ` [PATCH 09/39] aoe: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-15  1:39   ` Ed Cashin
2015-09-15  1:39     ` Ed Cashin
2015-09-13 12:15 ` [PATCH 10/39] atm: he: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-15 23:50   ` David Miller
2015-09-15 23:50     ` David Miller
2015-09-13 12:15 ` [PATCH 11/39] hfi1: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-15 13:56   ` Marciniszyn, Mike
2015-09-15 13:56     ` Marciniszyn, Mike
2015-09-13 12:15 ` [PATCH 12/39] dm: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-14 13:46   ` [dm-devel] " Mikulas Patocka
2015-09-14 13:46     ` Mikulas Patocka
2015-09-14 14:00     ` Mike Snitzer
2015-09-14 14:00       ` Mike Snitzer
2015-09-14 14:05       ` Mikulas Patocka
2015-09-14 14:05         ` Mikulas Patocka
2015-09-14 18:50         ` Julia Lawall
2015-09-14 18:50           ` Julia Lawall
2015-09-14 14:23     ` [dm-devel] " walter harms
2015-09-14 14:23       ` walter harms
2015-09-13 12:15 ` [PATCH 13/39] staging: lustre: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15 ` [PATCH 14/39] SUNRPC: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-14 16:07   ` J. Bruce Fields
2015-09-14 16:07     ` J. Bruce Fields
2015-09-14 16:07     ` J. Bruce Fields
2015-09-14 16:25     ` Trond Myklebust
2015-09-14 16:25       ` Trond Myklebust
2015-09-13 12:15 ` [PATCH 15/39] bcache: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-14  9:08   ` Johannes Thumshirn
2015-09-14  9:08     ` Johannes Thumshirn
2015-09-13 12:15 ` [PATCH 16/39] usb: gadget: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15 ` [PATCH 17/39] md: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-15  7:29   ` Neil Brown
2015-09-15  7:29     ` Neil Brown
2015-09-13 12:15 ` [PATCH 18/39] whci: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15 ` [PATCH 19/39] jbd2: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15 ` [PATCH 20/39] ixgbe: " Julia Lawall
2015-09-13 12:15   ` [Intel-wired-lan] " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15 ` [PATCH 21/39] drbd: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15 ` [PATCH 22/39] nfsd: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-14 16:06   ` J. Bruce Fields
2015-09-14 16:06     ` J. Bruce Fields
2015-09-13 12:15 ` [PATCH 23/39] UBI: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-10-03 18:36   ` Richard Weinberger
2015-10-03 18:36     ` Richard Weinberger
2015-09-13 12:15 ` [PATCH 24/39] dlm: " Julia Lawall
2015-09-13 12:15   ` [Cluster-devel] " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15 ` [PATCH 25/39] net: core: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-15 23:50   ` David Miller
2015-09-15 23:50     ` David Miller
2015-09-13 12:15 ` [PATCH 26/39] dmaengine: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-21 17:10   ` Vinod Koul
2015-09-21 17:22     ` Vinod Koul
2015-09-13 12:15 ` [PATCH 27/39] ocfs2: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15 ` [PATCH 28/39] ecryptfs: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-15  2:08   ` Tyler Hicks
2015-09-15  2:08     ` Tyler Hicks
2015-09-15  4:36     ` Julia Lawall
2015-09-15  4:36       ` Julia Lawall
2015-09-15 14:45       ` Tyler Hicks
2015-09-15 14:45         ` Tyler Hicks
2015-09-13 12:15 ` [PATCH 29/39] thunderbolt: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15 ` [PATCH 30/39] block: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15 ` [PATCH 31/39] KVM: MMU: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-14  8:30   ` Paolo Bonzini
2015-09-14  8:30     ` Paolo Bonzini
2015-09-13 12:15 ` [PATCH 32/39] drm: i915: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-30  8:44   ` [Intel-gfx] " Daniel Vetter
2015-09-30  8:44     ` Daniel Vetter
2015-09-30  8:44     ` Daniel Vetter
2015-09-13 12:15 ` [PATCH 33/39] rbd: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-14  9:53   ` Ilya Dryomov
2015-09-14  9:53     ` Ilya Dryomov
2015-09-13 12:15 ` [PATCH 34/39] dccp: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-15 23:50   ` David Miller
2015-09-15 23:50     ` David Miller
2015-09-15 23:50     ` David Miller
2015-09-13 12:15 ` [PATCH 35/39] GFS2: " Julia Lawall
2015-09-13 12:15   ` [Cluster-devel] " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15 ` [PATCH 36/39] jffs2: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15 ` [PATCH 37/39] f2fs crypto: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-16 10:17   ` Chao Yu
2015-09-16 10:17     ` Chao Yu
2015-09-16 10:17     ` Chao Yu
2015-09-13 12:15 ` [PATCH 38/39] iommu/amd: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-29 13:41   ` Joerg Roedel
2015-09-29 13:41     ` Joerg Roedel
2015-09-13 12:15 ` [PATCH 39/39] usb: host: " Julia Lawall
2015-09-13 12:15   ` Julia Lawall
2015-09-14 11:55 ` [PATCH 00/39] " SF Markus Elfring
2015-09-14 11:55   ` SF Markus Elfring
2015-09-14 11:55   ` [Cluster-devel] " SF Markus Elfring
2015-09-14 11:55   ` [Intel-wired-lan] " SF Markus Elfring
2015-09-14 11:55   ` SF Markus Elfring
2015-09-14 11:55   ` SF Markus Elfring
2015-09-14 11:55   ` SF Markus Elfring
2015-09-14 11:55   ` SF Markus Elfring

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.