Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Linkui Xiao <xiaolinkui@gmail.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [PATCH] igb: Convert a series of if statements to switch case
Date: Wed, 11 May 2022 17:13:07 +0800	[thread overview]
Message-ID: <d42df7fa-0eb1-bf89-6e8f-f4fc5ff138b2@gmail.com> (raw)
In-Reply-To: <6b16f60d-0f76-f876-0881-de09ecbbbc89@molgen.mpg.de>

Dear Paul:

Thank you for your reply and suggestions, I will send the V2 version soon.

On 5/11/22 14:32, Paul Menzel wrote:
> Dear Linkui,
>
>
> Thank you for your patch.
>
> Am 10.05.22 um 04:57 schrieb xiaolinkui:
>> From: Linkui Xiao<xiaolinkui@kylinos.cn>
>
> Please add a space before the <.
>
>> Convert a series of if statements that handle different events to
>> a switch case statement to simplify the code.
>
> (Nit: Please use 75 characters per line.)
>
>> Signed-off-by: Linkui Xiao<xiaolinkui@kylinos.cn>
>> ---
>> ? drivers/net/ethernet/intel/igb/igb_main.c | 12 ++++++++----
>> ? 1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c 
>> b/drivers/net/ethernet/intel/igb/igb_main.c
>> index 34b33b21e0dc..4ce0718eeff6 100644
>> --- a/drivers/net/ethernet/intel/igb/igb_main.c
>> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
>> @@ -4588,13 +4588,17 @@ static inline void 
>> igb_set_vf_vlan_strip(struct igb_adapter *adapter,
>> ????? struct e1000_hw *hw = &adapter->hw;
>> ????? u32 val, reg;
>> ? -??? if (hw->mac.type < e1000_82576)
>> +??? switch (hw->mac.type) {
>> +??? case e1000_undefined:
>> +??? case e1000_82575:
>> ????????? return;
>> -
>> -??? if (hw->mac.type == e1000_i350)
>> +??? case e1000_i350:
>> ????????? reg = E1000_DVMOLR(vfn);
>> -??? else
>> +??????? break;
>> +??? default:
>> ????????? reg = E1000_VMOLR(vfn);
>> +??????? break;
>> +??? }
>> ? ????? val = rd32(reg);
>> ????? if (enable)
>
> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
>
>
> Kind regards,
>
> Paul

  reply	other threads:[~2022-05-11  9:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10  2:57 [Intel-wired-lan] [PATCH] igb: Convert a series of if statements to switch case xiaolinkui
2022-05-11  6:32 ` Paul Menzel
2022-05-11  9:13   ` Linkui Xiao [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-11  9:20 xiaolinkui
2022-05-12 13:14 ` David Laight
2022-05-12 13:31   ` Linkui Xiao
2022-05-12 18:47   ` Tony Nguyen

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=d42df7fa-0eb1-bf89-6e8f-f4fc5ff138b2@gmail.com \
    --to=xiaolinkui@gmail.com \
    --cc=intel-wired-lan@osuosl.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