Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1222535

[PATCH v2 16/16] Staging: rtl8188eu: os_dep: osdep_service.c: Remove explicit NULL comparison

From Shraddha Barke <shraddha.6596@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v2 16/16] Staging: rtl8188eu: os_dep: osdep_service.c: Remove explicit NULL comparison
Date 2015-09-11 07:20 +0200
Message-ID <q7oUG-k7-17@gated-at.bofh.it> (permalink)
References <q7oUF-k7-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Remove explicit NULL comparison and write it in its simpler form.
Replacement done with coccinelle:

@replace_rule@
expression e;
@@

-e == NULL
+ !e

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
Change in v2-
 No change

 drivers/staging/rtl8188eu/os_dep/osdep_service.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/osdep_service.c b/drivers/staging/rtl8188eu/os_dep/osdep_service.c
index acb4eb1..466cd76 100644
--- a/drivers/staging/rtl8188eu/os_dep/osdep_service.c
+++ b/drivers/staging/rtl8188eu/os_dep/osdep_service.c
@@ -52,7 +52,7 @@ void *rtw_malloc2d(int h, int w, int size)
 	int j;
 
 	void **a = kzalloc(h*sizeof(void *) + h*w*size, GFP_KERNEL);
-	if (a == NULL) {
+	if (!a) {
 		pr_info("%s: alloc memory fail!\n", __func__);
 		return NULL;
 	}
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v2 16/16] Staging: rtl8188eu: os_dep: osdep_service.c: Remove explicit NULL comparison Shraddha Barke <shraddha.6596@gmail.com> - 2015-09-11 07:20 +0200

csiph-web