This function never fails.
Details
Details
- Reviewers
markj bnovkov chuck - Group Reviewers
bhyve - Commits
- rGb29dc5a30cce: bhyve: Return void from pci_emul_alloc_bar
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
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. | |