[RFC] Define/use pad() instead of open coding it
Simon Thum
simon.thum at gmx.de
Fri Mar 12 00:56:33 PST 2010
Am 12.03.2010 07:01, schrieb Matt Turner:
> à la the Linux Kernel's ALIGN macro.
>
> Not even compile tested, some files might need to include "misc.h".
> +++ b/hw/xfree86/common/xf86Mode.c
> @@ -740,7 +740,7 @@ xf86CheckModeSize(ScrnInfoPtr scrp, int w, int x, int y)
> if ((w < 0) || (x < 0) || (y <= 0))
> return FALSE;
>
> - lineWidth = (((w * bpp) + pad - 1) / pad) * pad;
> + lineWidth = pad(w * bpp, pad);
That doesn't look like it. ^^^^^^^
The approach seems sane.
Cheers,
Simon
More information about the xorg-devel
mailing list