Message ID | c31207c.c3.1844d85a6aa.Coremail.wangkailong@jari.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1547070wru; Sun, 6 Nov 2022 07:29:08 -0800 (PST) X-Google-Smtp-Source: AMsMyM4BDPCv9B80nzKgwrQPr4+jKmyAQpSH8vFAxP0kgjhfh3RmWfSgjYwLSA5h8JrgprbP19Hv X-Received: by 2002:a17:902:d18c:b0:187:1b86:daba with SMTP id m12-20020a170902d18c00b001871b86dabamr38784238plb.84.1667748548466; Sun, 06 Nov 2022 07:29:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667748548; cv=none; d=google.com; s=arc-20160816; b=pLN4o5TkMIpw/bLnWCsmvEfumt6eqBCyeuyDiSDHwN7dDXTZ7lj3+1a2VF5rh6WPX3 1B3EH1S1YSBfHFVB+0eIG+1y3BxDi5nDz3K1u/vGxI5ceX9s965OC7qXLXXEIgXGKkqL M+jPWPoNY99N7Z+sgS67W12iNbIrlwBBWDrSi46LZcOlxCO0u1kaswfDIUVsLAf/YmO1 h2FIgcHb3r6JQ4TmcLLst+ryljafLtfXKeITCcNYRb7xiRj1zhf4W+vit3ax4bgDoJc6 VfNhBge1VHEMhxsIf+JUeRXIZW8d48nGF3PSXIn+8zD0nyA6yVEBiJuXdVAAz1FXOhDx 2cgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:mime-version :content-transfer-encoding:subject:cc:to:from:date; bh=C/wyQYz7Xux/EAt7SKZ8FoCjIbFTlchumTiSdaNLfVw=; b=rOCXQDwf8owqOADIb61n2V5SSlYO+DWqG0D4lkmnYPN1Ro0gKGlCEJo5NuHvJaD6Tv O3sdU9CeGihgtRmxcl8Iw/EOfV8heRmnf4xn2Wdp7KzhaQ6Kso6OFQvIGjB9E5Iw+z9T 9lHfnGZ9X7vwODRTN214p/sucN2GUoiRhO39TIXFbIPAHYNd5SfWwZewtju803adOM2L dDGCenLIyp5SvLSIZ74FhzXQZsCDxLb++eD1+4O+WHxZ+xJKhlsoxHjfOSx9ihB6aV5r AOXausKizDbe0ml5RmHkuBLtNFcjYsMLgT44TXRL+JA1opU1Hl3EGErG6L7d9gOsPsBM Rkww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g18-20020a170902c99200b0017f61b0bc5bsi5361842plc.557.2022.11.06.07.28.54; Sun, 06 Nov 2022 07:29:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230082AbiKFPXc (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Sun, 6 Nov 2022 10:23:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230041AbiKFPXb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 6 Nov 2022 10:23:31 -0500 Received: from jari.cn (unknown [218.92.28.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E5DDA102C for <linux-kernel@vger.kernel.org>; Sun, 6 Nov 2022 07:23:30 -0800 (PST) Received: by ajax-webmail-localhost.localdomain (Coremail) ; Sun, 6 Nov 2022 23:18:35 +0800 (GMT+08:00) X-Originating-IP: [182.148.13.29] Date: Sun, 6 Nov 2022 23:18:35 +0800 (GMT+08:00) X-CM-HeaderCharset: UTF-8 From: wangkailong@jari.cn To: benh@kernel.crashing.org, christophe.leroy@csgroup.eu, mpe@ellerman.id.au Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] macintosh: Fix warning comparing pointer to 0 X-Priority: 3 X-Mailer: Coremail Webmail Server Version XT6.0.1 build 20210329(c53f3fee) Copyright (c) 2002-2022 www.mailtech.cn mispb-4e503810-ca60-4ec8-a188-7102c18937cf-zhkzyfz.cn Content-Transfer-Encoding: base64 Content-Type: text/plain; charset=UTF-8 MIME-Version: 1.0 Message-ID: <c31207c.c3.1844d85a6aa.Coremail.wangkailong@jari.cn> X-Coremail-Locale: zh_CN X-CM-TRANSID: AQAAfwCXq+FL0GdjB4wBAA--.52W X-CM-SenderInfo: 5zdqwypdlo00nj6mt2flof0/1tbiAQACB2FEYx0CzgAFsW X-Coremail-Antispam: 1Ur529EdanIXcx71UUUUU7IcSsGvfJ3iIAIbVAYjsxI4VW7Jw CS07vEb4IE77IF4wCS07vE1I0E4x80FVAKz4kxMIAIbVAFxVCaYxvI4VCIwcAKzIAtYxBI daVFxhVjvjDU= X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00,RCVD_IN_PBL,RDNS_NONE, T_SPF_HELO_PERMERROR,T_SPF_PERMERROR,XPRIO autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748761101877365213?= X-GMAIL-MSGID: =?utf-8?q?1748761101877365213?= |
Series |
macintosh: Fix warning comparing pointer to 0
|
|
Commit Message
KaiLong Wang
Nov. 6, 2022, 3:18 p.m. UTC
Fix the following coccicheck warning:
drivers/macintosh/macio-adb.c:103:13-14: WARNING comparing pointer to 0.
Signed-off-by: KaiLong Wang <wangkailong@jari.cn>
---
drivers/macintosh/macio-adb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
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 <wangkailong@jari.cn> > --- > 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)) {
Le 06/11/2022 à 17:08, Christophe JAILLET a écrit : > 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 <wangkailong@jari.cn> We already have such patches awaiting for application, see https://patchwork.ozlabs.org/project/linuxppc-dev/list/?submitter=83647 Please check patchwork before submitting such fixes as they may already exist. Thanks Christophe >> --- >> 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)) { >
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) return -ENXIO; if (of_address_to_resource(adbs, 0, &r)) {