diff options
author | Jason Yan <yanaijie@huawei.com> | 2020-04-29 22:09:42 +0800 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2020-05-06 21:04:45 +0200 |
commit | bec1277a7ebdc2139a24177db825eed21fd63ee9 (patch) | |
tree | 839d20f897f05dbc3cd2e766cd113c0f1b494bf9 /drivers/video/fbdev | |
parent | c7f66d32dd431cc30139324a7e0956f641dc6ff0 (diff) |
video: fbdev: valkyriefb.c: fix warning comparing pointer to 0
Fix the following coccicheck warning:
drivers/video/fbdev/valkyriefb.c:348:10-11: WARNING comparing pointer to
0, suggest !E
drivers/video/fbdev/valkyriefb.c:334:12-13: WARNING comparing pointer to
0
drivers/video/fbdev/valkyriefb.c:348:10-11: WARNING comparing pointer to
0
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200429140942.8137-1-yanaijie@huawei.com
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r-- | drivers/video/fbdev/valkyriefb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/fbdev/valkyriefb.c b/drivers/video/fbdev/valkyriefb.c index 4d20c4603e5a..8425afe37d7c 100644 --- a/drivers/video/fbdev/valkyriefb.c +++ b/drivers/video/fbdev/valkyriefb.c @@ -331,7 +331,7 @@ int __init valkyriefb_init(void) struct resource r; dp = of_find_node_by_name(NULL, "valkyrie"); - if (dp == 0) + if (!dp) return 0; if (of_address_to_resource(dp, 0, &r)) { @@ -345,7 +345,7 @@ int __init valkyriefb_init(void) #endif /* ppc (!CONFIG_MAC) */ p = kzalloc(sizeof(*p), GFP_ATOMIC); - if (p == 0) + if (!p) return -ENOMEM; /* Map in frame buffer and registers */ |