Skip to content

Remove redundant NULL checks.

Cyril Roelandt cocci dri-devel kernel-janitors linux-iommu lkml virtualization xen-devel 1 version Applied

Status from this message: Applied to x86/amd, Thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5radeon: Remove redundant NULL check before radeon_i2c_destroy().drivers/gpu/drm/radeon/radeon_i2c.c+2 -40 replies
2/5iommu: remove redundant NULL check before dma_ops_domain_free().drivers/iommu/amd_iommu.c+1 -21 reply
3/5staging: dgrp: remove redundant NULL check before unregister_dgrp_device().drivers/staging/dgrp/dgrp_specproc.c+3 -60 replies
4/5staging: tidspbridge: remove redundant NULL check before delete_msg_mgr().drivers/staging/tidspbridge/core/msg_sm.c+1 -20 replies
5/5xen: remove redundant NULL check before unregister_and_remove_pcpu().drivers/xen/pcpu.c+1 -20 replies
5/5xen: remove redundant NULL check before unregister_and_remove_pcpu().drivers/xen/pcpu.c+1 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] Remove redundant NULL checks.

Remove redundant NULL checks before calls to functions that are equivalent to a no-op when run on a NULL pointer.

These patches were generated by the following semantic patch, and manually reviewed:

<smpl>
@r@
identifier noop_func;
identifier param;
type T;
@@

noop_func (T *param) {
	...
	if (!param) return;
	...
}

@@
identifier r.noop_func;
expression E;
statement S;
@@
(
- if (E) noop_func(E);
+ noop_func(E);
|
- if (E) { noop_func(E); E = NULL; }
+ noop_func(E);
+ E = NULL;
)
</smpl>

Regards,
Cyril Roelandt
---

Cyril Roelandt (5):
radeon: Remove redundant NULL check before radeon_i2c_destroy().
iommu: remove redundant NULL check before dma_ops_domain_free().
staging: dgrp: remove redundant NULL check before
unregister_dgrp_device().
staging: tidspbridge: remove redundant NULL check before

    delete_msg_mgr().

xen: remove redundant NULL check before unregister_and_remove_pcpu().

 drivers/gpu/drm/radeon/radeon_i2c.c       |    6 ++----
 drivers/iommu/amd_iommu.c                 |    3 +--
 drivers/staging/dgrp/dgrp_specproc.c      |    9 +++------
 drivers/staging/tidspbridge/core/msg_sm.c |    3 +--
 drivers/xen/pcpu.c                        |    3 +--
 5 files changed, 8 insertions(+), 16 deletions(-)
Signature · 1 line
1.7.10.4