-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
netdev: fix return value and precondition doc #10101
Conversation
drivers/include/net/netdev.h
Outdated
* @return `-ENOTSUP` if @p opt is not configurable for the | ||
* device | ||
* @return `-EINVAL` if @p value is invalid an invalid value | ||
* for @p opt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence doesn't parse for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me neither. Only drank weak coffee before that so that might be the cause ;-).
(Just noticed: this is PR #10101 🎉) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, please squash
While reviewing RIOT-OS#9942 I noticed that the documentation on the netdev driver API is unclear and in some cases outright contradicting itself: > ``` > @return number of bytes used from @p value > @return `< 0` on error, 0 on success > ``` IMHO this is unacceptable for such a central API where communication This fixes a few things and also clarifies preconditions: - Specifies negative `errno`s clearly so all drivers return the same when required - Re-iterates parameter preconditions and special cases within the parameter documentation itself (might also help towards RIOT-OS#9805?) - Fixes contradictions within return value documentation - Adds missing parameter documentation on `init()`.
679f352
to
aba75be
Compare
Squashed |
Contribution description
While reviewing #9942 I noticed that the documentation on the netdev
driver API is unclear and in some cases outright contradicting itself:
IMHO this is unacceptable for such a central API where communication
This fixes a few things and also clarifies preconditions:
errno
s clearly so all drivers return the samewhen required
parameter documentation itself (might also help towards Misleading API in netdev driver #9805?)
init()
.Testing procedure
Compile documentation (
make doc
) and see if everything is alright indoc/doxygen/html/structnetdev__driver.html
.Issues/PRs references
Noticed in #9942. Might help clarify #9805.