Print this page
5046 comstar: use the correct type instead of casting all the time
@@ -196,12 +196,12 @@
volatile int stmf_min_nworkers = 4;
volatile int stmf_worker_scale_down_delay = 20;
/* === [ Debugging and fault injection ] === */
#ifdef DEBUG
-volatile int stmf_drop_task_counter = 0;
-volatile int stmf_drop_buf_counter = 0;
+volatile uint32_t stmf_drop_task_counter = 0;
+volatile uint32_t stmf_drop_buf_counter = 0;
#endif
stmf_state_t stmf_state;
static stmf_lu_t *dlun0;
@@ -4611,12 +4611,11 @@
}
if (itask->itask_flags & ITASK_BEING_ABORTED)
return (STMF_ABORTED);
#ifdef DEBUG
if (!(ioflags & STMF_IOF_STATS_ONLY) && stmf_drop_buf_counter > 0) {
- if (atomic_dec_32_nv((uint32_t *)&stmf_drop_buf_counter) ==
- 1)
+ if (atomic_dec_32_nv(&stmf_drop_buf_counter) == 1)
return (STMF_SUCCESS);
}
#endif
stmf_update_kstat_lu_io(task, dbuf);
@@ -6340,15 +6339,13 @@
if (stmf_handle_cmd_during_ic(itask))
break;
}
#ifdef DEBUG
if (stmf_drop_task_counter > 0) {
- if (atomic_dec_32_nv((uint32_t *)&stmf_drop_task_counter) ==
- 1) {
+ if (atomic_dec_32_nv(&stmf_drop_task_counter) == 1)
break;
}
- }
#endif
DTRACE_PROBE1(scsi__task__start, scsi_task_t *, task);
lu->lu_new_task(task, dbuf);
break;
case ITASK_CMD_DATA_XFER_DONE: