[PATCH] drm/vmwgfx: fix badzero.cocci warnings

kernel test robot lkp at intel.com
Wed May 5 10:10:28 UTC 2021


From: kernel test robot <lkp at intel.com>

drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c:674:25-26: WARNING comparing pointer to 0

 Compare pointer-typed values to NULL rather than 0

Semantic patch information:
 This makes an effort to choose between !x and x == NULL.  !x is used
 if it has previously been used with the function used to initialize x.
 This relies on type information.  More type information can be obtained
 using the option -all_includes and the option -I to specify an
 include path.

Generated by: scripts/coccinelle/null/badzero.cocci

CC: Zack Rusin <zackr at vmware.com>
Reported-by: kernel test robot <lkp at intel.com>
Signed-off-by: kernel test robot <lkp at intel.com>
---

url:    https://github.com/0day-ci/linux/commits/Zack-Rusin/drm-vmwgfx-SVGA-v3-and-arm64-support/20210505-120026
base:   git://anongit.freedesktop.org/drm/drm-tip drm-tip

 vmwgfx_cmd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c
@@ -671,5 +671,5 @@ bool vmw_cmd_supported(struct vmw_privat
 	/*
 	 * We have FIFO cmd's
 	 */
-	return vmw->fifo_mem != 0;
+	return vmw->fifo_mem != NULL;
 }


More information about the dri-devel mailing list