Skip to content

Commit a664bdc

Browse files
committed
drivers: ethernet: stm32: clean HAL_ETH_{Set|Get}DMAError() value test
Clean tests on HAL_ETH_SetDMAError() and HAL_ETH_GetDMAError() return value to explicitly test against 0. Signed-off-by: Etienne Carriere <[email protected]>
1 parent 9cf71bb commit a664bdc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/ethernet/eth_stm32_hal_v2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ int eth_stm32_tx(const struct device *dev, struct net_pkt *pkt)
257257
}
258258

259259
/* Check for DMA errors */
260-
if (HAL_ETH_GetDMAError(heth)) {
260+
if (HAL_ETH_GetDMAError(heth) != 0U) {
261261
LOG_ERR("%s: ETH DMA error: dmaerror:%x",
262262
__func__,
263263
HAL_ETH_GetDMAError(heth));
@@ -266,7 +266,7 @@ int eth_stm32_tx(const struct device *dev, struct net_pkt *pkt)
266266
}
267267

268268
/* Check for MAC errors */
269-
if (HAL_ETH_GetMACError(heth)) {
269+
if (HAL_ETH_GetMACError(heth) != 0U) {
270270
LOG_ERR("%s: ETH MAC error: macerror:%x",
271271
__func__,
272272
HAL_ETH_GetMACError(heth));

0 commit comments

Comments
 (0)