linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Haowen Bai <baihaowen@meizu.com>,
	"benh@kernel.crashing.org" <benh@kernel.crashing.org>,
	"masahiroy@kernel.org" <masahiroy@kernel.org>,
	"adobriyan@gmail.com" <adobriyan@gmail.com>
Cc: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] macintosh: via-cuda: Fix warning comparing pointer to 0
Date: Thu, 17 Mar 2022 08:44:34 +0000	[thread overview]
Message-ID: <e2cec39d-fce4-9181-63fb-fde90f1f9a86@csgroup.eu> (raw)
In-Reply-To: <1647484837-14352-1-git-send-email-baihaowen@meizu.com>

Hi,

Le 17/03/2022 à 03:40, Haowen Bai a écrit :
> Avoid pointer type value compared with 0 to make code clear.

We already have this change waiting in the queue, see 
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20220214010558.130201-1-yang.lee@linux.alibaba.com/

Thanks
Christophe

> 
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
> ---
>   drivers/macintosh/via-cuda.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c
> index cd267392..05a3cd9 100644
> --- a/drivers/macintosh/via-cuda.c
> +++ b/drivers/macintosh/via-cuda.c
> @@ -236,10 +236,10 @@ int __init find_via_cuda(void)
>       const u32 *reg;
>       int err;
>   
> -    if (vias != 0)
> +    if (vias)
>   	return 1;
>       vias = of_find_node_by_name(NULL, "via-cuda");
> -    if (vias == 0)
> +    if (!vias)
>   	return 0;
>   
>       reg = of_get_property(vias, "reg", NULL);
> @@ -517,7 +517,7 @@ cuda_write(struct adb_request *req)
>       req->reply_len = 0;
>   
>       spin_lock_irqsave(&cuda_lock, flags);
> -    if (current_req != 0) {
> +    if (current_req) {
>   	last_req->next = req;
>   	last_req = req;
>       } else {

      reply	other threads:[~2022-03-17  8:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17  2:40 [PATCH] macintosh: via-cuda: Fix warning comparing pointer to 0 Haowen Bai
2022-03-17  8:44 ` Christophe Leroy [this message]

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=e2cec39d-fce4-9181-63fb-fde90f1f9a86@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=adobriyan@gmail.com \
    --cc=baihaowen@meizu.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=masahiroy@kernel.org \
    /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).