[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200902140000.jcarw6eqryyergig@Rk>
Date: Wed, 2 Sep 2020 22:00:00 +0800
From: Coiby Xu <coiby.xu@...il.com>
To: Benjamin Poirier <benjamin.poirier@...il.com>
Cc: devel@...verdev.osuosl.org, Manish Chopra <manishc@...vell.com>,
"supporter:QLOGIC QLGE 10Gb ETHERNET DRIVER"
<GR-Linux-NIC-Dev@...vell.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Dan Carpenter <dan.carpenter@...cle.com>,
"open list:QLOGIC QLGE 10Gb ETHERNET DRIVER" <netdev@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] staging: qlge: fix build breakage with dumping enabled
On Thu, Aug 27, 2020 at 09:50:10AM +0900, Benjamin Poirier wrote:
>On 2020-08-27 07:27 +0800, Coiby Xu wrote:
>> This fixes commit 0107635e15ac
>> ("staging: qlge: replace pr_err with netdev_err") which introduced an
>> build breakage of missing `struct ql_adapter *qdev` for some functions
>> and a warning of type mismatch with dumping enabled, i.e.,
>>
>> $ make CFLAGS_MODULE="QL_ALL_DUMP=1 QL_OB_DUMP=1 QL_CB_DUMP=1 \
>> QL_IB_DUMP=1 QL_REG_DUMP=1 QL_DEV_DUMP=1" M=drivers/staging/qlge
>>
>> qlge_dbg.c: In function ‘ql_dump_ob_mac_rsp’:
>> qlge_dbg.c:2051:13: error: ‘qdev’ undeclared (first use in this function); did you mean ‘cdev’?
>> 2051 | netdev_err(qdev->ndev, "%s\n", __func__);
>> | ^~~~
>> qlge_dbg.c: In function ‘ql_dump_routing_entries’:
>> qlge_dbg.c:1435:10: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘int’ [-Wformat=]
>> 1435 | "%s: Routing Mask %d = 0x%.08x\n",
>> | ~^
>> | |
>> | char *
>> | %d
>> 1436 | i, value);
>> | ~
>> | |
>> | int
>> qlge_dbg.c:1435:37: warning: format ‘%x’ expects a matching ‘unsigned int’ argument [-Wformat=]
>> 1435 | "%s: Routing Mask %d = 0x%.08x\n",
>> | ~~~~^
>> | |
>> | unsigned int
>>
>> Fixes: 0107635e15ac ("staging: qlge: replace pr_err with netdev_err")
>> Reported-by: Benjamin Poirier <benjamin.poirier@...il.com>
>> Suggested-by: Benjamin Poirier <benjamin.poirier@...il.com>
>> Signed-off-by: Coiby Xu <coiby.xu@...il.com>
>> ---
>> drivers/staging/qlge/qlge.h | 20 ++++++++++----------
>> drivers/staging/qlge/qlge_dbg.c | 24 ++++++++++++++++++------
>> drivers/staging/qlge/qlge_main.c | 8 ++++----
>> 3 files changed, 32 insertions(+), 20 deletions(-)
>>
>[...]
>> @@ -1632,6 +1635,8 @@ void ql_dump_wqicb(struct wqicb *wqicb)
>>
>> void ql_dump_tx_ring(struct tx_ring *tx_ring)
>> {
>> + struct ql_adapter *qdev = tx_ring->qdev;
>> +
>> if (!tx_ring)
>> return;
>
>Given the null check for tx_ring, it seems unwise to dereference tx_ring
>before the check.
>
>Looking at ql_dump_all(), I'm not sure that the check is needed at all
>though. Maybe it should be removed.
>
>Same problem in ql_dump_rx_ring().
Thank you for the spotting this issue! I'll remove the check.
>
>> netdev_err(qdev->ndev, "===================== Dumping tx_ring %d ===============\n",
>> @@ -1657,6 +1662,8 @@ void ql_dump_tx_ring(struct tx_ring *tx_ring)
>> void ql_dump_ricb(struct ricb *ricb)
>> {
>> int i;
>> + struct ql_adapter *qdev =
>> + container_of(ricb, struct ql_adapter, ricb);
>
>Here, davem would point out that the variables are not declared in
>"reverse xmas tree" order.
I'll make davem happy then:)
--
Best regards,
Coiby
Powered by blists - more mailing lists