summaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
authorJing Yangyang <jing.yangyang@zte.com.cn>2021-08-24 23:18:38 -0700
committerMichael Ellerman <mpe@ellerman.id.au>2022-05-04 19:37:44 +1000
commit8cd1d2e9d08654b66c17432eccd404de9137ac08 (patch)
tree1da3e0c844e1ce09f05feb94bda580e7d1f1689b /drivers/macintosh
parenta2ece1f512959258f29a11909d23a44fc95edf97 (diff)
downloadlinux-8cd1d2e9d08654b66c17432eccd404de9137ac08.tar.bz2
macintosh/smu: Fix warning comparing pointer to 0
Fix the following coccicheck warning: ./drivers/macintosh/smu.c:1089: 11-12: WARNING comparing pointer to 0, suggest !E ./drivers/macintosh/smu.c:1256:11-12: WARNING comparing pointer to 0 Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20210825061838.69746-1-deng.changcheng@zte.com.cn
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/smu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index a4fbc3fc713d..d72d073d81fd 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;