From 9155c92463ecbb55c6eca6145e139869e9ba1546 Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Wed, 24 Feb 2016 16:09:31 +0530 Subject: Staging: rtl8712: Clean up tests if NULL returned on failure Some functions like kmalloc/usb_alloc_urb/kmalloc_array returns NULL as their return value on failure. !x is generally preferred over x==NULL or NULL==x so make use of !x if the value returned on failure by these functions is NULL. Done using coccinelle: @@ expression e; statement S; @@ e = \(kmalloc\|devm_kzalloc\|kmalloc_array \|devm_ioremap\|usb_alloc_urb\|alloc_netdev\)(...); - if(e==NULL) + if(!e) S Signed-off-by: Bhumika Goyal Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8712/rtl871x_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging/rtl8712/rtl871x_io.c') diff --git a/drivers/staging/rtl8712/rtl871x_io.c b/drivers/staging/rtl8712/rtl871x_io.c index fbbc63570eab..3a10940db9b7 100644 --- a/drivers/staging/rtl8712/rtl871x_io.c +++ b/drivers/staging/rtl8712/rtl871x_io.c @@ -113,7 +113,7 @@ uint r8712_alloc_io_queue(struct _adapter *adapter) struct io_req *pio_req; pio_queue = kmalloc(sizeof(*pio_queue), GFP_ATOMIC); - if (pio_queue == NULL) + if (!pio_queue) goto alloc_io_queue_fail; INIT_LIST_HEAD(&pio_queue->free_ioreqs); INIT_LIST_HEAD(&pio_queue->processing); -- cgit v1.2.3