Skip to contentSkip to conversation

staging: android: Correct NULL comparison style in logger.c

PATCH In review Guillaume Vercoutere 2 participants 2 messages Jan 5, 2015 – Jan 18, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 staging: android: Correct NULL comparison style in logger.c

Replace explicit NULL comparison with !

---
 drivers/staging/android/logger.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/android/logger.c +3 -3
index 59ea1a7..72b804e 100644
@@ -707,11 +707,11 @@ static int __init create_log(char *log_name, int size)
 	unsigned char *buffer;
 
 	buffer = vmalloc(size);
-	if (buffer == NULL)
+	if (!buffer)
 		return -ENOMEM;
 
 	log = kzalloc(sizeof(struct logger_log), GFP_KERNEL);
-	if (log == NULL) {
+	if (!log) {
 		ret = -ENOMEM;
 		goto out_free_buffer;
 	}
@@ -719,7 +719,7 @@ static int __init create_log(char *log_name, int size)
 
 	log->misc.minor = MISC_DYNAMIC_MINOR;
 	log->misc.name = kstrdup(log_name, GFP_KERNEL);
-	if (log->misc.name == NULL) {
+	if (!log->misc.name) {
 		ret = -ENOMEM;
 		goto out_free_log;
 	}
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 1 line · Guillaume Vercoutere

Replace explicit NULL comparison with !

Not a good idea, you just lost typechecking :(