From patchwork Thu Mar 11 10:18:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiapeng Chong X-Patchwork-Id: 1451048 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4Dx4gg5zBdz9sWW for ; Thu, 11 Mar 2021 21:19:43 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232245AbhCKKTL (ORCPT ); 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-ide@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.