-
Notifications
You must be signed in to change notification settings - Fork 8k
drivers: ethernet: stm32: HAL return value handling #97281
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?
drivers: ethernet: stm32: HAL return value handling #97281
Conversation
drivers/ethernet/eth_stm32_hal_v2.c
Outdated
{ | ||
__ASSERT_NO_MSG(heth != NULL); | ||
ETH_MACFilterConfigTypeDef MACFilterConf; | ||
HAL_StatusTypeDef hal_ret; |
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.
Might need __maybe_unused
because value is never consumed w/o asserts enabled (let's see what CI has to say)
drivers/ethernet/eth_stm32_hal_v2.c
Outdated
HAL_ETH_GetMACConfig(heth, &mac_config); | ||
if (HAL_ETH_GetMACConfig(heth, &mac_config) != HAL_OK) { | ||
LOG_ERR("HAL_ETH_GetMACConfig: failed: %d", hal_ret); | ||
ASSERT_NO_MSG(0); |
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.
ASSERT_NO_MSG(0); | |
__ASSERT_NO_MSG(0); |
?
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.
Typo in commit message for drivers: ethernet: stm32: clean HAL_ETH_{Set|Get}DMAError() value test
retrun
--> return
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.
and I guess nvm, it returns a u32test against 0
==> against HAL_OK
too
Add missing test of some HAL functions return value Signed-off-by: Etienne Carriere <[email protected]>
Clean tests on HAL_ETH_SetDMAError() and HAL_ETH_GetDMAError() return value to explicitly test against 0. Signed-off-by: Etienne Carriere <[email protected]>
Add missing empty line between local variable definitions and instructions in eth_stm32_set_mac_config(). Signed-off-by: Etienne Carriere <[email protected]>
Correct mdio_stm32_read() and mdio_stm32_write() to return a valid errno instead of mixing HAL return values and errno return values. Signed-off-by: Etienne Carriere <[email protected]>
1eba6b1
to
07f54a5
Compare
|
Add missing test of some HAL functions return value in stm32 ethernet drivers.
Correct
mdio_stm32_read()
andmdio_stm32_write()
to return a valid errno instead of mixing HAL return values anderrno
return values.Plus some minor coding style issues fixes.