summaryrefslogtreecommitdiff
path: root/drivers/video/fbmem.c
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2005-07-30 01:03:33 +0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-30 02:01:14 +0400
commite4c5c82024f5f292c0069cf40422b8f3bf5e684e (patch)
tree09a6633c9a9d9ec388f90f1b12f2ea2553130ac3 /drivers/video/fbmem.c
parente1afc3f522ed088405fc8932110d338330db82bb (diff)
downloadlinux-e4c5c82024f5f292c0069cf40422b8f3bf5e684e.tar.xz
[PATCH] fbdev: Replace memcpy with for-loop when preparing bitmap
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>
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r--drivers/video/fbmem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 40784a944d05..d2e19f6dd72c 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -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;
}