Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp237252pxj; Thu, 10 Jun 2021 20:43:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvCWB1M1uLsGC+MznBWmhsUJO3beVOq0ETo/9Czq31DcRXb1ZeDjjmdXT83HbqPgCU4LpB X-Received: by 2002:a17:907:9688:: with SMTP id hd8mr1557614ejc.314.1623383005787; Thu, 10 Jun 2021 20:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623383005; cv=none; d=google.com; s=arc-20160816; b=DTnW0QThOxazRbLWRJhqsEY8JuH4cdm7JPyRom3Tvpn9nLkhCF92ginv7HA36iaiam 22pX8ebPf1j4DEZi8HDEMKYHvPBhJqyd8UYvTl/hnmpxfCDbI5TDccQkpV7KtyFyuy7j bzU2R4BZf1LR8mOiNPPdnahpu92iskSYGuM4gDAkC+madV9V0RwETAqgoUbalj5FJqhC yCcIX4ZAcXSToHKfYdBJaqvF5IgKYdfa79+uOdamWOfWYI98/XbmWSJMhL5eg+Uv72km jCfMcVL/ucCipEANl0ehW77ykbeUz6fgLJ+xdSd/HmtYHv2K8pmbdV9142akvHZTDvoQ OS5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=inIOd9DzLkHRyTtZO4BU/mRtC5E0N0ABr9VvKT8NEEI=; b=pEQWNQRugi2uxFOy+nTwiwxIbTPIc+wS4T0hei6HcRJTiIBmfvmBqihN5ovPbeiNrI So+1dSp2XJLLHoRF2CSUXyC5Zjo7P/HzdDHiMsANdtDTAEBiSFJwPF9Top3w3rGWiNr+ KIYPmNhJuh73uKATJlslOGOPWBYY+yz2CLflX/UVxwA6Vxt1b4C94hj7kM85mbWw837+ ZL3F07qVkQTj+vbQMfwkTSXd/ak47FbxSNlKCmnHbFaW7SCNECiBIfnrSZKwXUDpx4Cv kksl26EbvyZLYQSThPsA+G+ZjDtPO03YpqeRp35Jmvqkggpo9pHRgYKaXPZOvALNrSh+ amtA== 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=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ha1si3785228ejb.743.2021.06.10.20.43.02; Thu, 10 Jun 2021 20:43:25 -0700 (PDT) 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=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231666AbhFKDlw (ORCPT + 99 others); Thu, 10 Jun 2021 23:41:52 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:5497 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231526AbhFKDld (ORCPT ); Thu, 10 Jun 2021 23:41:33 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4G1RNC32FczZg2H; Fri, 11 Jun 2021 11:36:43 +0800 (CST) Received: from dggemi759-chm.china.huawei.com (10.1.198.145) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Fri, 11 Jun 2021 11:39:32 +0800 Received: from localhost.localdomain (10.67.165.24) by dggemi759-chm.china.huawei.com (10.1.198.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 11 Jun 2021 11:39:32 +0800 From: Guangbin Huang To: , , , , CC: , , , Subject: [PATCH net-next 6/8] net: pc300too: replace comparison to NULL with "!card->plxbase" Date: Fri, 11 Jun 2021 11:36:20 +0800 Message-ID: <1623382582-37854-7-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1623382582-37854-1-git-send-email-huangguangbin2@huawei.com> References: <1623382582-37854-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggemi759-chm.china.huawei.com (10.1.198.145) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Li According to the chackpatch.pl, comparison to NULL could be written "!card->plxbase". Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/pc300too.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c index 56f7d96..ecce999 100644 --- a/drivers/net/wan/pc300too.c +++ b/drivers/net/wan/pc300too.c @@ -298,7 +298,7 @@ static int pc300_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; @@ -322,9 +322,7 @@ static int pc300_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"); pc300_pci_remove_one(pdev); return -ENOMEM; -- 2.8.1