lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 6 May 2020 21:07:01 +0200
From:   Sam Ravnborg <sam@...nborg.org>
To:     Jason Yan <yanaijie@...wei.com>
Cc:     b.zolnierkie@...sung.com, dri-devel@...ts.freedesktop.org,
        linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] video: fbdev: valkyriefb.c: fix warning comparing
 pointer to 0

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@...wei.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@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

Powered by blists - more mailing lists