Skip to contentSkip to conversation

ionic: fix ptp support config breakage

PATCH Superseded Shannon Nelson 3 participants 4 messages May 5, 2021

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ionic: fix ptp support config breakage

Driver link failed with undefined references in some kernel config variations.

v2 - added Fixes tag

Fixes 61db421da31b ("ionic: link in the new hw timestamp code")
---
 drivers/net/ethernet/pensando/ionic/Makefile    | 3 +--
 drivers/net/ethernet/pensando/ionic/ionic_phc.c | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/pensando/ionic/Makefile +1 -2
index 4e7642a2d25f..61c40169cb1f 100644
@@ -5,5 +5,4 @@ obj-$(CONFIG_IONIC) := ionic.o
 
 ionic-y := ionic_main.o ionic_bus_pci.o ionic_devlink.o ionic_dev.o \
 	   ionic_debugfs.o ionic_lif.o ionic_rx_filter.o ionic_ethtool.o \
-	   ionic_txrx.o ionic_stats.o ionic_fw.o
-ionic-$(CONFIG_PTP_1588_CLOCK) += ionic_phc.o
+	   ionic_txrx.o ionic_stats.o ionic_fw.o ionic_phc.o
drivers/net/ethernet/pensando/ionic/ionic_phc.c +3 -0
index a87c87e86aef..30c78808c45a 100644
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright(c) 2017 - 2021 Pensando Systems, Inc */
 
+#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)
+
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 
@@ -613,3 +615,4 @@ void ionic_lif_free_phc(struct ionic_lif *lif)
 	devm_kfree(lif->ionic->dev, lif->phc);
 	lif->phc = NULL;
 }
+#endif /* IS_ENABLED(CONFIG_PTP_1588_CLOCK) */
Signature · 1 line
2.17.1
#1 lore raw
Quoted 4 lines · Shannon Nelson

Driver link failed with undefined references in some kernel config variations.

v2 - added Fixes tag

Changelogs should be below "---" line.
We don't need them in commit message history.

Quoted 25 lines
Fixes 61db421da31b ("ionic: link in the new hw timestamp code")
---
 drivers/net/ethernet/pensando/ionic/Makefile    | 3 +--
 drivers/net/ethernet/pensando/ionic/ionic_phc.c | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/pensando/ionic/Makefile +1 -2
index 4e7642a2d25f..61c40169cb1f 100644
@@ -5,5 +5,4 @@ obj-$(CONFIG_IONIC) := ionic.o
 
 ionic-y := ionic_main.o ionic_bus_pci.o ionic_devlink.o ionic_dev.o \
 	   ionic_debugfs.o ionic_lif.o ionic_rx_filter.o ionic_ethtool.o \
-	   ionic_txrx.o ionic_stats.o ionic_fw.o
-ionic-$(CONFIG_PTP_1588_CLOCK) += ionic_phc.o
+	   ionic_txrx.o ionic_stats.o ionic_fw.o ionic_phc.o
drivers/net/ethernet/pensando/ionic/ionic_phc.c +0 -0
index a87c87e86aef..30c78808c45a 100644

drivers/net/ethernet/pensando/ionic/ionic_phc.c line 4

Quoted 4 lines
drivers/net/ethernet/pensando/ionic/ionic_phc.c +1 -0
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright(c) 2017 - 2021 Pensando Systems, Inc */
 
+#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)

I'm not sure, but think that IS_ENABLED() is intended to be used inside functions/macros as boolean expression.

For other places like this, "#if CONFIG_PTP_1588_CLOCK" is better fit.

Thanks

#2 lore raw
Quoted 37 lines · Leon Romanovsky
Quoted 4 lines · Shannon Nelson

Driver link failed with undefined references in some kernel config variations.

v2 - added Fixes tag

Changelogs should be below "---" line.
We don't need them in commit message history.

Quoted 28 lines
Fixes 61db421da31b ("ionic: link in the new hw timestamp code")
---
 drivers/net/ethernet/pensando/ionic/Makefile    | 3 +--
 drivers/net/ethernet/pensando/ionic/ionic_phc.c | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/pensando/ionic/Makefile +1 -2
index 4e7642a2d25f..61c40169cb1f 100644
@@ -5,5 +5,4 @@ obj-$(CONFIG_IONIC) := ionic.o
 
 ionic-y := ionic_main.o ionic_bus_pci.o ionic_devlink.o ionic_dev.o \
 	   ionic_debugfs.o ionic_lif.o ionic_rx_filter.o ionic_ethtool.o \
-	   ionic_txrx.o ionic_stats.o ionic_fw.o
-ionic-$(CONFIG_PTP_1588_CLOCK) += ionic_phc.o
+	   ionic_txrx.o ionic_stats.o ionic_fw.o ionic_phc.o
drivers/net/ethernet/pensando/ionic/ionic_phc.c +0 -0
index a87c87e86aef..30c78808c45a 100644
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright(c) 2017 - 2021 Pensando Systems, Inc */
 
Quoted 6 lines

drivers/net/ethernet/pensando/ionic/ionic_phc.c line 4

Quoted 1 line
drivers/net/ethernet/pensando/ionic/ionic_phc.c +1 -0
+#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)

I'm not sure, but think that IS_ENABLED() is intended to be used inside functions/macros as boolean expression.

For other places like this, "#if CONFIG_PTP_1588_CLOCK" is better fit.

s/#if/#ifdef/

but the patch looks OK to me as is.

Signature · 1 line
~Randy
#3 lore raw
Quoted 38 lines · Randy Dunlap
Quoted 37 lines · Leon Romanovsky
Quoted 4 lines · Shannon Nelson

Driver link failed with undefined references in some kernel config variations.

v2 - added Fixes tag

Changelogs should be below "---" line.
We don't need them in commit message history.

Quoted 28 lines
Fixes 61db421da31b ("ionic: link in the new hw timestamp code")
---
 drivers/net/ethernet/pensando/ionic/Makefile    | 3 +--
 drivers/net/ethernet/pensando/ionic/ionic_phc.c | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/pensando/ionic/Makefile +1 -2
index 4e7642a2d25f..61c40169cb1f 100644
@@ -5,5 +5,4 @@ obj-$(CONFIG_IONIC) := ionic.o
 
 ionic-y := ionic_main.o ionic_bus_pci.o ionic_devlink.o ionic_dev.o \
 	   ionic_debugfs.o ionic_lif.o ionic_rx_filter.o ionic_ethtool.o \
-	   ionic_txrx.o ionic_stats.o ionic_fw.o
-ionic-$(CONFIG_PTP_1588_CLOCK) += ionic_phc.o
+	   ionic_txrx.o ionic_stats.o ionic_fw.o ionic_phc.o
drivers/net/ethernet/pensando/ionic/ionic_phc.c +0 -0
index a87c87e86aef..30c78808c45a 100644
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
 /* Copyright(c) 2017 - 2021 Pensando Systems, Inc */
 
Quoted 8 lines
Quoted 6 lines

drivers/net/ethernet/pensando/ionic/ionic_phc.c line 4

Quoted 1 line
drivers/net/ethernet/pensando/ionic/ionic_phc.c +1 -0
+#if IS_ENABLED(CONFIG_PTP_1588_CLOCK)

I'm not sure, but think that IS_ENABLED() is intended to be used inside functions/macros as boolean expression.

For other places like this, "#if CONFIG_PTP_1588_CLOCK" is better fit.

s/#if/#ifdef/

Sure, thanks.