Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_witness.c
| Show First 20 Lines • Show All 2,130 Lines • ▼ Show 20 Lines | if (lock_list != NULL && lock_list->ll_count != 0) { | ||||||||
| va_start(ap, fmt); | va_start(ap, fmt); | ||||||||
| vprintf(fmt, ap); | vprintf(fmt, ap); | ||||||||
| va_end(ap); | va_end(ap); | ||||||||
| printf(" with the following %slocks held:\n", | printf(" with the following %slocks held:\n", | ||||||||
| (flags & WARN_SLEEPOK) != 0 ? "non-sleepable " : ""); | (flags & WARN_SLEEPOK) != 0 ? "non-sleepable " : ""); | ||||||||
| n += witness_list_locks(&lock_list, printf); | n += witness_list_locks(&lock_list, printf); | ||||||||
| } else | } else | ||||||||
| sched_unpin(); | sched_unpin(); | ||||||||
| if (td->td_no_sleeping != 0 && (flags & WARN_SLEEPOK) != 0) { | |||||||||
kib: IMO it is cleaner to inline THREAD_CAN_SLEEP() because the whole function operates on td.
The… | |||||||||
| va_start(ap, fmt); | |||||||||
| vprintf(fmt, ap); | |||||||||
| va_end(ap); | |||||||||
| printf(" with %d sleep inhibitors\n", td->td_no_sleeping); | |||||||||
Not Done Inline Actions
markj: | |||||||||
| n += td->td_no_sleeping; | |||||||||
| } | |||||||||
| if (flags & WARN_PANIC && n) | if (flags & WARN_PANIC && n) | ||||||||
| kassert_panic("%s", __func__); | kassert_panic("%s", __func__); | ||||||||
| else | else | ||||||||
| witness_debugger(n, __func__); | witness_debugger(n, __func__); | ||||||||
| return (n); | return (n); | ||||||||
| } | } | ||||||||
| const char * | const char * | ||||||||
| ▲ Show 20 Lines • Show All 1,324 Lines • Show Last 20 Lines | |||||||||
IMO it is cleaner to inline THREAD_CAN_SLEEP() because the whole function operates on td.
The right hand of && is not style-compliant.