From patchwork Sat Aug 18 06:16:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhong jiang X-Patchwork-Id: 959178 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41sqrF3DKBz9s4V for ; Sat, 18 Aug 2018 16:27:57 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726095AbeHRJe1 (ORCPT ); Sat, 18 Aug 2018 05:34:27 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:50450 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726072AbeHRJe1 (ORCPT ); Sat, 18 Aug 2018 05:34:27 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 72BB6FA0CF6B2; Sat, 18 Aug 2018 14:27:51 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.399.0; Sat, 18 Aug 2018 14:27:52 +0800 From: zhong jiang To: CC: , , , , Subject: [PATCHv2] ide: Use NULL to compare with pointer-typed value rather than 0 Date: Sat, 18 Aug 2018 14:16:01 +0800 Message-ID: <1534572961-16423-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org We should use NULL to compare with pointer-typed value rather than 0. The issue is detected with the help of Coccinelle. Signed-off-by: zhong jiang --- 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 c5b902b..ca36a97 100644 --- a/drivers/ide/pmac.c +++ b/drivers/ide/pmac.c @@ -1682,7 +1682,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.