There is some code duplication in error handling paths in a few functions.
Create a function for printing such errors in human-readable way and get rid
of duplicates.
Details
Details
- Reviewers
imp - Commits
- rS345776: Refactor error handling
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
make sure all the places you've put the mmc_handle_reply can handle errno-type errors. There's at least one that can't.
sys/cam/mmc/mmc_da.c | ||
---|---|---|
241 ↗ | (On Diff #44101) | I'd consider making this a kassert. |
822 ↗ | (On Diff #44101) | My brain tells me you still need to check the error here, but reading code suggests we always set the ccb_h.status, so maybe that's OK. side note: cam_periph_runccb should grow stats support for MMC_IO transactions. |
825 ↗ | (On Diff #44101) | so mmc_handle_reply returns ERRNO type errors. but two lines below, you return MMC_ERR_FAILED. You can't mix and match like that. |
sys/cam/mmc/mmc_da.c | ||
---|---|---|
822 ↗ | (On Diff #44101) | Opened https://github.com/kibab/freebsd/issues/13 for stats part. |
sys/cam/mmc/mmc_da.c | ||
---|---|---|
241 ↗ | (On Diff #55258) | I'd (a) line-wrap this at 80, (b) print func_code and possibly the ccb %p in the KASSERT; it makes debugging a lot easier if you hit it. |