Page MenuHomeFreeBSD

Replace panic() with KASSERT in subr_blist.c
ClosedPublic

Authored by dougm on May 10 2019, 3:41 PM.
Tags
None
Referenced Files
F101330434: D20226.diff
Sun, Oct 27, 10:35 PM
Unknown Object (File)
Thu, Oct 24, 1:35 PM
Unknown Object (File)
Thu, Oct 24, 1:17 PM
Unknown Object (File)
Thu, Oct 24, 11:58 AM
Unknown Object (File)
Thu, Oct 24, 8:59 AM
Unknown Object (File)
Thu, Oct 24, 8:20 AM
Unknown Object (File)
Thu, Oct 24, 7:52 AM
Unknown Object (File)
Wed, Oct 23, 8:38 AM
Subscribers

Details

Summary

Replace panic() with KASSERT() and provide more useful information when failure happens.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

subr_blist.c
123

Did you consider using assert(3)?

289–290

Style: extra space after KASSERT.

Remove extra space.

subr_blist.c
123

The change from panic to KASSERT was driven entirely by my other mentor. I considered nothing.

subr_blist.c
290

What is maxcount ?

334

We ise %jx and uintmax_t for such cases. It is probably fine to cast count to int, but if the value is corrupted, it would hide the information by truncating.

Replace maxcount with count, %llx with %jx, and (long long) with (uintmax_t).

subr_blist.c
123

Mark means that you can implement KASSERT using assert(3), he does not suggest to use assert instead of KASSERT.

Use assert() for KASSERT in the blist test program.

This revision is now accepted and ready to land.May 10 2019, 5:51 PM
This revision was automatically updated to reflect the committed changes.