lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6b16f60d-0f76-f876-0881-de09ecbbbc89@molgen.mpg.de>
Date:   Wed, 11 May 2022 08:32:39 +0200
From:   Paul Menzel <pmenzel@...gen.mpg.de>
To:     Linkui Xiao <xiaolinkui@...il.com>
Cc:     jesse.brandeburg@...el.com, anthony.l.nguyen@...el.com,
        netdev@...r.kernel.org, Linkui Xiao <xiaolinkui@...inos.cn>,
        edumazet@...gle.com, intel-wired-lan@...ts.osuosl.org,
        kuba@...nel.org, pabeni@...hat.com, davem@...emloft.net
Subject: Re: [Intel-wired-lan] [PATCH] igb: Convert a series of if statements
 to switch case

Dear Linkui,


Thank you for your patch.

Am 10.05.22 um 04:57 schrieb xiaolinkui:
> From: Linkui Xiao<xiaolinkui@...inos.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@...inos.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@...gen.mpg.de>


Kind regards,

Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ