-
Notifications
You must be signed in to change notification settings - Fork 8.2k
include: zephyr: APIs doc: fix Doxygen \retval command usage #98324
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
base: main
Are you sure you want to change the base?
Changes from all commits
b497b02
c1d25b2
12a7223
83cde8b
2b61f08
2a5f222
e78c800
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -275,7 +275,7 @@ void isotp_unbind(struct isotp_recv_ctx *rctx); | |
| * @param len Size of the buffer. | ||
| * @param timeout Timeout for incoming data. | ||
| * | ||
| * @retval Number of bytes copied on success | ||
| * @return Number of bytes copied on success | ||
| * @retval ISOTP_RECV_TIMEOUT when "timeout" timed out | ||
| * @retval ISOTP_N_* on error | ||
|
Comment on lines
+278
to
280
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit curious to use both
Although it may be better to have something like
(from e.g. https://man7.org/linux/man-pages/man2/send.2.html)
i.e. making it clear that it either returns a value, or a set of errors. I don't see anything in doxygen that supports this though - @kartben thoughts?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah the combination of
Yeah probably not supported. I think "Returns" vs. "Returns values" is already not so bad though?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't think it is bad, I just think "Return Value" and "Errors" is better :) |
||
| */ | ||
|
|
@@ -295,7 +295,7 @@ int isotp_recv(struct isotp_recv_ctx *rctx, uint8_t *data, size_t len, k_timeout | |
| * @param buffer Pointer where the net_buf pointer is written to. | ||
| * @param timeout Timeout for incoming data. | ||
| * | ||
| * @retval Remaining data length for this transfer if BS > 0, 0 for BS = 0 | ||
| * @return Remaining data length for this transfer if BS > 0, 0 for BS = 0 | ||
| * @retval ISOTP_RECV_TIMEOUT when "timeout" timed out | ||
| * @retval ISOTP_N_* on error | ||
| */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -237,7 +237,7 @@ __subsystem struct cellular_driver_api { | |
| * @retval 0 if successful. | ||
| * @retval -EINVAL if any provided cellular network configuration is invalid or unsupported. | ||
| * @retval -ENOTSUP if API is not supported by cellular network device. | ||
| * @retval Negative errno-code otherwise. | ||
| * @retval <0 Negative errno-code otherwise. | ||
|
Comment on lines
237
to
+240
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also a bit weird where only a subset of the error codes are defined. |
||
| */ | ||
| static inline int cellular_configure_networks(const struct device *dev, | ||
| const struct cellular_network *networks, uint8_t size) | ||
|
|
@@ -260,7 +260,7 @@ static inline int cellular_configure_networks(const struct device *dev, | |
| * | ||
| * @retval 0 if successful. | ||
| * @retval -ENOTSUP if API is not supported by cellular network device. | ||
| * @retval Negative errno-code otherwise. | ||
| * @retval <0 Negative errno-code otherwise. | ||
| */ | ||
| static inline int cellular_get_supported_networks(const struct device *dev, | ||
| const struct cellular_network **networks, | ||
|
|
@@ -285,7 +285,7 @@ static inline int cellular_get_supported_networks(const struct device *dev, | |
| * @retval 0 if successful. | ||
| * @retval -ENOTSUP if API is not supported by cellular network device. | ||
| * @retval -ENODATA if device is not in a state where signal can be polled | ||
| * @retval Negative errno-code otherwise. | ||
| * @retval <0 Negative errno-code otherwise. | ||
| */ | ||
| static inline int cellular_get_signal(const struct device *dev, | ||
| const enum cellular_signal_type type, int16_t *value) | ||
|
|
@@ -310,7 +310,7 @@ static inline int cellular_get_signal(const struct device *dev, | |
| * @retval 0 if successful. | ||
| * @retval -ENOTSUP if API is not supported by cellular network device. | ||
| * @retval -ENODATA if modem does not provide info requested | ||
| * @retval Negative errno-code from chat module otherwise. | ||
| * @retval <0 Negative errno-code from chat module otherwise. | ||
| */ | ||
| static inline int cellular_get_modem_info(const struct device *dev, | ||
| const enum cellular_modem_info_type type, char *info, | ||
|
|
@@ -335,7 +335,7 @@ static inline int cellular_get_modem_info(const struct device *dev, | |
| * @retval 0 if successful. | ||
| * @retval -ENOSYS if API is not supported by cellular network device. | ||
| * @retval -ENODATA if modem does not provide info requested | ||
| * @retval Negative errno-code from chat module otherwise. | ||
| * @retval <0 Negative errno-code from chat module otherwise. | ||
| */ | ||
| static inline int cellular_get_registration_status(const struct device *dev, | ||
| enum cellular_access_technology tech, | ||
|
|
@@ -364,7 +364,7 @@ static inline int cellular_get_registration_status(const struct device *dev, | |
| * @retval -EINVAL if APN string invalid or too long. | ||
| * @retval -EALREADY if APN identical to current one, nothing to do | ||
| * @retval -EBUSY if modem is already dialled, APN cannot be changed | ||
| * @retval Negative errno-code otherwise. | ||
| * @retval <0 Negative errno-code otherwise. | ||
| */ | ||
| static inline int cellular_set_apn(const struct device *dev, const char *apn) | ||
| { | ||
|
|
||


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.
Since you are already touching so many
@retvals, consider if it makes sense to fully fix some of the issues with@retvalin the documentation: #65974E.g. these need to be
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.
There was a 1st attempt in #97876, but closed it since the changes seemed to be somewhat controversial & it was going to take considerable time to address each case individually.