macintosh/macio-adb: Fix warning comparing pointer to 0
authorHaowen Bai <baihaowen@meizu.com>
Thu, 17 Mar 2022 09:24:49 +0000 (17:24 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 24 Nov 2022 12:12:17 +0000 (23:12 +1100)
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/1647509089-4280-1-git-send-email-baihaowen@meizu.com
drivers/macintosh/macio-adb.c

index 9b63bd2551c632a4893f2be9332b5e11a03d4e85..3721402582b4fc9422bdd85619e830638fbb8120 100644 (file)
@@ -100,7 +100,7 @@ int macio_init(void)
        unsigned int irq;
 
        adbs = of_find_compatible_node(NULL, "adb", "chrp,adb0");
-       if (adbs == 0)
+       if (!adbs)
                return -ENXIO;
 
        if (of_address_to_resource(adbs, 0, &r)) {
@@ -183,7 +183,7 @@ static int macio_send_request(struct adb_request *req, int sync)
        req->reply_len = 0;
 
        spin_lock_irqsave(&macio_lock, flags);
-       if (current_req != 0) {
+       if (current_req) {
                last_req->next = req;
                last_req = req;
        } else {
@@ -213,7 +213,8 @@ static irqreturn_t macio_adb_interrupt(int irq, void *arg)
        spin_lock(&macio_lock);
        if (in_8(&adb->intr.r) & TAG) {
                handled = 1;
-               if ((req = current_req) != 0) {
+               req = current_req;
+               if (req) {
                        /* put the current request in */
                        for (i = 0; i < req->nbytes; ++i)
                                out_8(&adb->data[i].r, req->data[i]);