Commit 862794fa authored by Heiko Carstens's avatar Heiko Carstens Committed by James Bottomley

[SCSI] zfcp: fix likely/unlikely usage

zfcp_fsf_protstatus_eval() takes always the 'wrong' branch.

Likely Profiling Results
 ---------------------------------------------------------
[+- ] Type | # True | # False | Function:Filename@Line
+unlikely  |   11042|        0  zfcp_fsf_protstatus_eval()
Acked-by: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent be521466
...@@ -299,9 +299,10 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) ...@@ -299,9 +299,10 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
} }
/* log additional information provided by FSF (if any) */ /* log additional information provided by FSF (if any) */
if (unlikely(qtcb->header.log_length)) { if (likely(qtcb->header.log_length)) {
/* do not trust them ;-) */ /* do not trust them ;-) */
if (qtcb->header.log_start > sizeof(struct fsf_qtcb)) { if (unlikely(qtcb->header.log_start >
sizeof(struct fsf_qtcb))) {
ZFCP_LOG_NORMAL ZFCP_LOG_NORMAL
("bug: ULP (FSF logging) log data starts " ("bug: ULP (FSF logging) log data starts "
"beyond end of packet header. Ignored. " "beyond end of packet header. Ignored. "
...@@ -310,8 +311,9 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req) ...@@ -310,8 +311,9 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
sizeof(struct fsf_qtcb)); sizeof(struct fsf_qtcb));
goto forget_log; goto forget_log;
} }
if ((size_t) (qtcb->header.log_start + qtcb->header.log_length) if (unlikely((size_t) (qtcb->header.log_start +
> sizeof(struct fsf_qtcb)) { qtcb->header.log_length) >
sizeof(struct fsf_qtcb))) {
ZFCP_LOG_NORMAL("bug: ULP (FSF logging) log data ends " ZFCP_LOG_NORMAL("bug: ULP (FSF logging) log data ends "
"beyond end of packet header. Ignored. " "beyond end of packet header. Ignored. "
"(start=%i, length=%i, size=%li)\n", "(start=%i, length=%i, size=%li)\n",
......
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