summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Li <lipeng321@huawei.com>2021-06-11 11:36:20 +0800
committerDavid S. Miller <davem@davemloft.net>2021-06-11 12:58:12 -0700
commit0cd2135cf83dd183d3fe05658e17b67b5f6cba86 (patch)
treef3e4ac3115c3824c5891a8af9b81d50f985a31f3
parentae6440483b545176b888bfe74971aa40a5749d46 (diff)
net: pc300too: replace comparison to NULL with "!card->plxbase"
According to the chackpatch.pl, comparison to NULL could be written "!card->plxbase". Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/wan/pc300too.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c
index 56f7d96298a3..ecce9992493d 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;