Commit 10fa8acf authored by J. Bruce Fields's avatar J. Bruce Fields

nfsd: Remove unnecessary NULL checks

"cb" is never actually NULL in these functions.

On a quick skim of the history, they seem to have been there from the
beginning.  I'm not sure if they originally served a purpose.
Reported-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 4f375483
...@@ -512,11 +512,9 @@ static int nfs4_xdr_dec_cb_recall(struct rpc_rqst *rqstp, ...@@ -512,11 +512,9 @@ static int nfs4_xdr_dec_cb_recall(struct rpc_rqst *rqstp,
if (unlikely(status)) if (unlikely(status))
return status; return status;
if (cb != NULL) { status = decode_cb_sequence4res(xdr, cb);
status = decode_cb_sequence4res(xdr, cb); if (unlikely(status || cb->cb_seq_status))
if (unlikely(status || cb->cb_seq_status)) return status;
return status;
}
return decode_cb_op_status(xdr, OP_CB_RECALL, &cb->cb_status); return decode_cb_op_status(xdr, OP_CB_RECALL, &cb->cb_status);
} }
...@@ -604,11 +602,10 @@ static int nfs4_xdr_dec_cb_layout(struct rpc_rqst *rqstp, ...@@ -604,11 +602,10 @@ static int nfs4_xdr_dec_cb_layout(struct rpc_rqst *rqstp,
if (unlikely(status)) if (unlikely(status))
return status; return status;
if (cb) { status = decode_cb_sequence4res(xdr, cb);
status = decode_cb_sequence4res(xdr, cb); if (unlikely(status || cb->cb_seq_status))
if (unlikely(status || cb->cb_seq_status)) return status;
return status;
}
return decode_cb_op_status(xdr, OP_CB_LAYOUTRECALL, &cb->cb_status); return decode_cb_op_status(xdr, OP_CB_LAYOUTRECALL, &cb->cb_status);
} }
#endif /* CONFIG_NFSD_PNFS */ #endif /* CONFIG_NFSD_PNFS */
...@@ -663,11 +660,10 @@ static int nfs4_xdr_dec_cb_notify_lock(struct rpc_rqst *rqstp, ...@@ -663,11 +660,10 @@ static int nfs4_xdr_dec_cb_notify_lock(struct rpc_rqst *rqstp,
if (unlikely(status)) if (unlikely(status))
return status; return status;
if (cb) { status = decode_cb_sequence4res(xdr, cb);
status = decode_cb_sequence4res(xdr, cb); if (unlikely(status || cb->cb_seq_status))
if (unlikely(status || cb->cb_seq_status)) return status;
return status;
}
return decode_cb_op_status(xdr, OP_CB_NOTIFY_LOCK, &cb->cb_status); return decode_cb_op_status(xdr, OP_CB_NOTIFY_LOCK, &cb->cb_status);
} }
...@@ -759,11 +755,10 @@ static int nfs4_xdr_dec_cb_offload(struct rpc_rqst *rqstp, ...@@ -759,11 +755,10 @@ static int nfs4_xdr_dec_cb_offload(struct rpc_rqst *rqstp,
if (unlikely(status)) if (unlikely(status))
return status; return status;
if (cb) { status = decode_cb_sequence4res(xdr, cb);
status = decode_cb_sequence4res(xdr, cb); if (unlikely(status || cb->cb_seq_status))
if (unlikely(status || cb->cb_seq_status)) return status;
return status;
}
return decode_cb_op_status(xdr, OP_CB_OFFLOAD, &cb->cb_status); return decode_cb_op_status(xdr, OP_CB_OFFLOAD, &cb->cb_status);
} }
/* /*
......
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