Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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: 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>

authored by

Heiko Carstens and committed by
James Bottomley
862794fa be521466

+6 -4
+6 -4
drivers/s390/scsi/zfcp_fsf.c
··· 299 299 } 300 300 301 301 /* log additional information provided by FSF (if any) */ 302 - if (unlikely(qtcb->header.log_length)) { 302 + if (likely(qtcb->header.log_length)) { 303 303 /* do not trust them ;-) */ 304 - if (qtcb->header.log_start > sizeof(struct fsf_qtcb)) { 304 + if (unlikely(qtcb->header.log_start > 305 + sizeof(struct fsf_qtcb))) { 305 306 ZFCP_LOG_NORMAL 306 307 ("bug: ULP (FSF logging) log data starts " 307 308 "beyond end of packet header. Ignored. " ··· 311 310 sizeof(struct fsf_qtcb)); 312 311 goto forget_log; 313 312 } 314 - if ((size_t) (qtcb->header.log_start + qtcb->header.log_length) 315 - > sizeof(struct fsf_qtcb)) { 313 + if (unlikely((size_t) (qtcb->header.log_start + 314 + qtcb->header.log_length) > 315 + sizeof(struct fsf_qtcb))) { 316 316 ZFCP_LOG_NORMAL("bug: ULP (FSF logging) log data ends " 317 317 "beyond end of packet header. Ignored. " 318 318 "(start=%i, length=%i, size=%li)\n",