[Mesa-dev] [PATCH 1/2] intel: Fix ROUND_DOWN_TO macro

Eric Anholt eric at anholt.net
Mon Apr 11 13:49:09 PDT 2011


On Mon, 11 Apr 2011 10:30:42 -0700, "Ian Romanick" <idr at freedesktop.org> wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> Previously the macro would (ALIGN(value - alignment - 1, alignment)).
> At the very least, this was missing parenthesis around "alignment -
> 1".  As a result, if value was already aligned, it would be reduced by
> alignment.  Condisder:

Yeah, I pretty clearly meant to type "value - (alignment - 1)".

> I also think that ALIGN_FLOOR would be a better name for this macro,
> but ROUND_DOWN_TO matches rounddown in the Linux kernel.

Wish I'd just made the macro match linux's naming, at least.  Fail.

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110411/f58e41c2/attachment.pgp>


More information about the mesa-dev mailing list