Skip to content

Commit

Permalink
[SCSI] zfcp: fix likely/unlikely usage
Browse files Browse the repository at this point in the history
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: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
heicarst authored and James Bottomley committed Mar 11, 2007
1 parent be52146 commit 862794f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/s390/scsi/zfcp_fsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,10 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
}

/* log additional information provided by FSF (if any) */
if (unlikely(qtcb->header.log_length)) {
if (likely(qtcb->header.log_length)) {
/* 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
("bug: ULP (FSF logging) log data starts "
"beyond end of packet header. Ignored. "
Expand All @@ -310,8 +311,9 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
sizeof(struct fsf_qtcb));
goto forget_log;
}
if ((size_t) (qtcb->header.log_start + qtcb->header.log_length)
> sizeof(struct fsf_qtcb)) {
if (unlikely((size_t) (qtcb->header.log_start +
qtcb->header.log_length) >
sizeof(struct fsf_qtcb))) {
ZFCP_LOG_NORMAL("bug: ULP (FSF logging) log data ends "
"beyond end of packet header. Ignored. "
"(start=%i, length=%i, size=%li)\n",
Expand Down

0 comments on commit 862794f

Please sign in to comment.