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  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]
Date:	Wed, 3 Feb 2016 13:07:09 +1100
From:	Julian Calaby <julian.calaby@...il.com>
To:	Byeoungwook Kim <quddnr145@...il.com>
Cc:	Larry Finger <Larry.Finger@...inger.net>,
	Kalle Valo <kvalo@...eaurora.org>,
	Chaoming Li <chaoming_li@...lsil.com.cn>,
	linux-wireless <linux-wireless@...r.kernel.org>,
	netdev <netdev@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] rtlwifi: Fix improve function 'rtl_addr_delay()' in core.c

Hi Byeounwook,

On Wed, Feb 3, 2016 at 12:59 PM, Byeoungwook Kim <quddnr145@...il.com> wrote:
> Conditional codes in rtl_addr_delay() were improved in readability and
> performance by using switch codes.
>
> Signed-off-by: Byeoungwook Kim <quddnr145@...il.com>
> Reported-by: Julian Calaby <julian.calaby@...il.com>

Reviewed-by: Julian Calaby <julian.calaby@...il.com>

Thanks,

Julian Calaby


> ---
>  drivers/net/wireless/realtek/rtlwifi/core.c | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c
> index 4ae421e..05f432c 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/core.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/core.c
> @@ -37,18 +37,26 @@
>
>  void rtl_addr_delay(u32 addr)
>  {
> -       if (addr == 0xfe)
> +       switch (addr) {
> +       case 0xfe:
>                 mdelay(50);
> -       else if (addr == 0xfd)
> +               break;
> +       case 0xfd:
>                 mdelay(5);
> -       else if (addr == 0xfc)
> +               break;
> +       case 0xfc:
>                 mdelay(1);
> -       else if (addr == 0xfb)
> +               break;
> +       case 0xfb:
>                 udelay(50);
> -       else if (addr == 0xfa)
> +               break;
> +       case 0xfa:
>                 udelay(5);
> -       else if (addr == 0xf9)
> +               break;
> +       case 0xf9:
>                 udelay(1);
> +               break;
> +       };
>  }
>  EXPORT_SYMBOL(rtl_addr_delay);
>
> --
> 2.5.0
>



-- 
Julian Calaby

Email: julian.calaby@...il.com
Profile: http://www.google.com/profiles/julian.calaby/

Powered by blists - more mailing lists