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]
Date:   Tue, 22 Dec 2020 17:11:39 +0000
From:   Daniel Thompson <daniel.thompson@...aro.org>
To:     Zheng Yongjun <zhengyongjun3@...wei.com>
Cc:     jason.wessel@...driver.com, kgdb-bugreport@...ts.sourceforge.net,
        linux-kernel@...r.kernel.org, dianders@...omium.org
Subject: Re: [PATCH -next] misc: use DIV_ROUND_UP macro to do calculation

On Tue, Dec 22, 2020 at 09:33:44PM +0800, Zheng Yongjun wrote:
> Don't open-code DIV_ROUND_UP() kernel macro.
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
> ---
>  drivers/misc/kgdbts.c | 5 ++---

Arguably this patch should have kgdbts in the Subject line.


>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/misc/kgdbts.c b/drivers/misc/kgdbts.c
> index 945701bce553..cd086921a792 100644
> --- a/drivers/misc/kgdbts.c
> +++ b/drivers/misc/kgdbts.c
> @@ -139,9 +139,8 @@ static int restart_from_top_after_write;
>  static int sstep_state;
>  
>  /* Storage for the registers, in GDB format. */
> -static unsigned long kgdbts_gdb_regs[(NUMREGBYTES +
> -					sizeof(unsigned long) - 1) /
> -					sizeof(unsigned long)];
> +static unsigned long kgdbts_gdb_regs[DIV_ROUND_UP(NUMREGBYTES,
> +				     sizeof(unsigned long)i)];

How was this patch tested? This code does not look like it is
compilable.


Daniel.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ