From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F0623C4332F for ; Sun, 6 Nov 2022 16:16:55 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4N4zyZ2zlmz3dxq for ; Mon, 7 Nov 2022 03:16:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=wanadoo.fr (client-ip=80.12.242.14; helo=smtp.smtpout.orange.fr; envelope-from=christophe.jaillet@wanadoo.fr; receiver=) Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4N4zxt6fNlz2x9J for ; Mon, 7 Nov 2022 03:16:16 +1100 (AEDT) Received: from [192.168.1.18] ([86.243.100.34]) by smtp.orange.fr with ESMTPA id riCForZc23VQxriCFoI6AX; Sun, 06 Nov 2022 17:08:41 +0100 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 06 Nov 2022 17:08:41 +0100 X-ME-IP: 86.243.100.34 Message-ID: Date: Sun, 6 Nov 2022 17:08:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] macintosh: Fix warning comparing pointer to 0 Content-Language: fr To: wangkailong@jari.cn, benh@kernel.crashing.org, christophe.leroy@csgroup.eu, mpe@ellerman.id.au References: From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Le 06/11/2022 à 16:18, wangkailong@jari.cn a écrit : > Fix the following coccicheck warning: > > drivers/macintosh/macio-adb.c:103:13-14: WARNING comparing pointer to 0. > > Signed-off-by: KaiLong Wang > --- > drivers/macintosh/macio-adb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c > index 9b63bd2551c6..1c1c375a817d 100644 > --- a/drivers/macintosh/macio-adb.c > +++ b/drivers/macintosh/macio-adb.c > @@ -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) Hi no, this should be "if (!adbs)" CJ > return -ENXIO; > > if (of_address_to_resource(adbs, 0, &r)) {