diff mbox series

[libdrm] tests/util: fix incorrect memset argument order

Message ID 20190703032023.22232-1-imirkin@alum.mit.edu (mailing list archive)
State New, archived
Headers show
Series [libdrm] tests/util: fix incorrect memset argument order | expand

Commit Message

Ilia Mirkin July 3, 2019, 3:20 a.m. UTC
Make it actually clear the LUT.

Reported-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
---
 tests/util/pattern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Airlie July 3, 2019, 3:20 a.m. UTC | #1
Reviewed-by: Dave Airlie <airlied@redhat.com>

On Wed, Jul 3, 2019 at 1:20 PM Ilia Mirkin <imirkin@alum.mit.edu> wrote:
>
> Make it actually clear the LUT.
>
> Reported-by: Dave Airlie <airlied@redhat.com>
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
> ---
>  tests/util/pattern.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/util/pattern.c b/tests/util/pattern.c
> index 42a0e5c7..bf1797d4 100644
> --- a/tests/util/pattern.c
> +++ b/tests/util/pattern.c
> @@ -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; \
> --
> 2.21.0
>
diff mbox series

Patch

diff --git a/tests/util/pattern.c b/tests/util/pattern.c
index 42a0e5c7..bf1797d4 100644
--- a/tests/util/pattern.c
+++ b/tests/util/pattern.c
@@ -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; \