Skip to contentSkip to conversation

tests/util: fix incorrect memset argument order

PATCH In review Ilia Mirkin 2 participants 2 messages Jul 3, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/util: fix incorrect memset argument order

Make it actually clear the LUT.

---
 tests/util/pattern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/util/pattern.c +1 -1
index 42a0e5c7..bf1797d4 100644
@@ -643,7 +643,7 @@ void util_smpte_c8_gamma(unsigned size, struct drm_color_lut *lut)
 		printf("Error: gamma too small: %d < %d\n", size, 7 + 7 + 8);
 		return;
 	}
-	memset(lut, size * sizeof(struct drm_color_lut), 0);
+	memset(lut, 0, size * sizeof(struct drm_color_lut));
 
 #define FILL_COLOR(idx, r, g, b) \
 	lut[idx].red = (r) << 8; \
Signature · 6 lines
2.21.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 23 lines · Ilia Mirkin

Make it actually clear the LUT.

---
 tests/util/pattern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/util/pattern.c +1 -2
index 42a0e5c7..bf1797d4 100644
@@ -643,7 +643,7 @@ void util_smpte_c8_gamma(unsigned size, struct drm_color_lut *lut)
                printf("Error: gamma too small: %d < %d\n", size, 7 + 7 + 8);
                return;
        }
-       memset(lut, size * sizeof(struct drm_color_lut), 0);
+       memset(lut, 0, size * sizeof(struct drm_color_lut));
 
 #define FILL_COLOR(idx, r, g, b) \
        lut[idx].red = (r) << 8; \
--
Quoted 2 lines

2.21.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel