From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: xiakaixu1987@gmail.com, mpe@ellerman.id.au,
benh@kernel.crashing.org, paulus@samba.org
Cc: linuxppc-dev@lists.ozlabs.org, Kaixu Xia <kaixuxia@tencent.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/mm: Fix comparing pointer to 0 warning
Date: Tue, 10 Nov 2020 07:07:18 +0100 [thread overview]
Message-ID: <9fd91aab-a418-5c48-0b0c-d657ccd2448a@csgroup.eu> (raw)
In-Reply-To: <1604976961-20441-1-git-send-email-kaixuxia@tencent.com>
Le 10/11/2020 à 03:56, xiakaixu1987@gmail.com a écrit :
> From: Kaixu Xia <kaixuxia@tencent.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@tencent.com>
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.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
>
next prev parent reply other threads:[~2020-11-10 6:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-10 2:56 [PATCH] powerpc/mm: Fix comparing pointer to 0 warning xiakaixu1987
2020-11-10 6:07 ` Christophe Leroy [this message]
2020-11-25 11:57 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9fd91aab-a418-5c48-0b0c-d657ccd2448a@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=benh@kernel.crashing.org \
--cc=kaixuxia@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=xiakaixu1987@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).