Skip to content

Commit 522bfd5

Browse files
erwangojhedberg
authored andcommitted
drivers: ethernet: stm32: #include sections cleanup
Clean up headers includes section: - Remove conditional inclusions - zephyr/, then susbystem/, standardlib, locals - Sort alphabetically within these categories - Remove the ones already available through _priv.h Noticeable exception, lldp.h requires prior net_pkt.h inclusion Signed-off-by: Erwan Gouriou <[email protected]>
1 parent ca6e25a commit 522bfd5

File tree

5 files changed

+23
-38
lines changed

5 files changed

+23
-38
lines changed

drivers/ethernet/eth_stm32_hal_common.c

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,21 @@
55
* SPDX-License-Identifier: Apache-2.0
66
*/
77

8-
#include <zephyr/kernel.h>
98
#include <zephyr/device.h>
10-
#include <zephyr/sys/__assert.h>
11-
#include <zephyr/sys/util.h>
12-
#include <zephyr/sys/crc.h>
13-
#include <zephyr/net/net_pkt.h>
14-
#include <zephyr/net/net_if.h>
15-
#include <zephyr/net/ethernet.h>
16-
#include <zephyr/net/phy.h>
17-
#include <ethernet/eth_stats.h>
18-
#include <soc.h>
19-
#include <zephyr/sys/printk.h>
9+
#include <zephyr/drivers/hwinfo.h>
2010
#include <zephyr/drivers/pinctrl.h>
2111
#include <zephyr/irq.h>
22-
#include <zephyr/net/lldp.h>
23-
#include <zephyr/drivers/hwinfo.h>
2412
#include <zephyr/logging/log.h>
25-
26-
#if defined(CONFIG_NET_DSA_DEPRECATED)
2713
#include <zephyr/net/dsa.h>
28-
#endif
14+
#include <zephyr/net/net_if.h>
15+
#include <zephyr/net/net_pkt.h>
16+
#include <zephyr/net/lldp.h>
17+
#include <zephyr/net/phy.h>
18+
#include <zephyr/sys/crc.h>
19+
#include <zephyr/sys/printk.h>
20+
#include <zephyr/sys/util.h>
21+
#include <zephyr/sys/__assert.h>
22+
#include <ethernet/eth_stats.h>
2923

3024
#include "eth.h"
3125
#include "eth_stm32_hal_priv.h"

drivers/ethernet/eth_stm32_hal_priv.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010
#include <zephyr/drivers/clock_control.h>
1111
#include <zephyr/drivers/clock_control/stm32_clock_control.h>
12-
#include <zephyr/net/phy.h>
1312
#include <zephyr/kernel.h>
13+
#include <zephyr/net/ethernet.h>
14+
#include <zephyr/net/phy.h>
1415
#include <zephyr/types.h>
1516
#include <soc.h>
1617

drivers/ethernet/eth_stm32_hal_ptp.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
*/
88

99
#include <zephyr/device.h>
10-
#include <zephyr/drivers/clock_control.h>
11-
#include <zephyr/drivers/clock_control/stm32_clock_control.h>
1210
#include <zephyr/drivers/ptp_clock.h>
1311
#include <zephyr/logging/log.h>
1412
#include <zephyr/net/ethernet.h>

drivers/ethernet/eth_stm32_hal_v1.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,18 @@
77
*/
88

99
#include <zephyr/device.h>
10+
#include <zephyr/irq.h>
1011
#include <zephyr/logging/log.h>
11-
#include <zephyr/sys/__assert.h>
12+
#include <zephyr/net/ethernet.h>
13+
#include <zephyr/net/net_if.h>
14+
#include <zephyr/net/net_pkt.h>
15+
#include <zephyr/net/lldp.h>
1216
#include <zephyr/sys/util.h>
17+
#include <zephyr/sys/__assert.h>
18+
#include <ethernet/eth_stats.h>
19+
1320
#include <stdbool.h>
1421
#include <errno.h>
15-
#include <zephyr/net/net_pkt.h>
16-
#include <zephyr/net/net_if.h>
17-
#include <zephyr/net/ethernet.h>
18-
#include <zephyr/net/phy.h>
19-
#include <ethernet/eth_stats.h>
20-
#include <soc.h>
21-
#include <zephyr/irq.h>
22-
#include <zephyr/net/lldp.h>
2322

2423
#include "eth.h"
2524
#include "eth_stm32_hal_priv.h"

drivers/ethernet/eth_stm32_hal_v2.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,12 @@
77
*/
88

99
#include <zephyr/logging/log.h>
10-
#include <zephyr/sys/__assert.h>
1110
#include <zephyr/sys/util.h>
12-
#include <errno.h>
13-
#include <stdbool.h>
14-
#include <zephyr/net/ethernet.h>
15-
#include <zephyr/net/phy.h>
11+
#include <zephyr/sys/__assert.h>
1612
#include <ethernet/eth_stats.h>
17-
#include <soc.h>
18-
#include <zephyr/irq.h>
1913

20-
#if defined(CONFIG_PTP_CLOCK_STM32_HAL)
21-
#include <zephyr/drivers/ptp_clock.h>
22-
#endif /* CONFIG_PTP_CLOCK_STM32_HAL */
14+
#include <errno.h>
15+
#include <stdbool.h>
2316

2417
#include "eth.h"
2518
#include "eth_stm32_hal_priv.h"

0 commit comments

Comments
 (0)