From: David Herrmann <dh.herrmann@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 1/5] drm: simplify drm_sysfs_destroy() via IS_ERR_OR_NULL()
Date: Wed, 9 Sep 2015 14:21:29 +0200 [thread overview]
Message-ID: <1441801293-1440-2-git-send-email-dh.herrmann@gmail.com> (raw)
In-Reply-To: <1441801293-1440-1-git-send-email-dh.herrmann@gmail.com>
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>
---
drivers/gpu/drm/drm_sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index 0f6cd33..3f66cb0 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);
--
2.5.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-09-09 12:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 12:21 [PATCH 0/5] DRM Cleanups David Herrmann
2015-09-09 12:21 ` David Herrmann [this message]
2015-09-09 12:21 ` [PATCH 2/5] drm: move drm_class into drm_sysfs.c David Herrmann
2015-09-09 13:16 ` Daniel Vetter
2015-09-09 12:21 ` [PATCH 3/5] drm: cleanup drm_core_{init,exit}() David Herrmann
2015-09-09 13:11 ` Daniel Vetter
2015-09-09 13:19 ` David Herrmann
2015-09-09 12:21 ` [PATCH 4/5] drm: drop obsolete drm_core.h David Herrmann
2015-09-09 12:21 ` [PATCH 5/5] drm: allocate kernel mode-object IDs in cyclic fashion David Herrmann
2015-09-09 13:03 ` Daniel Vetter
2015-09-11 9:47 ` David Herrmann
2015-09-11 12:14 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1441801293-1440-2-git-send-email-dh.herrmann@gmail.com \
--to=dh.herrmann@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox