Message ID | 20210825061838.69746-1-deng.changcheng@zte.com.cn (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Christophe Leroy |
Headers | show |
Series | [linux-next] drivers:smu: fix warning comparing pointer to 0 | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/github-powerpc_clang | success | Successfully ran 8 jobs. |
snowpatch_ozlabs/github-powerpc_sparse | success | Successfully ran 4 jobs. |
snowpatch_ozlabs/github-powerpc_kernel_qemu | success | Successfully ran 25 jobs. |
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 94fb63a..6cd0fef 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c @@ -1086,7 +1086,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; @@ -1253,7 +1253,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) { @@ -1276,7 +1276,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;