aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lnet/lnet/lib-md.c
diff options
context:
space:
mode:
authorJames Simmons <jsimmons@infradead.org>2016-02-12 12:06:08 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-14 16:20:32 -0800
commit06ace26edc140034c7f340bf41b9a2f8cbb2a3ba (patch)
tree79376fd33728881be2f05d647c195bd8e6f418df /drivers/staging/lustre/lnet/lnet/lib-md.c
parentstaging: lustre: balance braces properly in LNet layer (diff)
downloadlinux-dev-06ace26edc140034c7f340bf41b9a2f8cbb2a3ba.tar.xz
linux-dev-06ace26edc140034c7f340bf41b9a2f8cbb2a3ba.zip
staging: lustre: fix all NULL comparisons in LNet layer
This removes every instance of checking a variable against NULL in the LNet source code. Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lnet/lnet/lib-md.c')
-rw-r--r--drivers/staging/lustre/lnet/lnet/lib-md.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c b/drivers/staging/lustre/lnet/lnet/lib-md.c
index 55bd7a1f7a5d..490edfb7cacb 100644
--- a/drivers/staging/lustre/lnet/lnet/lib-md.c
+++ b/drivers/staging/lustre/lnet/lnet/lib-md.c
@@ -57,7 +57,7 @@ lnet_md_unlink(lnet_libmd_t *md)
* and unlink it if it was created
* with LNET_UNLINK
*/
- if (me != NULL) {
+ if (me) {
/* detach MD from portal */
lnet_ptl_detach_md(me, md);
if (me->me_unlink == LNET_UNLINK)
@@ -75,7 +75,7 @@ lnet_md_unlink(lnet_libmd_t *md)
CDEBUG(D_NET, "Unlinking md %p\n", md);
- if (md->md_eq != NULL) {
+ if (md->md_eq) {
int cpt = lnet_cpt_of_cookie(md->md_lh.lh_cookie);
LASSERT(*md->md_eq->eq_refs[cpt] > 0);
@@ -187,7 +187,7 @@ lnet_md_link(lnet_libmd_t *md, lnet_handle_eq_t eq_handle, int cpt)
* TODO - reevaluate what should be here in light of
* the removal of the start and end events
* maybe there we shouldn't even allow LNET_EQ_NONE!)
- * LASSERT (eq == NULL);
+ * LASSERT(!eq);
*/
if (!LNetHandleIsInvalid(eq_handle)) {
md->md_eq = lnet_handle2eq(&eq_handle);
@@ -306,7 +306,7 @@ LNetMDAttach(lnet_handle_me_t meh, lnet_md_t umd,
me = lnet_handle2me(&meh);
if (!me)
rc = -ENOENT;
- else if (me->me_md != NULL)
+ else if (me->me_md)
rc = -EBUSY;
else
rc = lnet_md_link(md, umd.eq_handle, cpt);
@@ -453,7 +453,7 @@ LNetMDUnlink(lnet_handle_md_t mdh)
* when the LND is done, the completion event flags that the MD was
* unlinked. Otherwise, we enqueue an event now...
*/
- if (md->md_eq != NULL && md->md_refcount == 0) {
+ if (md->md_eq && md->md_refcount == 0) {
lnet_build_unlink_event(md, &ev);
lnet_eq_enqueue_event(md->md_eq, &ev);
}