Skip to contentSkip to conversation

cxgb4: Fix 'defined but not used' warning for cxgb4_uld_in_use()

PATCH Superseded Tom Seewald 2 participants 6 messages Jun 5, 2020 – Jun 6, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxgb4: Fix 'defined but not used' warning for cxgb4_uld_in_use()

The only user of cxgb4_uld_in_use() is cxgb4_set_ktls_feature() which is only available when CONFIG_CHELSIO_TLS_DEVICE=y. To avoid this compiler warning when CONFIG_CHELSIO_TLS_DEVICE=n, place cxgb4_uld_in_use() behind the same ifdef.

---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c +5 -5
index 0307e9c69a47..ac6c06cfd9be 100644
@@ -663,6 +663,11 @@ static int uld_attach(struct adapter *adap, unsigned int uld)
 	return 0;
 }
 
+#ifdef CONFIG_CHELSIO_TLS_DEVICE
+/* cxgb4_set_ktls_feature: request FW to enable/disable ktls settings.
+ * @adap: adapter info
+ * @enable: 1 to enable / 0 to disable ktls settings.
+ */
 static bool cxgb4_uld_in_use(struct adapter *adap)
 {
 	const struct tid_info *t = &adap->tids;
@@ -670,11 +675,6 @@ static bool cxgb4_uld_in_use(struct adapter *adap)
 	return (atomic_read(&t->conns_in_use) || t->stids_in_use);
 }
 
-#ifdef CONFIG_CHELSIO_TLS_DEVICE
-/* cxgb4_set_ktls_feature: request FW to enable/disable ktls settings.
- * @adap: adapter info
- * @enable: 1 to enable / 0 to disable ktls settings.
- */
 int cxgb4_set_ktls_feature(struct adapter *adap, bool enable)
 {
 	int ret = 0;
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/1 cxgb4: Fix 'defined but not used' warning for cxgb4_uld_in_use()

The only user of cxgb4_uld_in_use() is cxgb4_set_ktls_feature() which is only available when CONFIG_CHELSIO_TLS_DEVICE=y. To avoid this compiler warning when CONFIG_CHELSIO_TLS_DEVICE=n, place cxgb4_uld_in_use() behind the same ifdef.

---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c +1 -1
index 0307e9c69a47..08439e215efe 100644
@@ -663,6 +663,7 @@ static int uld_attach(struct adapter *adap, unsigned int uld)
 	return 0;
 }
 
+#ifdef CONFIG_CHELSIO_TLS_DEVICE
 static bool cxgb4_uld_in_use(struct adapter *adap)
 {
 	const struct tid_info *t = &adap->tids;
@@ -670,7 +671,6 @@ static bool cxgb4_uld_in_use(struct adapter *adap)
 	return (atomic_read(&t->conns_in_use) || t->stids_in_use);
 }
 
-#ifdef CONFIG_CHELSIO_TLS_DEVICE
 /* cxgb4_set_ktls_feature: request FW to enable/disable ktls settings.
  * @adap: adapter info
  * @enable: 1 to enable / 0 to disable ktls settings.
Signature · 1 line
2.20.1
maintainer
#2 lore raw

From: Tom Seewald <[email protected]>
Date: Thu, 4 Jun 2020 20:36:32 -0500

Quoted 6 lines

The only user of cxgb4_uld_in_use() is cxgb4_set_ktls_feature() which is only available when CONFIG_CHELSIO_TLS_DEVICE=y. To avoid this compiler warning when CONFIG_CHELSIO_TLS_DEVICE=n, place cxgb4_uld_in_use() behind the same ifdef.

This doesn't apply to the net GIT tree.

#4 lore raw

Looks like this has already been fixed in net, sorry for the noise.

maintainer
#5 lore raw
In reply to Tom Seewald

From: Tom Seewald <[email protected]>
Date: Sat, 6 Jun 2020 01:04:21 -0500

Quoted 2 lines
Quoted 1 line

This doesn't apply to the net GIT tree.

Apologies, this fix is for net-next. Let me know if I should resend.

Right now net == net-next, and no new changes are going into net-next.