[Mesa-dev] [PATCH] gallium/util: fix align64

Ilia Mirkin imirkin at alum.mit.edu
Fri Jul 29 21:26:22 UTC 2016


Ouch, good one!

Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

On Fri, Jul 29, 2016 at 5:22 PM, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> it cut off the upper 32 bits
>
> Cc: mesa-stable at lists.freedesktop.org
> ---
>  src/gallium/auxiliary/util/u_math.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
> index c94967e..1661e63 100644
> --- a/src/gallium/auxiliary/util/u_math.h
> +++ b/src/gallium/auxiliary/util/u_math.h
> @@ -682,7 +682,7 @@ align(int value, int alignment)
>  static inline uint64_t
>  align64(uint64_t value, unsigned alignment)
>  {
> -   return (value + alignment - 1) & ~(alignment - 1);
> +   return (value + alignment - 1) & ~((uint64_t)alignment - 1);
>  }
>
>  /**
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list