From: Coiby Xu <coiby.xu@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: devel@driverdev.osuosl.org, Manish Chopra <manishc@marvell.com>,
"supporter:QLOGIC QLGE 10Gb ETHERNET DRIVER"
<GR-Linux-NIC-Dev@marvell.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"open list:QLOGIC QLGE 10Gb ETHERNET DRIVER"
<netdev@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] staging: qlge: fix else after return or break
Date: Sat, 27 Jun 2020 07:57:25 +0800 [thread overview]
Message-ID: <20200626235725.2rcpisito2253jhm@Rk> (raw)
In-Reply-To: <049f51497b84e55e61aca989025b64493287cbab.camel@perches.com>
On Thu, Jun 25, 2020 at 03:13:14PM -0700, Joe Perches wrote:
>On Fri, 2020-06-26 at 05:57 +0800, Coiby Xu wrote:
>> Remove unnecessary elses after return or break.
>
>unrelated trivia:
>
>> diff --git a/drivers/staging/qlge/qlge_dbg.c b/drivers/staging/qlge/qlge_dbg.c
>[]
>> @@ -1391,12 +1391,11 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev)
>> pr_err("%s: Failed read of mac index register\n",
>> __func__);
>> return;
>> - } else {
>> - if (value[0])
>> - pr_err("%s: CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x\n",
>> - qdev->ndev->name, i, value[1], value[0],
>> - value[2]);
>
>looks like all of these could use netdev_err
>
> netdev_err(qdev, "etc...",
> i, value[1], value[0], value[2]);
>
>etc...
Should we also replace all pr_errs with netdev_err in
ql_dump_* functions? I'm not sure how we will use ql_dump_*. For example,
ql_dump_regs is not referred by any kernel source, so I guess it's for
the sole purpose of debugging the driver by the developer. But one
pr_err in ql_dump_routing_entries which is called by dl_dump_regs doesn't
prints out the device name whereas the other does,
> void ql_dump_routing_entries(struct ql_adapter *qdev)
> {
> int i;
> u32 value;
>
> i = ql_sem_spinlock(qdev, SEM_RT_IDX_MASK);
> if (i)
> return;
> for (i = 0; i < 16; i++) {
> value = 0;
> if (ql_get_routing_reg(qdev, i, &value)) {
> pr_err("%s: Failed read of routing index register\n",
> __func__);
> break;
> }
> if (value)
> pr_err("%s: Routing Mask %d = 0x%.08x\n",
> qdev->ndev->name, i, value);
> }
--
Best regards,
Coiby
next prev parent reply other threads:[~2020-06-26 23:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200625215755.70329-1-coiby.xu@gmail.com>
2020-06-25 21:57 ` [PATCH 1/2] staging: qlge: fix trailing */ in block comment Coiby Xu
2020-06-25 21:57 ` [PATCH 2/2] staging: qlge: fix else after return or break Coiby Xu
2020-06-25 22:13 ` Joe Perches
2020-06-26 11:47 ` Coiby Xu
2020-06-26 23:57 ` Coiby Xu [this message]
2020-06-27 0:06 ` Joe Perches
2020-06-27 10:21 ` Coiby Xu
2020-06-26 8:34 ` Dan Carpenter
2020-06-26 11:41 ` Coiby Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200626235725.2rcpisito2253jhm@Rk \
--to=coiby.xu@gmail.com \
--cc=GR-Linux-NIC-Dev@marvell.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=manishc@marvell.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox