[Intel-gfx] [PATCH] drm/i915/: fix noderef.cocci warnings

kernel test robot lkp at intel.com
Wed Feb 9 16:52:01 UTC 2022


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

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1310:32-38: ERROR: application of sizeof to pointer
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1322:32-38: ERROR: application of sizeof to pointer

 sizeof when applied to a pointer typed expression gives the size of
 the pointer

Generated by: scripts/coccinelle/misc/noderef.cocci

CC: Michael Cheng <michael.cheng at intel.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/Michael-Cheng/Use-drm_clflush-instead-of-clflush/20220208-041326
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago

 i915_gem_execbuffer.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -1307,7 +1307,7 @@ static void clflush_write32(u32 *addr, u
 {
 	if (unlikely(flushes & (CLFLUSH_BEFORE | CLFLUSH_AFTER))) {
 		if (flushes & CLFLUSH_BEFORE)
-			drm_clflush_virt_range(addr, sizeof(addr));
+			drm_clflush_virt_range(addr, sizeof(*addr));
 
 		*addr = value;
 
@@ -1319,7 +1319,7 @@ static void clflush_write32(u32 *addr, u
 		 * to ensure ordering of clflush wrt to the system.
 		 */
 		if (flushes & CLFLUSH_AFTER)
-			drm_clflush_virt_range(addr, sizeof(addr));
+			drm_clflush_virt_range(addr, sizeof(*addr));
 	} else
 		*addr = value;
 }


More information about the Intel-gfx mailing list