From: Sam Ravnborg <sam@ravnborg.org>
To: Jason Yan <yanaijie@huawei.com>
Cc: linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, b.zolnierkie@samsung.com
Subject: Re: [PATCH] video: fbdev: valkyriefb.c: fix warning comparing pointer to 0
Date: Wed, 06 May 2020 19:07:01 +0000 [thread overview]
Message-ID: <20200506190701.GE8227@ravnborg.org> (raw)
In-Reply-To: <20200429140942.8137-1-yanaijie@huawei.com>
On Wed, Apr 29, 2020 at 10:09:42PM +0800, Jason Yan wrote:
> 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>
Thanks, applied to drm-misc-next.
Sam
> ---
> drivers/video/fbdev/valkyriefb.c | 4 ++--
> 1 file 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 */
> --
> 2.21.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2020-05-06 19:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-29 14:09 [PATCH] video: fbdev: valkyriefb.c: fix warning comparing pointer to 0 Jason Yan
2020-05-06 19:07 ` Sam Ravnborg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200506190701.GE8227@ravnborg.org \
--to=sam@ravnborg.org \
--cc=b.zolnierkie@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yanaijie@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).