static const char *unknown_error = "unknown error";
 
+static int ibmvfc_check_caps(struct ibmvfc_host *vhost, unsigned long cap_flags)
+{
+       u64 host_caps = be64_to_cpu(vhost->login_buf->resp.capabilities);
+
+       return (host_caps & cap_flags) ? 1 : 0;
+}
+
 #ifdef CONFIG_SCSI_IBMVFC_TRACE
 /**
  * ibmvfc_trc_start - Log a start trace entry
                tmf->common.length = cpu_to_be16(sizeof(*tmf));
                tmf->scsi_id = cpu_to_be64(rport->port_id);
                int_to_scsilun(sdev->lun, &tmf->lun);
-               if (!(be64_to_cpu(vhost->login_buf->resp.capabilities) & IBMVFC_CAN_SUPPRESS_ABTS))
+               if (!ibmvfc_check_caps(vhost, IBMVFC_CAN_SUPPRESS_ABTS))
                        type &= ~IBMVFC_TMF_SUPPRESS_ABTS;
                if (vhost->state == IBMVFC_ACTIVE)
                        tmf->flags = cpu_to_be32((type | IBMVFC_TMF_LUA_VALID));