diff options
author | Eva Rachel Retuya <eraretuya@gmail.com> | 2016-02-27 15:39:24 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-12 09:09:09 +0300 |
commit | 7586170c84de561c7bf05dd0df0c4bf9786417d5 (patch) | |
tree | a698c5792626b23e9aad5c0cdbff6d80f380f77c /drivers/staging/rts5208/rtsx.c | |
parent | eff8bf82432b6a3cd367e765a1806ebe3d1556e8 (diff) | |
download | linux-7586170c84de561c7bf05dd0df0c4bf9786417d5.tar.xz |
staging: rts5208: simplify NULL tests
Replace direct comparisons to NULL i.e. 'x == NULL' with '!x' for
consistency. Coccinelle semantic patch used:
@@
identifier func;
expression x;
statement Z;
@@
x = func(...);
if (
(
+ !
x
- == NULL
|
+ !
- NULL ==
x
)
) Z
Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rts5208/rtsx.c')
-rw-r--r-- | drivers/staging/rts5208/rtsx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c index 62204b5bcdf4..5ebaf8c97887 100644 --- a/drivers/staging/rts5208/rtsx.c +++ b/drivers/staging/rts5208/rtsx.c @@ -880,7 +880,7 @@ static int rtsx_probe(struct pci_dev *pci, memset(dev, 0, sizeof(struct rtsx_dev)); dev->chip = kzalloc(sizeof(struct rtsx_chip), GFP_KERNEL); - if (dev->chip == NULL) { + if (!dev->chip) { err = -ENOMEM; goto errout; } @@ -901,7 +901,7 @@ static int rtsx_probe(struct pci_dev *pci, (unsigned int)pci_resource_len(pci, 0)); dev->addr = pci_resource_start(pci, 0); dev->remap_addr = ioremap_nocache(dev->addr, pci_resource_len(pci, 0)); - if (dev->remap_addr == NULL) { + if (!dev->remap_addr) { dev_err(&pci->dev, "ioremap error\n"); err = -ENXIO; goto errout; @@ -916,7 +916,7 @@ static int rtsx_probe(struct pci_dev *pci, dev->rtsx_resv_buf = dmam_alloc_coherent(&pci->dev, RTSX_RESV_BUF_LEN, &dev->rtsx_resv_buf_addr, GFP_KERNEL); - if (dev->rtsx_resv_buf == NULL) { + if (!dev->rtsx_resv_buf) { dev_err(&pci->dev, "alloc dma buffer fail\n"); err = -ENXIO; goto errout; |