]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: wan: replace comparison to NULL with "!card"
authorPeng Li <lipeng321@huawei.com>
Mon, 24 May 2021 14:47:15 +0000 (22:47 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 May 2021 21:07:38 +0000 (14:07 -0700)
According to the chackpatch.pl, comparison to NULL could
be written "!card".

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>
drivers/net/wan/wanxl.c

index a5f0aae30e0ced1e3f67039349947e914dec40e1..5a89b6d4d92e15b982b0832a68c7249c408a9823 100644 (file)
@@ -600,7 +600,7 @@ static int wanxl_pci_init_one(struct pci_dev *pdev,
        }
 
        card = kzalloc(struct_size(card, ports, ports), GFP_KERNEL);
-       if (card == NULL) {
+       if (!card) {
                pci_release_regions(pdev);
                pci_disable_device(pdev);
                return -ENOBUFS;
@@ -612,7 +612,7 @@ static int wanxl_pci_init_one(struct pci_dev *pdev,
        card->status = dma_alloc_coherent(&pdev->dev,
                                          sizeof(struct card_status),
                                          &card->status_address, GFP_KERNEL);
-       if (card->status == NULL) {
+       if (!card->status) {
                wanxl_pci_remove_one(pdev);
                return -ENOBUFS;
        }