cxgb4: fix thermal zone build error
Subsystems (3)
PATCH 1/1 cxgb4: fix thermal zone build error
with CONFIG_THERMAL=m and cxgb4 as built-in build fails, and 'commit e70a57fa59bb ("cxgb4: fix thermal configuration dependencies")' tires to fix it but when cxgb4i is made built-in build fails again, use IS_REACHABLE instead of IS_ENABLED to fix the issue.
--- drivers/net/ethernet/chelsio/Kconfig | 1 - drivers/net/ethernet/chelsio/cxgb4/Makefile | 4 +--- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 12 ++++++------ 3 files changed, 7 insertions(+), 10 deletions(-)
drivers/net/ethernet/chelsio/Kconfig +0 -1
@@ -67,7 +67,6 @@ config CHELSIO_T3 config CHELSIO_T4 tristate "Chelsio Communications T4/T5/T6 Ethernet support" depends on PCI && (IPV6 || IPV6=n) - depends on THERMAL || !THERMAL select FW_LOADER select MDIO select ZLIB_DEFLATE
drivers/net/ethernet/chelsio/cxgb4/Makefile +1 -3
@@ -12,6 +12,4 @@ cxgb4-objs := cxgb4_main.o l2t.o smt.o t4_hw.o sge.o clip_tbl.o cxgb4_ethtool.o cxgb4-$(CONFIG_CHELSIO_T4_DCB) += cxgb4_dcb.o cxgb4-$(CONFIG_CHELSIO_T4_FCOE) += cxgb4_fcoe.o cxgb4-$(CONFIG_DEBUG_FS) += cxgb4_debugfs.o -ifdef CONFIG_THERMAL -cxgb4-objs += cxgb4_thermal.o -endif +cxgb4-$(CONFIG_THERMAL) += cxgb4_thermal.o
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +6 -6
@@ -5863,10 +5863,10 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)if (!is_t4 (adapter->params.chip))cxgb4_ptp_init (adapter); -if (IS_ENABLED (CONFIG_THERMAL ) && - !is_t4 (adapter->params.chip) && (adapter->flags &FW_OK )) +#if IS_REACHABLE (CONFIG_THERMAL ) +if (!is_t4 (adapter->params.chip) && (adapter->flags &FW_OK ))cxgb4_thermal_init (adapter); - +#endif print_adapter_info (adapter);return 0 ;
@@ -5932,9 +5932,9 @@ static void remove_one(struct pci_dev *pdev)if (!is_t4 (adapter->params.chip))cxgb4_ptp_stop (adapter); -if (IS_ENABLED (CONFIG_THERMAL )) -cxgb4_thermal_remove (adapter); - +#if IS_REACHABLE (CONFIG_THERMAL ) +cxgb4_thermal_remove (adapter); +#endif /* If we allocated filters, free up state associated with any * valid filters ... */
Signature · 1 line
2.1.0
Hello!
Quoted 3 lines · Ganesh Goudar
with
CONFIG_THERMAL=mand cxgb4 as built-in build fails, and 'commite70a57fa59bb("cxgb4: fix thermal configuration dependencies")' tires to fix it but when cxgb4i is made built-in build fails again,
Tries? :-)
Quoted 40 lines
use
IS_REACHABLEinstead ofIS_ENABLEDto fix the issue.Fixes e70a57fa59bb (cxgb4: fix thermal configuration dependencies)Reported-by Randy Dunlap <[email protected]>Signed-off-by Ganesh Goudar <[email protected]>--- drivers/net/ethernet/chelsio/Kconfig | 1 - drivers/net/ethernet/chelsio/cxgb4/Makefile | 4 +--- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 12 ++++++------ 3 files changed, 7 insertions(+), 10 deletions(-)drivers/net/ethernet/chelsio/Kconfig +0
-1@@ -67,7 +67,6 @@ config CHELSIO_T3 config CHELSIO_T4 tristate "Chelsio Communications T4/T5/T6 Ethernet support" depends on PCI && (IPV6 || IPV6=n) - depends on THERMAL || !THERMAL select FW_LOADER select MDIO select ZLIB_DEFLATEdrivers/net/ethernet/chelsio/cxgb4/Makefile +1
-3@@ -12,6 +12,4 @@ cxgb4-objs := cxgb4_main.o l2t.o smt.o t4_hw.o sge.o clip_tbl.o cxgb4_ethtool.o cxgb4-$(CONFIG_CHELSIO_T4_DCB) += cxgb4_dcb.o cxgb4-$(CONFIG_CHELSIO_T4_FCOE) += cxgb4_fcoe.o cxgb4-$(CONFIG_DEBUG_FS) += cxgb4_debugfs.o -ifdef CONFIG_THERMAL -cxgb4-objs += cxgb4_thermal.o -endif +cxgb4-$(CONFIG_THERMAL) += cxgb4_thermal.odrivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +0
-0
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · line 5866
Quoted 6 lines
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +1
-2@@ -5863,10 +5863,10 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)if (!is_t4 (adapter->params.chip))cxgb4_ptp_init (adapter); -if (IS_ENABLED (CONFIG_THERMAL ) && - !is_t4 (adapter->params.chip) && (adapter->flags &FW_OK )) +#if IS_REACHABLE (CONFIG_THERMAL )
Why use #ifdef amidst a function (if you can avoid it)?
Quoted 8 lines
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +2
-1+if (!is_t4 (adapter->params.chip) && (adapter->flags &FW_OK ))cxgb4_thermal_init (adapter); - +#endif print_adapter_info (adapter);return 0 ;
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c static void remove_one(struct pci_dev *pdev) · line 5937
Quoted 9 lines
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +3
-3@@ -5932,9 +5932,9 @@ static void remove_one(struct pci_dev *pdev)if (!is_t4 (adapter->params.chip))cxgb4_ptp_stop (adapter); -if (IS_ENABLED (CONFIG_THERMAL )) -cxgb4_thermal_remove (adapter); - +#if IS_REACHABLE (CONFIG_THERMAL ) +cxgb4_thermal_remove (adapter); +#endif
Same question.
[...]
MBR, Sergei