mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yihao Han <hanyihao@vivo.com>
To: Benjamin Poirier <benjamin.poirier@gmail.com>
Cc: Shahed Shaikh <shshaikh@marvell.com>,
	Manish Chopra <manishc@marvell.com>,
	GR-Linux-NIC-Dev@marvell.com,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@vivo.com
Subject: Re: [PATCH] net: qlogic: qlcnic: simplify if-if to if-else
Date: Fri, 15 Apr 2022 14:17:17 +0800	[thread overview]
Message-ID: <c579fa38-5cac-1c51-5cdb-ac366b6043b7@vivo.com> (raw)
In-Reply-To: <YlkHQkZ33rkzAwhS@d3>



在 2022/4/15 13:48, Benjamin Poirier 写道:
> On 2022-04-13 20:11 -0700, Yihao Han wrote:
>> Replace `if (!pause->autoneg)` with `else` for simplification
>> and add curly brackets according to the kernel coding style:
>>
>> "Do not unnecessarily use braces where a single statement will do."
>>
>> ...
>>
>> "This does not apply if only one branch of a conditional statement is
>> a single statement; in the latter case use braces in both branches"
>>
>> Please refer to:
>> https://www.kernel.org/doc/html/v5.17-rc8/process/coding-style.html
> 
> Seems the part of the log about curly brackets doesn't correspond with
> the actual changes.
> 
>>
>> Signed-off-by: Yihao Han <hanyihao@vivo.com>
>> ---
>>   drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
>> index bd0607680329..e3842eaf1532 100644
>> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
>> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
>> @@ -3752,7 +3752,7 @@ int qlcnic_83xx_set_pauseparam(struct qlcnic_adapter *adapter,
>>   	if (ahw->port_type == QLCNIC_GBE) {
>>   		if (pause->autoneg)
>>   			ahw->port_config |= QLC_83XX_ENABLE_AUTONEG;
>> -		if (!pause->autoneg)
>> +		else
>>   			ahw->port_config &= ~QLC_83XX_ENABLE_AUTONEG;
>>   	} else if ((ahw->port_type == QLCNIC_XGBE) && (pause->autoneg)) {
>>   		return -EOPNOTSUPP;
>> -- 
>> 2.17.1
>>
Sorry that I made a mistake. I will send a v2 patch about this.
Thanks for your review.

regards,
Yihao

      reply	other threads:[~2022-04-15  6:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14  3:11 Yihao Han
2022-04-15  5:48 ` Benjamin Poirier
2022-04-15  6:17   ` Yihao Han [this message]

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=c579fa38-5cac-1c51-5cdb-ac366b6043b7@vivo.com \
    --to=hanyihao@vivo.com \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=benjamin.poirier@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kernel@vivo.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shshaikh@marvell.com \
    /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

all inboxes | Powered by JetHome®