Skip to content

Commit

Permalink
video: fbdev: valkyriefb.c: fix warning comparing pointer to 0
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jason Yan authored and Sam Ravnborg committed May 6, 2020
1 parent c7f66d3 commit bec1277
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/video/fbdev/valkyriefb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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 */
Expand Down

0 comments on commit bec1277

Please sign in to comment.