From: Jason Yan Date: Wed, 29 Apr 2020 14:09:42 +0000 (+0800) Subject: video: fbdev: valkyriefb.c: fix warning comparing pointer to 0 X-Git-Tag: baikal/mips/sdk5.9~13559^2~13^2~3 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=f09a59021d02e0c586fd2a8803dea534463ad3e2;p=kernel.git 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 Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20200429140942.8137-1-yanaijie@huawei.com --- diff --git a/drivers/video/fbdev/valkyriefb.c b/drivers/video/fbdev/valkyriefb.c index 4d20c4603e5ae..8425afe37d7c0 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 */