Hi all,
Including phy.h and phy_fixed.h into net/dsa.h causes phy*.h to be an
unnecessary dependency for quite a large amount of the kernel. There's
very little which actually requires definitions from phy.h in net/dsa.h
- the include itself only wants the declaration of a couple of
structures and IFNAMSIZ.
Add linux/if.h for IFNAMSIZ, declarations for the structures, phy.h to
mv88e6xxx.h as it needs it for phy_interface_t, and remove both phy.h
and phy_fixed.h from net/dsa.h.
This patch reduces from around 800 files rebuilt to around 40 - even
with ccache, the time difference is noticable.
In order to make this change, several drivers need to be updated to
include necessary headers that they were picking up through this
include. This has resulted in a much larger patch series.
I'm assuming the 0-day builder has had 24 hours with this series, and
hasn't reported any further issues with it - the last issue was two
weeks ago (before I became ill) which I fixed over the last weekend.
I'm hoping this doesn't conflict with what's already in net-next...
David, this should probably go via your tree considering the diffstat.
Changes in v2:
- took Russell's patch series
- removed Qualcomm EMAC patch
- rebased against net-next/master
Russell King (12):
net: sunrpc: fix build errors when linux/phy*.h is removed from
net/dsa.h
net: cgroups: fix build errors when linux/phy*.h is removed from
net/dsa.h
net: macb: fix build errors when linux/phy*.h is removed from
net/dsa.h
net: lan78xx: fix build errors when linux/phy*.h is removed from
net/dsa.h
net: bgmac: fix build errors when linux/phy*.h is removed from
net/dsa.h
net: fman: fix build errors when linux/phy*.h is removed from
net/dsa.h
net: mvneta: fix build errors when linux/phy*.h is removed from
net/dsa.h
iscsi: fix build errors when linux/phy*.h is removed from net/dsa.h
MIPS: Octeon: Remove unnecessary MODULE_*()
net: liquidio: fix build errors when linux/phy*.h is removed from
net/dsa.h
net: ath5k: fix build errors when linux/phy*.h is removed from
net/dsa.h
net: dsa: remove unnecessary phy*.h includes
arch/mips/cavium-octeon/octeon-platform.c | 4 ----
drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 1 +
drivers/net/ethernet/broadcom/bgmac.c | 2 ++
drivers/net/ethernet/cadence/macb.h | 2 ++
drivers/net/ethernet/cavium/liquidio/lio_main.c | 1 +
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 1 +
drivers/net/ethernet/cavium/liquidio/octeon_console.c | 1 +
drivers/net/ethernet/freescale/fman/fman_memac.c | 1 +
drivers/net/ethernet/marvell/mvneta.c | 1 +
drivers/net/usb/lan78xx.c | 1 +
drivers/net/wireless/ath/ath5k/ahb.c | 2 +-
drivers/target/iscsi/iscsi_target_login.c | 1 +
include/net/dsa.h | 5 +++--
net/core/netprio_cgroup.c | 1 +
net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 1 +
15 files changed, 18 insertions(+), 7 deletions(-)
--
2.9.3
From: Russell King <redacted>
Removing linux/phy.h from net/dsa.h reveals a build error in the sunrpc
code:
net/sunrpc/xprtrdma/svc_rdma_backchannel.c: In function 'xprt_rdma_bc_put':
net/sunrpc/xprtrdma/svc_rdma_backchannel.c:277:2: error: implicit declaration of function 'module_put' [-Werror=implicit-function-declaration]
net/sunrpc/xprtrdma/svc_rdma_backchannel.c: In function 'xprt_setup_rdma_bc':
net/sunrpc/xprtrdma/svc_rdma_backchannel.c:348:7: error: implicit declaration of function 'try_module_get' [-Werror=implicit-function-declaration]
Fix this by adding linux/module.h to svc_rdma_backchannel.c
Signed-off-by: Russell King <redacted>
Acked-by: Anna Schumaker <redacted>
---
net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 1 +
1 file changed, 1 insertion(+)
From: Russell King <redacted>
drivers/net/ethernet/cadence/macb.h:862:33: sparse: expected ; at end of declaration
drivers/net/ethernet/cadence/macb.h:862:33: sparse: Expected } at end of struct-union-enum-specifier
drivers/net/ethernet/cadence/macb.h:862:33: sparse: got phy_interface
drivers/net/ethernet/cadence/macb.h:877:1: sparse: Expected ; at the end of type declaration
drivers/net/ethernet/cadence/macb.h:877:1: sparse: got }
In file included from drivers/net/ethernet/cadence/macb_pci.c:29:0:
drivers/net/ethernet/cadence/macb.h:862:2: error: unknown type name 'phy_interface_t'
phy_interface_t phy_interface;
^~~~~~~~~~~~~~~
Add linux/phy.h to macb.h
Signed-off-by: Russell King <redacted>
Acked-by: Nicolas Ferre <redacted>
---
drivers/net/ethernet/cadence/macb.h | 2 ++
1 file changed, 2 insertions(+)
From: Russell King <redacted>
drivers/net/usb/lan78xx.c:394:33: sparse: expected ; at end of declaration
drivers/net/usb/lan78xx.c:394:33: sparse: Expected } at end of struct-union-enum-specifier
drivers/net/usb/lan78xx.c:394:33: sparse: got interface
drivers/net/usb/lan78xx.c:403:1: sparse: Expected ; at the end of type declaration
drivers/net/usb/lan78xx.c:403:1: sparse: got }
Add linux/phy.h to lan78xx.c
Signed-off-by: Russell King <redacted>
---
drivers/net/usb/lan78xx.c | 1 +
1 file changed, 1 insertion(+)
From: Russell King <redacted>
drivers/net/ethernet/broadcom/bgmac.c:1015:17: error: dereferencing pointer to incomplete type 'struct mii_bus'
drivers/net/ethernet/broadcom/bgmac.c:1185:2: error: implicit declaration of function 'phy_start' [-Werror=implicit-function-declaration]
drivers/net/ethernet/broadcom/bgmac.c:1198:2: error: implicit declaration of function 'phy_stop' [-Werror=implicit-function-declaration]
drivers/net/ethernet/broadcom/bgmac.c:1239:9: error: implicit declaration of function 'phy_mii_ioctl' [-Werror=implicit-function-declaration]
drivers/net/ethernet/broadcom/bgmac.c:1389:28: error: 'phy_ethtool_get_link_ksettings' undeclared here (not in a function)
drivers/net/ethernet/broadcom/bgmac.c:1390:28: error: 'phy_ethtool_set_link_ksettings' undeclared here (not in a function)
drivers/net/ethernet/broadcom/bgmac.c:1403:13: error: dereferencing pointer to incomplete type 'struct phy_device'
drivers/net/ethernet/broadcom/bgmac.c:1417:3: error: implicit declaration of function 'phy_print_status' [-Werror=implicit-function-declaration]
drivers/net/ethernet/broadcom/bgmac.c:1424:26: error: storage size of 'fphy_status' isn't known
drivers/net/ethernet/broadcom/bgmac.c:1424:9: error: variable 'fphy_status' has initializer but incomplete type
drivers/net/ethernet/broadcom/bgmac.c:1425:11: warning: excess elements in struct initializer
drivers/net/ethernet/broadcom/bgmac.c:1425:3: error: unknown field 'link' specified in initializer
drivers/net/ethernet/broadcom/bgmac.c:1426:12: note: in expansion of macro 'SPEED_1000'
drivers/net/ethernet/broadcom/bgmac.c:1426:3: error: unknown field 'speed' specified in initializer
drivers/net/ethernet/broadcom/bgmac.c:1427:13: note: in expansion of macro 'DUPLEX_FULL'
drivers/net/ethernet/broadcom/bgmac.c:1427:3: error: unknown field 'duplex' specified in initializer
drivers/net/ethernet/broadcom/bgmac.c:1432:12: error: implicit declaration of function 'fixed_phy_register' [-Werror=implicit-function-declaration]
drivers/net/ethernet/broadcom/bgmac.c:1432:31: error: 'PHY_POLL' undeclared (first use in this function)
drivers/net/ethernet/broadcom/bgmac.c:1438:8: error: implicit declaration of function 'phy_connect_direct' [-Werror=implicit-function-declaration]
drivers/net/ethernet/broadcom/bgmac.c:1439:6: error: 'PHY_INTERFACE_MODE_MII' undeclared (first use in this function)
drivers/net/ethernet/broadcom/bgmac.c:1521:2: error: implicit declaration of function 'phy_disconnect' [-Werror=implicit-function-declaration]
drivers/net/ethernet/broadcom/bgmac.c:1541:15: error: expected declaration specifiers or '...' before string constant
Add linux/phy.h to bgmac.c
Signed-off-by: Russell King <redacted>
Acked-by: Rafał Miłecki <rafal@milecki.pl>
---
drivers/net/ethernet/broadcom/bgmac.c | 2 ++
1 file changed, 2 insertions(+)
From: Russell King <redacted>
drivers/net/ethernet/marvell/mvneta.c:2694:26: error: storage size of 'status' isn't known
drivers/net/ethernet/marvell/mvneta.c:2695:26: error: storage size of 'changed' isn't known
drivers/net/ethernet/marvell/mvneta.c:2695:9: error: variable 'changed' has initializer but incomplete type
drivers/net/ethernet/marvell/mvneta.c:2709:2: error: implicit declaration of function 'fixed_phy_update_state' [-Werror=implicit-function-declaration]
Add linux/phy_fixed.h to mvneta.c
Signed-off-by: Russell King <redacted>
Acked-by: Thomas Petazzoni <redacted>
---
drivers/net/ethernet/marvell/mvneta.c | 1 +
1 file changed, 1 insertion(+)
From: Russell King <redacted>
octeon-platform.c can not be built as a module for two reasons:
(a) the Makefile doesn't allow it:
obj-y := cpu.o setup.o octeon-platform.o octeon-irq.o csrc-octeon.o
(b) the multiple *_initcall() statements, each of which are translated
to a module_init() call when attempting a module build, become
aliases to init_module(). Having more than one alias will cause a
build error.
Hence, rather than adding a linux/module.h include, remove the redundant
MODULE_*() from this file.
Acked-by: David Daney <redacted>
Signed-off-by: Russell King <redacted>
---
arch/mips/cavium-octeon/octeon-platform.c | 4 ----
1 file changed, 4 deletions(-)
From: Russell King <redacted>
Including phy.h and phy_fixed.h into net/dsa.h causes phy*.h to be an
unnecessary dependency for quite a large amount of the kernel. There's
very little which actually requires definitions from phy.h in net/dsa.h
- the include itself only wants the declaration of a couple of
structures and IFNAMSIZ.
Add linux/if.h for IFNAMSIZ, declarations for the structures, phy.h to
mv88e6xxx.h as it needs it for phy_interface_t, and remove both phy.h
and phy_fixed.h from net/dsa.h.
This patch reduces from around 800 files rebuilt to around 40 - even
with ccache, the time difference is noticable.
Tested-by: Vivien Didelot <redacted>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Russell King <redacted>
---
drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 1 +
include/net/dsa.h | 5 +++--
2 files changed, 4 insertions(+), 2 deletions(-)
I'm hoping this doesn't conflict with what's already in net-next...
David, this should probably go via your tree considering the diffstat.
I think you need one more respin. Are you doing an allmodconfig build?
If not, for something like this it's a must:
drivers/net/wireless/ath/wil6210/cfg80211.c:24:30: error: expected ‘)’ before ‘bool’
module_param(disable_ap_sme, bool, 0444);
^
drivers/net/wireless/ath/wil6210/cfg80211.c:25:34: error: expected ‘)’ before string constant
MODULE_PARM_DESC(disable_ap_sme, " let user space handle AP mode SME");
^
Like like that file needs linux/module.h included.
Thanks.