This is in preparation for annotating copyin() and related functions
with __result_use_check.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 55142 Build 52031: arc lint + arc unit
Event Timeline
sys/dev/bnxt/if_bnxt.c | ||
---|---|---|
2571 | Why the void cast here and below? |
sys/dev/bnxt/if_bnxt.c | ||
---|---|---|
2571 | In this code path, the ioctl is already going to return an error (rc != 0). Here, we are copying out the return code directly for some reason; if that fails, I don't want to clobber the existing error. That's a general pattern that driver ioctl handlers tend to follow. (I should have made this more clear in the commit message and will amend it.) |
sys/dev/bnxt/if_bnxt.c | ||
---|---|---|
2571 | ah yes. so it does. A mention in the commit is fine. |
sys/dev/bnxt/if_bnxt.c | ||
---|---|---|
2571 | I realized that the new behaviour is a bit incompatible with the old one. Before this patch, if the ioctl returned an error, we'd copy the error out and then return 0 (the old code always sets rc = 0). That's a weird convention, but it's not my intention to change it. |
Preserve old error handling semantics. If the ioctl operation fails,
we copy out the error number. If that fails, we return the error from
copyout().