Skip to content

Commit

Permalink
[PATCH] fbdev: Replace memcpy with for-loop when preparing bitmap
Browse files Browse the repository at this point in the history
Do not use memcpy in fb_pad_aligned_buffer.  It is suboptimal because only
a few bytes are moved at a time.  Replace with a for-loop.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Jul 29, 2005
1 parent e1afc3f commit e4c5c82
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/video/fbmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ EXPORT_SYMBOL(fb_get_color_depth);
*/
void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height)
{
int i;
int i, j;

for (i = height; i--; ) {
memcpy(dst, src, s_pitch);
/* s_pitch is a few bytes at the most, memcpy is suboptimal */
for (j = 0; j < s_pitch; j++)
dst[j] = src[j];
src += s_pitch;
dst += d_pitch;
}
Expand Down

0 comments on commit e4c5c82

Please sign in to comment.