From patchwork Tue Jun 15 13:54:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lipeng (Y)" X-Patchwork-Id: 12321825 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5483EC48BE5 for ; Tue, 15 Jun 2021 13:57:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AB326147E for ; Tue, 15 Jun 2021 13:57:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231308AbhFON7t (ORCPT ); Tue, 15 Jun 2021 09:59:49 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:6381 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230254AbhFON7l (ORCPT ); Tue, 15 Jun 2021 09:59:41 -0400 Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4G48t93jCMz63cB; Tue, 15 Jun 2021 21:53:37 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Tue, 15 Jun 2021 21:57:35 +0800 From: Peng Li To: , , , , CC: , , Subject: [PATCH net-next 3/6] net: pci200syn: replace comparison to NULL with "!card" Date: Tue, 15 Jun 2021 21:54:20 +0800 Message-ID: <1623765263-36775-4-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1623765263-36775-1-git-send-email-lipeng321@huawei.com> References: <1623765263-36775-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org According to the chackpatch.pl, comparison to NULL could be written "!card". Signed-off-by: Peng Li --- drivers/net/wan/pci200syn.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c index a7eac90..cee3d65 100644 --- a/drivers/net/wan/pci200syn.c +++ b/drivers/net/wan/pci200syn.c @@ -279,7 +279,7 @@ static int pci200_pci_init_one(struct pci_dev *pdev, } card = kzalloc(sizeof(card_t), GFP_KERNEL); - if (card == NULL) { + if (!card) { pci_release_regions(pdev); pci_disable_device(pdev); return -ENOBUFS; @@ -310,9 +310,7 @@ static int pci200_pci_init_one(struct pci_dev *pdev, ramphys = pci_resource_start(pdev,3) & PCI_BASE_ADDRESS_MEM_MASK; card->rambase = pci_ioremap_bar(pdev, 3); - if (card->plxbase == NULL || - card->scabase == NULL || - card->rambase == NULL) { + if (!card->plxbase || !card->scabase || !card->rambase) { pr_err("ioremap() failed\n"); pci200_pci_remove_one(pdev); return -EFAULT;