All of lore.kernel.org
 help / color / mirror / Atom feed
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: Fri, 26 Jun 2020 19:47:33 +0800	[thread overview]
Message-ID: <20200626114733.ffjbwy7uooz2i73x@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...
>
Interestingly, scripts/checkpatch.pl couldn't detect this problem.
I once used printk(KERN_ALERT...) and the script would properly warn me
that,

     WARNING: Prefer [subsystem eg: netdev]_alert([subsystem]dev, ... then dev_alert(dev, ... then pr_alert(...  to printk(KERN_ALERT .

I'll fix this issue when sending another version of the patches. Thank
you for the reminding!

--
Best regards,
Coiby

WARNING: multiple messages have this Message-ID (diff)
From: Coiby Xu <coiby.xu@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: devel@driverdev.osuosl.org,
	"supporter:QLOGIC QLGE 10Gb ETHERNET DRIVER"
	<GR-Linux-NIC-Dev@marvell.com>,
	Manish Chopra <manishc@marvell.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:QLOGIC QLGE 10Gb ETHERNET DRIVER"
	<netdev@vger.kernel.org>
Subject: Re: [PATCH 2/2] staging: qlge: fix else after return or break
Date: Fri, 26 Jun 2020 19:47:33 +0800	[thread overview]
Message-ID: <20200626114733.ffjbwy7uooz2i73x@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...
>
Interestingly, scripts/checkpatch.pl couldn't detect this problem.
I once used printk(KERN_ALERT...) and the script would properly warn me
that,

     WARNING: Prefer [subsystem eg: netdev]_alert([subsystem]dev, ... then dev_alert(dev, ... then pr_alert(...  to printk(KERN_ALERT .

I'll fix this issue when sending another version of the patches. Thank
you for the reminding!

--
Best regards,
Coiby
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2020-06-26 11:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25 21:57 [PATCH 0/2] staging: qlge: coding style fix for the qlge driver Coiby Xu
2020-06-25 21:57 ` [PATCH 1/2] staging: qlge: fix trailing */ in block comment Coiby Xu
2020-06-25 21:57   ` Coiby Xu
2020-06-25 21:57 ` [PATCH 2/2] staging: qlge: fix else after return or break Coiby Xu
2020-06-25 21:57   ` Coiby Xu
2020-06-25 22:13   ` Joe Perches
2020-06-25 22:13     ` Joe Perches
2020-06-26 11:47     ` Coiby Xu [this message]
2020-06-26 11:47       ` Coiby Xu
2020-06-26 23:57     ` Coiby Xu
2020-06-26 23:57       ` Coiby Xu
2020-06-27  0:06       ` Joe Perches
2020-06-27  0:06         ` Joe Perches
2020-06-27 10:21         ` Coiby Xu
2020-06-27 10:21           ` Coiby Xu
2020-06-26  8:34   ` Dan Carpenter
2020-06-26  8:34     ` Dan Carpenter
2020-06-26 11:41     ` Coiby Xu
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=20200626114733.ffjbwy7uooz2i73x@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.