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] [day] [month] [year] [list]
Date:   Wed, 5 Jan 2022 14:54:30 +0900
From:   Damien Le Moal <damien.lemoal@...nsource.wdc.com>
To:     cgel.zte@...il.com
Cc:     linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org,
        Minghao Chi <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] drivers/ata: remove redundant val variable

On 1/4/22 20:25, cgel.zte@...il.com wrote:
> From: Minghao Chi <chi.minghao@....com.cn>
> 
> Return value from DIV_ROUND_UP() directly instead
> of taking this in another redundant variable.
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
> Signed-off-by: CGEL ZTE <cgel.zte@...il.com>
> ---
>  drivers/ata/pata_octeon_cf.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
> index b5a3f710d76d..70f91800fe9e 100644
> --- a/drivers/ata/pata_octeon_cf.c
> +++ b/drivers/ata/pata_octeon_cf.c
> @@ -73,16 +73,12 @@ MODULE_PARM_DESC(enable_dma,
>   */
>  static unsigned int ns_to_tim_reg(unsigned int tim_mult, unsigned int nsecs)
>  {
> -	unsigned int val;
> -
>  	/*
>  	 * Compute # of eclock periods to get desired duration in
>  	 * nanoseconds.
>  	 */
> -	val = DIV_ROUND_UP(nsecs * (octeon_get_io_clock_rate() / 1000000),
> +	return DIV_ROUND_UP(nsecs * (octeon_get_io_clock_rate() / 1000000),
>  			  1000 * tim_mult);
> -
> -	return val;
>  }
>  
>  static void octeon_cf_set_boot_reg_cfg(int cs, unsigned int multiplier)

Applied to for-5.17. Thanks.

-- 
Damien Le Moal
Western Digital Research

Powered by blists - more mailing lists