diff options
author | Haowen Bai <baihaowen@meizu.com> | 2022-03-17 10:35:54 +0800 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2022-11-24 23:12:17 +1100 |
commit | 2f59562c140d3119328f869126e8e593a99a392f (patch) | |
tree | 59cf9889ece83b4a9c28c009c880a78a4d5e02eb /drivers/macintosh | |
parent | e0acfdd13474815696595206e11169736b4bca9d (diff) | |
download | linux-2f59562c140d3119328f869126e8e593a99a392f.tar.gz linux-2f59562c140d3119328f869126e8e593a99a392f.tar.bz2 linux-2f59562c140d3119328f869126e8e593a99a392f.zip |
macintosh/adb: Fix warning comparing pointer to 0
Avoid pointer type value compared with 0 to make code clear.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1647484554-13258-1-git-send-email-baihaowen@meizu.com
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/adb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index 1bbb9ca08d40..23bd0c77ac1a 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c @@ -478,7 +478,7 @@ adb_register(int default_id, int handler_id, struct adb_ids *ids, if ((adb_handler[i].original_address == default_id) && (!handler_id || (handler_id == adb_handler[i].handler_id) || try_handler_change(i, handler_id))) { - if (adb_handler[i].handler != 0) { + if (adb_handler[i].handler) { pr_err("Two handlers for ADB device %d\n", default_id); continue; @@ -673,7 +673,7 @@ static int adb_open(struct inode *inode, struct file *file) goto out; } state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL); - if (state == 0) { + if (!state) { ret = -ENOMEM; goto out; } |