@@ -157,7 +157,7 @@ EXPORT_SYMBOL(fb_pad_unaligned_buffer);
*/
char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size)
{
- u32 align = buf->buf_align - 1, offset;
+ u32 align, offset;
char *addr = buf->addr;
/* If IO mapped, we need to sync before access, no sharing of
@@ -169,6 +169,8 @@ char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size
return addr;
}
+ align = buf->buf_align - 1;
+
/* See if we fit in the remaining pixmap space */
offset = buf->offset + align;
offset &= ~align;