[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9fd91aab-a418-5c48-0b0c-d657ccd2448a@csgroup.eu>
Date: Tue, 10 Nov 2020 07:07:18 +0100
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: xiakaixu1987@...il.com, mpe@...erman.id.au,
benh@...nel.crashing.org, paulus@...ba.org
Cc: Kaixu Xia <kaixuxia@...cent.com>, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] powerpc/mm: Fix comparing pointer to 0 warning
Le 10/11/2020 à 03:56, xiakaixu1987@...il.com a écrit :
> From: Kaixu Xia <kaixuxia@...cent.com>
>
> Fixes coccicheck warning:
>
> ./arch/powerpc/mm/pgtable_32.c:87:11-12: WARNING comparing pointer to 0
>
> Avoid pointer type value compared to 0.
>
> Reported-by: Tosk Robot <tencent_os_robot@...cent.com>
> Signed-off-by: Kaixu Xia <kaixuxia@...cent.com>
Reviewed-by: Christophe Leroy <christophe.leroy@...roup.eu>
> ---
> arch/powerpc/mm/pgtable_32.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
> index 079159e97bca..888b9713a316 100644
> --- a/arch/powerpc/mm/pgtable_32.c
> +++ b/arch/powerpc/mm/pgtable_32.c
> @@ -84,7 +84,7 @@ int __ref map_kernel_page(unsigned long va, phys_addr_t pa, pgprot_t prot)
> pg = pte_alloc_kernel(pd, va);
> else
> pg = early_pte_alloc_kernel(pd, va);
> - if (pg != 0) {
> + if (pg) {
> err = 0;
> /* The PTE should never be already set nor present in the
> * hash table
>
Powered by blists - more mailing lists