Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp226221pxf; Thu, 11 Mar 2021 02:20:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbzNF7YTRcfJ025OsukbNTf9jQDanvyxde08Af52r0M6jYCu0vBCLP2KDLbKyxcvWEHRZR X-Received: by 2002:a17:906:154f:: with SMTP id c15mr1291830ejd.142.1615458034788; Thu, 11 Mar 2021 02:20:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615458034; cv=none; d=google.com; s=arc-20160816; b=Tr/Tp7Y6qdue0BVNPryVqVJQmdt5PuXR2H8bQkg8erqCYMQnJ3a7nr3HYyn+NEwknT X0HGIMFI7YvToRK4Qbffg+x9svwa2/+DZ0b8hO/3l5GM6PvR+LZpBp+attTROPP9sew+ M0slGKbycVbUTDjAko0Y8rAm5iC+NhSc3SxLJgcGMBIw7qDhTxt4w64XJjEIN5UqRl8V VeSHplwyvb8bB/PlXitwyRBPvvYB67EJF49bT+LMTPoU8IIeBGLuCyTtBiAogPAFIUkH STOGXP1w4iU6SaFUgBLP0yV3doW5OBm8M0+ImO5bBNs2qv/RcCuhXRKDAjRfUXb/WyaJ yIsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=sx/U6tihUbWGovMjbdX/Ec6n+Ab1B8rPnTnQdMuF8co=; b=kHwwQC3Z1IeJVKG/L6XSh0V3pY8p6DPg/CN/es8qwqfQLlHeLUJsZPScumvU35zIfD XtzLHEL4+P+h4IMXgZDKe30b7jg/MAd8gZIvGN+ZGntY2VVPPjtLrrd9sLzS77L67ZJJ PtU1QBL0qDfrzFAElXOeL3kC4Ilc9Bn7n1evCe43TtodJOc/KIvFKxh9P4CAu25fqUZ7 UBcAlZCP8PinIcBvmek1sBmHbJ3cNdumE9qbDzyaLS9/55F+zlX7unpj2dvThvhRGTWf aSXmsACYyvqkYg5GEJ5q96TTMpYjILxOYSPOxAst3w7dKm0BkbRChG5vAqtPxAqa6yV7 rzyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v11si1371122eje.681.2021.03.11.02.20.12; Thu, 11 Mar 2021 02:20:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232228AbhCKKTL (ORCPT + 99 others); Thu, 11 Mar 2021 05:19:11 -0500 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:44566 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232246AbhCKKTC (ORCPT ); Thu, 11 Mar 2021 05:19:02 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R341e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0URT4LO3_1615457937; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0URT4LO3_1615457937) by smtp.aliyun-inc.com(127.0.0.1); Thu, 11 Mar 2021 18:18:59 +0800 From: Jiapeng Chong To: davem@davemloft.net Cc: mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, linux-ide@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH v2] ide: fix warning comparing pointer to 0 Date: Thu, 11 Mar 2021 18:18:52 +0800 Message-Id: <1615457932-33841-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccicheck warning: ./drivers/ide/pmac.c:1680:38-39: WARNING comparing pointer to 0. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- Changes in v2: - Modified if condition. drivers/ide/pmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c index ea0b064..8e1388b 100644 --- a/drivers/ide/pmac.c +++ b/drivers/ide/pmac.c @@ -1677,7 +1677,7 @@ static int pmac_ide_init_dma(ide_hwif_t *hwif, const struct ide_port_info *d) /* We won't need pci_dev if we switch to generic consistent * DMA routines ... */ - if (dev == NULL || pmif->dma_regs == 0) + if (!dev || !pmif->dma_regs) return -ENODEV; /* * Allocate space for the DBDMA commands. -- 1.8.3.1