Commit 6a9f7487 authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman

staging/lustre/fid: Adjust NULL comparison codestyle

All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2cbdaa45
...@@ -68,7 +68,7 @@ static int seq_client_rpc(struct lu_client_seq *seq, ...@@ -68,7 +68,7 @@ static int seq_client_rpc(struct lu_client_seq *seq,
req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), &RQF_SEQ_QUERY, req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp), &RQF_SEQ_QUERY,
LUSTRE_MDS_VERSION, SEQ_QUERY); LUSTRE_MDS_VERSION, SEQ_QUERY);
if (req == NULL) if (!req)
return -ENOMEM; return -ENOMEM;
/* Init operation code */ /* Init operation code */
...@@ -226,8 +226,8 @@ int seq_client_alloc_fid(const struct lu_env *env, ...@@ -226,8 +226,8 @@ int seq_client_alloc_fid(const struct lu_env *env,
wait_queue_t link; wait_queue_t link;
int rc; int rc;
LASSERT(seq != NULL); LASSERT(seq);
LASSERT(fid != NULL); LASSERT(fid);
init_waitqueue_entry(&link, current); init_waitqueue_entry(&link, current);
mutex_lock(&seq->lcs_mutex); mutex_lock(&seq->lcs_mutex);
...@@ -292,7 +292,7 @@ void seq_client_flush(struct lu_client_seq *seq) ...@@ -292,7 +292,7 @@ void seq_client_flush(struct lu_client_seq *seq)
{ {
wait_queue_t link; wait_queue_t link;
LASSERT(seq != NULL); LASSERT(seq);
init_waitqueue_entry(&link, current); init_waitqueue_entry(&link, current);
mutex_lock(&seq->lcs_mutex); mutex_lock(&seq->lcs_mutex);
...@@ -375,8 +375,8 @@ static int seq_client_init(struct lu_client_seq *seq, ...@@ -375,8 +375,8 @@ static int seq_client_init(struct lu_client_seq *seq,
{ {
int rc; int rc;
LASSERT(seq != NULL); LASSERT(seq);
LASSERT(prefix != NULL); LASSERT(prefix);
seq->lcs_type = type; seq->lcs_type = type;
...@@ -438,7 +438,7 @@ int client_fid_fini(struct obd_device *obd) ...@@ -438,7 +438,7 @@ int client_fid_fini(struct obd_device *obd)
{ {
struct client_obd *cli = &obd->u.cli; struct client_obd *cli = &obd->u.cli;
if (cli->cl_seq != NULL) { if (cli->cl_seq) {
seq_client_fini(cli->cl_seq); seq_client_fini(cli->cl_seq);
kfree(cli->cl_seq); kfree(cli->cl_seq);
cli->cl_seq = NULL; cli->cl_seq = NULL;
......
...@@ -66,7 +66,7 @@ ldebugfs_fid_write_common(const char __user *buffer, size_t count, ...@@ -66,7 +66,7 @@ ldebugfs_fid_write_common(const char __user *buffer, size_t count,
int rc; int rc;
char kernbuf[MAX_FID_RANGE_STRLEN]; char kernbuf[MAX_FID_RANGE_STRLEN];
LASSERT(range != NULL); LASSERT(range);
if (count >= sizeof(kernbuf)) if (count >= sizeof(kernbuf))
return -EINVAL; return -EINVAL;
...@@ -104,7 +104,6 @@ ldebugfs_fid_space_seq_write(struct file *file, ...@@ -104,7 +104,6 @@ ldebugfs_fid_space_seq_write(struct file *file,
int rc; int rc;
seq = ((struct seq_file *)file->private_data)->private; seq = ((struct seq_file *)file->private_data)->private;
LASSERT(seq != NULL);
mutex_lock(&seq->lcs_mutex); mutex_lock(&seq->lcs_mutex);
rc = ldebugfs_fid_write_common(buffer, count, &seq->lcs_space); rc = ldebugfs_fid_write_common(buffer, count, &seq->lcs_space);
...@@ -124,8 +123,6 @@ ldebugfs_fid_space_seq_show(struct seq_file *m, void *unused) ...@@ -124,8 +123,6 @@ ldebugfs_fid_space_seq_show(struct seq_file *m, void *unused)
{ {
struct lu_client_seq *seq = (struct lu_client_seq *)m->private; struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
LASSERT(seq != NULL);
mutex_lock(&seq->lcs_mutex); mutex_lock(&seq->lcs_mutex);
seq_printf(m, "[%#llx - %#llx]:%x:%s\n", PRANGE(&seq->lcs_space)); seq_printf(m, "[%#llx - %#llx]:%x:%s\n", PRANGE(&seq->lcs_space));
mutex_unlock(&seq->lcs_mutex); mutex_unlock(&seq->lcs_mutex);
...@@ -143,7 +140,6 @@ ldebugfs_fid_width_seq_write(struct file *file, ...@@ -143,7 +140,6 @@ ldebugfs_fid_width_seq_write(struct file *file,
int rc, val; int rc, val;
seq = ((struct seq_file *)file->private_data)->private; seq = ((struct seq_file *)file->private_data)->private;
LASSERT(seq != NULL);
rc = lprocfs_write_helper(buffer, count, &val); rc = lprocfs_write_helper(buffer, count, &val);
if (rc) if (rc)
...@@ -172,8 +168,6 @@ ldebugfs_fid_width_seq_show(struct seq_file *m, void *unused) ...@@ -172,8 +168,6 @@ ldebugfs_fid_width_seq_show(struct seq_file *m, void *unused)
{ {
struct lu_client_seq *seq = (struct lu_client_seq *)m->private; struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
LASSERT(seq != NULL);
mutex_lock(&seq->lcs_mutex); mutex_lock(&seq->lcs_mutex);
seq_printf(m, "%llu\n", seq->lcs_width); seq_printf(m, "%llu\n", seq->lcs_width);
mutex_unlock(&seq->lcs_mutex); mutex_unlock(&seq->lcs_mutex);
...@@ -186,8 +180,6 @@ ldebugfs_fid_fid_seq_show(struct seq_file *m, void *unused) ...@@ -186,8 +180,6 @@ ldebugfs_fid_fid_seq_show(struct seq_file *m, void *unused)
{ {
struct lu_client_seq *seq = (struct lu_client_seq *)m->private; struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
LASSERT(seq != NULL);
mutex_lock(&seq->lcs_mutex); mutex_lock(&seq->lcs_mutex);
seq_printf(m, DFID "\n", PFID(&seq->lcs_fid)); seq_printf(m, DFID "\n", PFID(&seq->lcs_fid));
mutex_unlock(&seq->lcs_mutex); mutex_unlock(&seq->lcs_mutex);
...@@ -201,9 +193,7 @@ ldebugfs_fid_server_seq_show(struct seq_file *m, void *unused) ...@@ -201,9 +193,7 @@ ldebugfs_fid_server_seq_show(struct seq_file *m, void *unused)
struct lu_client_seq *seq = (struct lu_client_seq *)m->private; struct lu_client_seq *seq = (struct lu_client_seq *)m->private;
struct client_obd *cli; struct client_obd *cli;
LASSERT(seq != NULL); if (seq->lcs_exp) {
if (seq->lcs_exp != NULL) {
cli = &seq->lcs_exp->exp_obd->u.cli; cli = &seq->lcs_exp->exp_obd->u.cli;
seq_printf(m, "%s\n", cli->cl_target_uuid.uuid); seq_printf(m, "%s\n", cli->cl_target_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