This function never fails.
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 75323 Build 72206: arc lint + arc unit
Event Timeline
| usr.sbin/bhyve/pci_emul.c | ||
|---|---|---|
| 802 | Alternatively, we could make all these assert()'s instead return an error. I add some more assertions in subsequent changes, so turning these into errors would be ok instead if we preferred that. | |
| usr.sbin/bhyve/pci_emul.c | ||
|---|---|---|
| 802 | I like using assertions if we're really sure the asserted condition really is always true. If an error can happen with certain combinations of parameters and not others, I prefer to have separate functions which return a value, or not, depending on whether an error can occur. | |
| 828 | This could fail, but the only reasonable thing to do here is err() anyway. | |
| usr.sbin/bhyve/pci_emul.c | ||
|---|---|---|
| 802 | These are generally all assertions (as well as ones I add in future changes) that indicate programmer errors passing in invalid constants (and not user-supplied input), so assertions is probably fine. | |