* [PATCH 2/3] staging: android: Correct NULL comparison style in logger.c
@ 2015-01-05 14:25 Guillaume Vercoutere
2015-01-18 0:18 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Guillaume Vercoutere @ 2015-01-05 14:25 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: devel, linux-kernel, gvercoutere
Replace explicit NULL comparison with !
Signed-off-by: Guillaume Vercoutere <gvercoutere@gmail.com>
---
drivers/staging/android/logger.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
index 59ea1a7..72b804e 100644
--- a/drivers/staging/android/logger.c
+++ b/drivers/staging/android/logger.c
@@ -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;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/3] staging: android: Correct NULL comparison style in logger.c
2015-01-05 14:25 [PATCH 2/3] staging: android: Correct NULL comparison style in logger.c Guillaume Vercoutere
@ 2015-01-18 0:18 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2015-01-18 0:18 UTC (permalink / raw)
To: Guillaume Vercoutere; +Cc: devel, linux-kernel
On Mon, Jan 05, 2015 at 03:25:23PM +0100, Guillaume Vercoutere wrote:
> Replace explicit NULL comparison with !
Not a good idea, you just lost typechecking :(
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-18 0:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-05 14:25 [PATCH 2/3] staging: android: Correct NULL comparison style in logger.c Guillaume Vercoutere
2015-01-18 0:18 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox