drm: simplify drm_sysfs_destroy() via IS_ERR_OR_NULL()
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 9 Sep 2015 12:21:29 +0000 (14:21 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 9 Sep 2015 13:03:38 +0000 (15:03 +0200)
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 <dh.herrmann@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_sysfs.c

index 0f6cd33b531f104f5094513a0992eb99361e65b3..3f66cb07848e381af8c30b7af2add9aee41427e8 100644 (file)
@@ -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);