2020-04-27 04:16:55

by Rylan Dmello

[permalink] [raw]
Subject: [PATCH 0/3] 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(-)

--
2.26.2


2020-04-27 04:16:55

by Rylan Dmello

[permalink] [raw]
Subject: [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.

Signed-off-by: Rylan Dmello <[email protected]>
---
drivers/staging/qlge/qlge_dbg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
index 216b13d8c131..e0dcdc452e2e 100644
--- a/drivers/staging/qlge/qlge_dbg.c
+++ b/drivers/staging/qlge/qlge_dbg.c
@@ -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) \
--
2.26.2

2020-04-27 04:17:01

by Rylan Dmello

[permalink] [raw]
Subject: [PATCH 2/3] staging: qlge: Remove print statement for vlgrp field

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.

Signed-off-by: Rylan Dmello <[email protected]>
---
drivers/staging/qlge/qlge_dbg.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
index e0dcdc452e2e..bf157baace54 100644
--- a/drivers/staging/qlge/qlge_dbg.c
+++ b/drivers/staging/qlge/qlge_dbg.c
@@ -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);
--
2.26.2

2020-04-27 04:19:13

by Rylan Dmello

[permalink] [raw]
Subject: [PATCH 3/3] staging: qlge: Remove print statements for lbq_clean_idx and lbq_free_cnt

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.

Signed-off-by: Rylan Dmello <[email protected]>
---
drivers/staging/qlge/qlge_dbg.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
index bf157baace54..058889687907 100644
--- a/drivers/staging/qlge/qlge_dbg.c
+++ b/drivers/staging/qlge/qlge_dbg.c
@@ -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",
--
2.26.2

2020-04-28 12:09:11

by Dan Carpenter

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

On Mon, Apr 27, 2020 at 12:14:44AM -0400, Rylan Dmello wrote:
> 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.
>
> Signed-off-by: Rylan Dmello <[email protected]>

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

regards,
dan carpenter

2020-04-28 12:09:19

by Dan Carpenter

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

On Mon, Apr 27, 2020 at 12:14:11AM -0400, Rylan Dmello wrote:
> Remove unnecessary parentheses around a struct field accessor that
> causes a build failure when QL_DEV_DUMP is set.
>
> Signed-off-by: Rylan Dmello <[email protected]>

Add a Fixes tag.

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

regards,
dan carpenter

2020-04-28 12:11:05

by Dan Carpenter

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

On Mon, Apr 27, 2020 at 12:15:18AM -0400, Rylan Dmello wrote:
> 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.
>
> Signed-off-by: Rylan Dmello <[email protected]>


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

regards,
dan carpenter