--- linux-2.5.66/drivers/video/console/fbcon.c.patched Wed Mar 26 15:16:41 2003 +++ linux-2.5.66/drivers/video/console/fbcon.c Wed Mar 26 15:27:15 2003 @@ -1001,7 +1001,7 @@ int bgshift = (vc->vc_hi_font_mask) ? 13 : 12; int fgshift = (vc->vc_hi_font_mask) ? 9 : 8; int height, width, size, c; - int w, cur_height, i = 0; + int w, cur_height; char *font, *mask, *data; if (cursor->set & FB_CUR_SETCUR) @@ -1021,7 +1021,8 @@ cursor->set |= FB_CUR_SETSIZE; } - size = ((width + 7) >> 3) * height; + w = (width + 7) >> 3; + size = w * height; data = kmalloc(size, GFP_KERNEL); @@ -1034,10 +1035,7 @@ return; } - if (cursor->set & FB_CUR_SETSIZE) { - memset(data, 0xff, size); - cursor->set |= FB_CUR_SETSHAPE; - } + memset(data, 0xff, size); c = scr_readw((u16 *) vc->vc_pos); @@ -1053,8 +1051,6 @@ cursor->set |= FB_CUR_SETDEST; } - w = (width + 7) >> 3; - switch (vc->vc_cursor_type & 0x0f) { case CUR_NONE: cur_height = 0; @@ -1078,13 +1074,15 @@ } size = (height - cur_height) * w; - while (size--) - mask[i++] = 0; - size = cur_height * w; - while (size--) - mask[i++] = 0xff; - if (!info->cursor.mask || (memcmp(mask, info->cursor.mask, w*height))) + if (size) + memset(mask, 0x00, size); + + if (cur_height) + memset(mask + size, 0xff, cur_height * w); + + if ((cursor->set & FB_CUR_SETSIZE) || !info->cursor.mask || + memcmp(mask, info->cursor.mask, w*height)) cursor->set |= FB_CUR_SETSHAPE; cursor->image.width = width;