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:   Tue, 23 Jun 2020 02:07:15 +0000
From:   "Song Bao Hua (Barry Song)" <song.bao.hua@...ilicon.com>
To:     Nathan Chancellor <natechancellor@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>
CC:     "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "clang-built-linux@...glegroups.com" 
        <clang-built-linux@...glegroups.com>
Subject: RE: [PATCH] mm: cma: Return cma->name directly in cma_get_name



> -----Original Message-----
> From: Nathan Chancellor [mailto:natechancellor@...il.com]
> Sent: Tuesday, June 23, 2020 1:59 PM
> To: Andrew Morton <akpm@...ux-foundation.org>
> Cc: linux-mm@...ck.org; linux-kernel@...r.kernel.org;
> clang-built-linux@...glegroups.com; Song Bao Hua (Barry Song)
> <song.bao.hua@...ilicon.com>; Nathan Chancellor
> <natechancellor@...il.com>
> Subject: [PATCH] mm: cma: Return cma->name directly in cma_get_name
> 
> clang warns:
> 
> mm/cma.c:55:14: warning: address of array 'cma->name' will always
> evaluate to 'true' [-Wpointer-bool-conversion]
>         return cma->name ? cma->name : "(undefined)";
>                ~~~~~^~~~ ~
> 1 warning generated.
> 
> After commit e7f0557d7de9 ("mm: cma: fix the name of CMA areas"),
> cma->name will be an array with some value worth printing so we do not
> need to check for NULL.
> 
> Link: https://github.com/ClangBuiltLinux/linux/issues/1063
> Signed-off-by: Nathan Chancellor <natechancellor@...il.com>

Thanks!

Acked-by: Barry Song <song.bao.hua@...ilicon.com>

> ---
>  mm/cma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/cma.c b/mm/cma.c
> index 31a61d410c59..6cf08817bac6 100644
> --- a/mm/cma.c
> +++ b/mm/cma.c
> @@ -52,7 +52,7 @@ unsigned long cma_get_size(const struct cma *cma)
> 
>  const char *cma_get_name(const struct cma *cma)
>  {
> -	return cma->name ? cma->name : "(undefined)";
> +	return cma->name;
>  }
> 
>  static unsigned long cma_bitmap_aligned_mask(const struct cma *cma,
> 
> base-commit: 27f11fea33608cbd321a97cbecfa2ef97dcc1821
> --
> 2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ