Skip to content

Commit 0cd2135

Browse files
321lipengdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: Guangbin Huang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ae64404 commit 0cd2135

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/wan/pc300too.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static int pc300_pci_init_one(struct pci_dev *pdev,
298298
}
299299

300300
card = kzalloc(sizeof(card_t), GFP_KERNEL);
301-
if (card == NULL) {
301+
if (!card) {
302302
pci_release_regions(pdev);
303303
pci_disable_device(pdev);
304304
return -ENOBUFS;
@@ -322,9 +322,7 @@ static int pc300_pci_init_one(struct pci_dev *pdev,
322322
ramphys = pci_resource_start(pdev, 3) & PCI_BASE_ADDRESS_MEM_MASK;
323323
card->rambase = pci_ioremap_bar(pdev, 3);
324324

325-
if (card->plxbase == NULL ||
326-
card->scabase == NULL ||
327-
card->rambase == NULL) {
325+
if (!card->plxbase || !card->scabase || !card->rambase) {
328326
pr_err("ioremap() failed\n");
329327
pc300_pci_remove_one(pdev);
330328
return -ENOMEM;

0 commit comments

Comments
 (0)