linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] macintosh: via-cuda: Fix warning comparing pointer to 0
@ 2022-03-17  2:40 Haowen Bai
  2022-03-17  8:44 ` Christophe Leroy
  0 siblings, 1 reply; 2+ messages in thread
From: Haowen Bai @ 2022-03-17  2:40 UTC (permalink / raw)
  To: benh, masahiroy, adobriyan; +Cc: linuxppc-dev, linux-kernel, Haowen Bai

Avoid pointer type value compared with 0 to make code clear.

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 {
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] macintosh: via-cuda: Fix warning comparing pointer to 0
  2022-03-17  2:40 [PATCH] macintosh: via-cuda: Fix warning comparing pointer to 0 Haowen Bai
@ 2022-03-17  8:44 ` Christophe Leroy
  0 siblings, 0 replies; 2+ messages in thread
From: Christophe Leroy @ 2022-03-17  8:44 UTC (permalink / raw)
  To: Haowen Bai, benh, masahiroy, adobriyan; +Cc: linuxppc-dev, linux-kernel

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 {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-17  8:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).