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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E7E9C433FE for ; Sun, 6 Nov 2022 16:08:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230083AbiKFQIw (ORCPT ); Sun, 6 Nov 2022 11:08:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229841AbiKFQIo (ORCPT ); Sun, 6 Nov 2022 11:08:44 -0500 Received: from smtp.smtpout.orange.fr (smtp-14.smtpout.orange.fr [80.12.242.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 079462DFF for ; Sun, 6 Nov 2022 08:08:42 -0800 (PST) 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 Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: From: Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)) {