[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1442243583-24741-15-git-send-email-sudipm.mukherjee@gmail.com>
Date: Mon, 14 Sep 2015 20:43:01 +0530
From: Sudip Mukherjee <sudipm.mukherjee@...il.com>
To: Thomas Dahlmann <dahlmann.thomas@...or.de>,
Felipe Balbi <balbi@...com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, linux-geode@...ts.infradead.org,
linux-usb@...r.kernel.org,
Sudip Mukherjee <sudipm.mukherjee@...il.com>
Subject: [PATCH 14/16] usb: gadget: amd5536udc: NULL comparison
A NULL comparison can be written as if (var) or if (!var).
Signed-off-by: Sudip Mukherjee <sudip@...torindia.org>
---
drivers/usb/gadget/udc/amd5536udc.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/gadget/udc/amd5536udc.c b/drivers/usb/gadget/udc/amd5536udc.c
index f6d6097..3657a66 100644
--- a/drivers/usb/gadget/udc/amd5536udc.c
+++ b/drivers/usb/gadget/udc/amd5536udc.c
@@ -2189,7 +2189,7 @@ static irqreturn_t udc_data_out_isr(struct udc *dev, int ep_ix)
}
/* DMA */
- } else if (!ep->cancel_transfer && req != NULL) {
+ } else if (!ep->cancel_transfer && req) {
ret_val = IRQ_HANDLED;
/* check for DMA done */
@@ -3139,7 +3139,7 @@ static void udc_pci_remove(struct pci_dev *pdev)
usb_del_gadget_udc(&udc->gadget);
/* gadget driver must not be registered */
- if (WARN_ON(dev->driver != NULL))
+ if (WARN_ON(dev->driver))
return;
/* dma pool cleanup */
@@ -3193,7 +3193,7 @@ static int init_dma_pools(struct udc *dev)
/* setup */
td_stp = dma_pool_alloc(dev->stp_requests, GFP_KERNEL,
&dev->ep[UDC_EP0OUT_IX].td_stp_dma);
- if (td_stp == NULL) {
+ if (!td_stp) {
retval = -ENOMEM;
goto err_alloc_dma;
}
@@ -3202,7 +3202,7 @@ static int init_dma_pools(struct udc *dev)
/* data: 0 packets !? */
td_data = dma_pool_alloc(dev->stp_requests, GFP_KERNEL,
&dev->ep[UDC_EP0OUT_IX].td_phys);
- if (td_data == NULL) {
+ if (!td_data) {
retval = -ENOMEM;
goto err_alloc_phys;
}
@@ -3328,7 +3328,7 @@ static int udc_pci_probe(
dev->mem_region = 1;
dev->virt_addr = ioremap_nocache(resource, len);
- if (dev->virt_addr == NULL) {
+ if (!dev->virt_addr) {
dev_dbg(&pdev->dev, "start address cannot be mapped\n");
retval = -EFAULT;
goto err_ioremap;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists