Commit 2cbdaa45 authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman

staging/lustre/lmv: Adjust NULL comparison codestyle

All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"

Also remove some redundant assertions.
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 44b53f18
...@@ -69,7 +69,7 @@ static int lmv_intent_remote(struct obd_export *exp, void *lmm, ...@@ -69,7 +69,7 @@ static int lmv_intent_remote(struct obd_export *exp, void *lmm,
int rc = 0; int rc = 0;
body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY); body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
if (body == NULL) if (!body)
return -EPROTO; return -EPROTO;
LASSERT((body->valid & OBD_MD_MDS)); LASSERT((body->valid & OBD_MD_MDS));
...@@ -107,7 +107,7 @@ static int lmv_intent_remote(struct obd_export *exp, void *lmm, ...@@ -107,7 +107,7 @@ static int lmv_intent_remote(struct obd_export *exp, void *lmm,
op_data->op_fid1 = body->fid1; op_data->op_fid1 = body->fid1;
/* Sent the parent FID to the remote MDT */ /* Sent the parent FID to the remote MDT */
if (parent_fid != NULL) { if (parent_fid) {
/* The parent fid is only for remote open to /* The parent fid is only for remote open to
* check whether the open is from OBF, * check whether the open is from OBF,
* see mdt_cross_open */ * see mdt_cross_open */
...@@ -204,7 +204,7 @@ static int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data, ...@@ -204,7 +204,7 @@ static int lmv_intent_open(struct obd_export *exp, struct md_op_data *op_data,
return rc; return rc;
body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY); body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
if (body == NULL) if (!body)
return -EPROTO; return -EPROTO;
/* /*
* Not cross-ref case, just get out of here. * Not cross-ref case, just get out of here.
...@@ -270,7 +270,7 @@ static int lmv_intent_lookup(struct obd_export *exp, ...@@ -270,7 +270,7 @@ static int lmv_intent_lookup(struct obd_export *exp,
rc = md_intent_lock(tgt->ltd_exp, op_data, lmm, lmmsize, it, rc = md_intent_lock(tgt->ltd_exp, op_data, lmm, lmmsize, it,
flags, reqp, cb_blocking, extra_lock_flags); flags, reqp, cb_blocking, extra_lock_flags);
if (rc < 0 || *reqp == NULL) if (rc < 0 || !*reqp)
return rc; return rc;
/* /*
...@@ -278,7 +278,7 @@ static int lmv_intent_lookup(struct obd_export *exp, ...@@ -278,7 +278,7 @@ static int lmv_intent_lookup(struct obd_export *exp,
* remote inode. Let's check this. * remote inode. Let's check this.
*/ */
body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY); body = req_capsule_server_get(&(*reqp)->rq_pill, &RMF_MDT_BODY);
if (body == NULL) if (!body)
return -EPROTO; return -EPROTO;
/* Not cross-ref case, just get out of here. */ /* Not cross-ref case, just get out of here. */
if (likely(!(body->valid & OBD_MD_MDS))) if (likely(!(body->valid & OBD_MD_MDS)))
...@@ -299,7 +299,6 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data, ...@@ -299,7 +299,6 @@ int lmv_intent_lock(struct obd_export *exp, struct md_op_data *op_data,
struct obd_device *obd = exp->exp_obd; struct obd_device *obd = exp->exp_obd;
int rc; int rc;
LASSERT(it != NULL);
LASSERT(fid_is_sane(&op_data->op_fid1)); LASSERT(fid_is_sane(&op_data->op_fid1));
CDEBUG(D_INODE, "INTENT LOCK '%s' for '%*s' on "DFID"\n", CDEBUG(D_INODE, "INTENT LOCK '%s' for '%*s' on "DFID"\n",
......
...@@ -66,7 +66,7 @@ static inline struct lmv_stripe_md *lmv_get_mea(struct ptlrpc_request *req) ...@@ -66,7 +66,7 @@ static inline struct lmv_stripe_md *lmv_get_mea(struct ptlrpc_request *req)
struct mdt_body *body; struct mdt_body *body;
struct lmv_stripe_md *mea; struct lmv_stripe_md *mea;
LASSERT(req != NULL); LASSERT(req);
body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY); body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
...@@ -75,8 +75,6 @@ static inline struct lmv_stripe_md *lmv_get_mea(struct ptlrpc_request *req) ...@@ -75,8 +75,6 @@ static inline struct lmv_stripe_md *lmv_get_mea(struct ptlrpc_request *req)
mea = req_capsule_server_sized_get(&req->rq_pill, &RMF_MDT_MD, mea = req_capsule_server_sized_get(&req->rq_pill, &RMF_MDT_MD,
body->eadatasize); body->eadatasize);
LASSERT(mea != NULL);
if (mea->mea_count == 0) if (mea->mea_count == 0)
return NULL; return NULL;
if (mea->mea_magic != MEA_MAGIC_LAST_CHAR && if (mea->mea_magic != MEA_MAGIC_LAST_CHAR &&
...@@ -101,7 +99,7 @@ lmv_get_target(struct lmv_obd *lmv, u32 mds) ...@@ -101,7 +99,7 @@ lmv_get_target(struct lmv_obd *lmv, u32 mds)
int i; int i;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
if (lmv->tgts[i] == NULL) if (!lmv->tgts[i])
continue; continue;
if (lmv->tgts[i]->ltd_idx == mds) if (lmv->tgts[i]->ltd_idx == mds)
......
This diff is collapsed.
...@@ -138,7 +138,7 @@ static int lmv_desc_uuid_seq_show(struct seq_file *m, void *v) ...@@ -138,7 +138,7 @@ static int lmv_desc_uuid_seq_show(struct seq_file *m, void *v)
struct obd_device *dev = (struct obd_device *)m->private; struct obd_device *dev = (struct obd_device *)m->private;
struct lmv_obd *lmv; struct lmv_obd *lmv;
LASSERT(dev != NULL); LASSERT(dev);
lmv = &dev->u.lmv; lmv = &dev->u.lmv;
seq_printf(m, "%s\n", lmv->desc.ld_uuid.uuid); seq_printf(m, "%s\n", lmv->desc.ld_uuid.uuid);
return 0; return 0;
...@@ -171,7 +171,7 @@ static int lmv_tgt_seq_show(struct seq_file *p, void *v) ...@@ -171,7 +171,7 @@ static int lmv_tgt_seq_show(struct seq_file *p, void *v)
{ {
struct lmv_tgt_desc *tgt = v; struct lmv_tgt_desc *tgt = v;
if (tgt == NULL) if (!tgt)
return 0; return 0;
seq_printf(p, "%d: %s %sACTIVE\n", seq_printf(p, "%d: %s %sACTIVE\n",
tgt->ltd_idx, tgt->ltd_uuid.uuid, tgt->ltd_idx, tgt->ltd_uuid.uuid,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment