From: David Herrmann Date: Wed, 9 Sep 2015 12:21:29 +0000 (+0200) Subject: drm: simplify drm_sysfs_destroy() via IS_ERR_OR_NULL() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=26b91ae4732be89228d207c76827071c6aecc4d8;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm: simplify drm_sysfs_destroy() via IS_ERR_OR_NULL() Simplify `foo == NULL || IS_ERR(foo)` via IS_ERR_OR_NULL(). This is pretty commonly used all over the kernel, especially for debugfs/sysfs cleanup paths. Signed-off-by: David Herrmann Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 0f6cd33b531f..3f66cb07848e 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -156,7 +156,7 @@ err_out: */ void drm_sysfs_destroy(void) { - if ((drm_class == NULL) || (IS_ERR(drm_class))) + if (IS_ERR_OR_NULL(drm_class)) return; class_remove_file(drm_class, &class_attr_version.attr); class_destroy(drm_class);