Skip to contentSkip to conversation

staging: qlge: Fix compilation failures in qlge_dbg.c when QL_DEV_DUMP is set

PATCH In review Rylan Dmello 2 participants 7 messages Apr 27, 2020 – Apr 28, 2020

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

cover staging: qlge: Fix compilation failures in qlge_dbg.c when QL_DEV_DUMP is set

qlge_dbg.c has a bunch of code that is conditionally compiled only when the QL_DEV_DUMP macro is set in qlge.h (it is unset by default).

Several fields have been removed from the 'ql_adapter' and 'rx_ring' structs in qlge.h so that qlge_dbg.c no longer compiles when QL_DEV_DUMP is set.

This patchset updates qlge_dbg.c so that compiles successfully when QL_DEV_DUMP is set.

Rylan Dmello (3):
staging: qlge: Remove unnecessary parentheses around struct field
staging: qlge: Remove print statement for vlgrp field.
staging: qlge: Remove print statements for lbq_clean_idx and
lbq_free_cnt

 drivers/staging/qlge/qlge_dbg.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/3 staging: qlge: Remove unnecessary parentheses around struct field

Remove unnecessary parentheses around a struct field accessor that causes a build failure when QL_DEV_DUMP is set.

---
 drivers/staging/qlge/qlge_dbg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/qlge/qlge_dbg.c +1 -1
index 216b13d8c131..e0dcdc452e2e 100644
@@ -1559,7 +1559,7 @@ void ql_dump_stat(struct ql_adapter *qdev)
 #ifdef QL_DEV_DUMP
 
 #define DUMP_QDEV_FIELD(qdev, type, field)		\
-	pr_err("qdev->%-24s = " type "\n", #field, (qdev)->(field))
+	pr_err("qdev->%-24s = " type "\n", #field, (qdev)->field)
 #define DUMP_QDEV_DMA_FIELD(qdev, field)		\
 	pr_err("qdev->%-24s = %llx\n", #field, (unsigned long long)qdev->field)
 #define DUMP_QDEV_ARRAY(qdev, type, array, index, field) \
Signature · 1 line
2.26.2
#3 lore raw

PATCH 2/3 staging: qlge: Remove print statement for vlgrp field

In reply to Rylan Dmello

Remove statement that tries to print the non-existent 'vlgrp' field in the 'ql_adapter' struct, which causes a compilation failure when QL_DEV_DUMP is set.

vlgrp seems to have been removed from ql_adapter as a part of commit 18c49b91777c ("qlge: do vlan cleanup") in 2011.

vlgrp might be replaced by the 'active_vlans' array introduced in the aforementioned commit. But I'm not sure if printing all 64 values of that array would help with debugging this driver, so I'm leaving it out of the debug code in this patch.

---
 drivers/staging/qlge/qlge_dbg.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/qlge/qlge_dbg.c +0 -1
index e0dcdc452e2e..bf157baace54 100644
@@ -1570,7 +1570,6 @@ void ql_dump_qdev(struct ql_adapter *qdev)
 	int i;
 
 	DUMP_QDEV_FIELD(qdev, "%lx", flags);
-	DUMP_QDEV_FIELD(qdev, "%p", vlgrp);
 	DUMP_QDEV_FIELD(qdev, "%p", pdev);
 	DUMP_QDEV_FIELD(qdev, "%p", ndev);
 	DUMP_QDEV_FIELD(qdev, "%d", chip_rev_id);
Signature · 1 line
2.26.2
#5 lore raw

PATCH 3/3 staging: qlge: Remove print statements for lbq_clean_idx and lbq_free_cnt

In reply to Rylan Dmello

Remove debug print statements referring to non-existent fields 'lbq_clean_idx' and 'lbq_free_cnt' in the 'rx_ring' struct, which causes a compilation failure when QL_DEV_DUMP is set.

These fields were initially removed as a part of commit aec626d2092f ("staging: qlge: Update buffer queue prod index despite oom") in 2019.

Their replacement fields ('next_to_use' and 'next_to_clean') are already being printed, so this patch does not add new debug statements for them.

---
 drivers/staging/qlge/qlge_dbg.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/qlge/qlge_dbg.c +0 -2
index bf157baace54..058889687907 100644
@@ -1757,8 +1757,6 @@ void ql_dump_rx_ring(struct rx_ring *rx_ring)
 	       rx_ring->lbq.prod_idx_db_reg);
 	pr_err("rx_ring->lbq.next_to_use = %d\n", rx_ring->lbq.next_to_use);
 	pr_err("rx_ring->lbq.next_to_clean = %d\n", rx_ring->lbq.next_to_clean);
-	pr_err("rx_ring->lbq_clean_idx = %d\n", rx_ring->lbq_clean_idx);
-	pr_err("rx_ring->lbq_free_cnt = %d\n", rx_ring->lbq_free_cnt);
 
 	pr_err("rx_ring->sbq.base = %p\n", rx_ring->sbq.base);
 	pr_err("rx_ring->sbq.base_dma = %llx\n",
Signature · 1 line
2.26.2
#4 lore raw

Re: [PATCH 2/3] staging: qlge: Remove print statement for vlgrp field

In reply to Rylan Dmello
Quoted 7 lines · Rylan Dmello

Remove statement that tries to print the non-existent 'vlgrp' field in the 'ql_adapter' struct, which causes a compilation failure when QL_DEV_DUMP is set.

vlgrp seems to have been removed from ql_adapter as a part of commit 18c49b91777c ("qlge: do vlan cleanup") in 2011.

Quoted 6 lines

vlgrp might be replaced by the 'active_vlans' array introduced in the aforementioned commit. But I'm not sure if printing all 64 values of that array would help with debugging this driver, so I'm leaving it out of the debug code in this patch.

Fixes 18c49b91777c ("qlge: do vlan cleanup")

regards,
dan carpenter

#2 lore raw

Re: [PATCH 1/3] staging: qlge: Remove unnecessary parentheses around struct field

In reply to Rylan Dmello
Quoted 4 lines · Rylan Dmello

Remove unnecessary parentheses around a struct field accessor that causes a build failure when QL_DEV_DUMP is set.

Add a Fixes tag.

Fixes 67e6cf7338e1 ("staging: qlge: add braces around macro arguments")

regards,
dan carpenter

#6 lore raw

Re: [PATCH 3/3] staging: qlge: Remove print statements for lbq_clean_idx and lbq_free_cnt

In reply to Rylan Dmello
Quoted 11 lines · Rylan Dmello

Remove debug print statements referring to non-existent fields 'lbq_clean_idx' and 'lbq_free_cnt' in the 'rx_ring' struct, which causes a compilation failure when QL_DEV_DUMP is set.

These fields were initially removed as a part of commit aec626d2092f ("staging: qlge: Update buffer queue prod index despite oom") in 2019.

Their replacement fields ('next_to_use' and 'next_to_clean') are already being printed, so this patch does not add new debug statements for them.

Fixes aec626d2092f ("staging: qlge: Update buffer queue prod index despite oom")

regards,
dan carpenter