* [PATCH] macintosh: smu: Fix warning comparing pointer to 0
@ 2022-03-17 2:44 Haowen Bai
2022-03-17 8:46 ` Christophe Leroy
0 siblings, 1 reply; 2+ messages in thread
From: Haowen Bai @ 2022-03-17 2:44 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/smu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index a4fbc3f..d72d073 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -1087,7 +1087,7 @@ static int smu_open(struct inode *inode, struct file *file)
unsigned long flags;
pp = kzalloc(sizeof(struct smu_private), GFP_KERNEL);
- if (pp == 0)
+ if (!pp)
return -ENOMEM;
spin_lock_init(&pp->lock);
pp->mode = smu_file_commands;
@@ -1254,7 +1254,7 @@ static __poll_t smu_fpoll(struct file *file, poll_table *wait)
__poll_t mask = 0;
unsigned long flags;
- if (pp == 0)
+ if (!pp)
return 0;
if (pp->mode == smu_file_commands) {
@@ -1277,7 +1277,7 @@ static int smu_release(struct inode *inode, struct file *file)
unsigned long flags;
unsigned int busy;
- if (pp == 0)
+ if (!pp)
return 0;
file->private_data = NULL;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] macintosh: smu: Fix warning comparing pointer to 0
2022-03-17 2:44 [PATCH] macintosh: smu: Fix warning comparing pointer to 0 Haowen Bai
@ 2022-03-17 8:46 ` Christophe Leroy
0 siblings, 0 replies; 2+ messages in thread
From: Christophe Leroy @ 2022-03-17 8:46 UTC (permalink / raw)
To: Haowen Bai, benh, masahiroy, adobriyan; +Cc: linuxppc-dev, linux-kernel
Le 17/03/2022 à 03:44, Haowen Bai a écrit :
> Avoid pointer type value compared with 0 to make code clear.
>
> Signed-off-by: Haowen Bai <baihaowen@meizu.com>
This change is already awaiting at
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/20210825061838.69746-1-deng.changcheng@zte.com.cn/
Thanks
Christophe
> ---
> drivers/macintosh/smu.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
> index a4fbc3f..d72d073 100644
> --- a/drivers/macintosh/smu.c
> +++ b/drivers/macintosh/smu.c
> @@ -1087,7 +1087,7 @@ static int smu_open(struct inode *inode, struct file *file)
> unsigned long flags;
>
> pp = kzalloc(sizeof(struct smu_private), GFP_KERNEL);
> - if (pp == 0)
> + if (!pp)
> return -ENOMEM;
> spin_lock_init(&pp->lock);
> pp->mode = smu_file_commands;
> @@ -1254,7 +1254,7 @@ static __poll_t smu_fpoll(struct file *file, poll_table *wait)
> __poll_t mask = 0;
> unsigned long flags;
>
> - if (pp == 0)
> + if (!pp)
> return 0;
>
> if (pp->mode == smu_file_commands) {
> @@ -1277,7 +1277,7 @@ static int smu_release(struct inode *inode, struct file *file)
> unsigned long flags;
> unsigned int busy;
>
> - if (pp == 0)
> + if (!pp)
> return 0;
>
> file->private_data = NULL;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-03-17 8:47 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:44 [PATCH] macintosh: smu: Fix warning comparing pointer to 0 Haowen Bai
2022-03-17 8:46 ` 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).