Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
@@ -1797,11 +1797,11 @@
if (qlt->fw_code01) {
kmem_free(qlt->fw_code01, (qlt->fw_length01 +
qlt->fw_length02) << 2);
qlt->fw_code01 = NULL;
} else {
- atomic_add_32(&qlt_loaded_counter, 1);
+ atomic_inc_32(&qlt_loaded_counter);
}
qlt->fw_length01 = intp[3];
qlt->fw_code01 = (uint32_t *)kmem_alloc(iocd->stmf_ibuf_size,
KM_SLEEP);
bcopy(intp, qlt->fw_code01, iocd->stmf_ibuf_size);
@@ -1814,11 +1814,11 @@
case QLT_IOCTL_CLEAR_FW:
if (qlt->fw_code01) {
kmem_free(qlt->fw_code01, (qlt->fw_length01 +
qlt->fw_length02) << 2);
qlt->fw_code01 = NULL;
- atomic_add_32(&qlt_loaded_counter, -1);
+ atomic_dec_32(&qlt_loaded_counter);
}
break;
case QLT_IOCTL_GET_FW_INFO:
if (iocd->stmf_obuf_size != sizeof (qlt_fw_info_t)) {
@@ -4669,11 +4669,11 @@
return (FCT_NOT_FOUND);
}
#ifdef DEBUG
if (qlt_drop_abort_counter > 0) {
- if (atomic_add_32_nv(&qlt_drop_abort_counter, -1) == 1)
+ if (atomic_dec_32_nv(&qlt_drop_abort_counter) == 1)
return (FCT_SUCCESS);
}
#endif
if (cmd->cmd_type == FCT_CMD_FCP_XCHG) {