Messages in this thread Patch in this message |  | | From | Keith Owens <> | Subject | 2.1.22-patch_drivers_char-1 | Date | Sun, 26 Jan 1997 18:47:37 +1100 |
| |
This is a repeat of the patch against 2.1.21, it should have gone into 2.1.22. Removes warning messages and speeds up the code slightly.
diff -ur linux-2.1.21/drivers/char/vc_screen.c linux/drivers/char/vc_screen.c --- linux-2.1.21/drivers/char/vc_screen.c Sat Dec 14 01:04:14 1996 +++ linux/drivers/char/vc_screen.c Thu Jan 16 11:29:57 1997 @@ -134,18 +134,18 @@ { count--; put_user(header[p++], buf++); } } if (count > 0) { - p -= HEADER_SIZE; - org = screen_pos(currcons, p/2, viewed); - if ((p & 1) && count > 0) - { count--; put_user(func_scr_readw(org++) >> 8, buf++); } - } - while (count > 1) { - put_user(func_scr_readw(org++), (unsigned short *) buf); - buf += 2; - count -= 2; + p -= HEADER_SIZE; + org = screen_pos(currcons, p/2, viewed); + if (p & 1) + { count--; put_user(func_scr_readw(org++) >> 8, buf++); } + while (count > 1) { + put_user(func_scr_readw(org++), (unsigned short *) buf); + buf += 2; + count -= 2; + } + if (count > 0) + put_user(func_scr_readw(org) & 0xff, buf++); } - if (count > 0) - put_user(func_scr_readw(org) & 0xff, buf++); } read = buf - buf0; file->f_pos += read; @@ -200,28 +200,28 @@ putconsxy(currcons, header+2); } if (count > 0) { - p -= HEADER_SIZE; + p -= HEADER_SIZE; org = screen_pos(currcons, p/2, viewed); - if ((p & 1) && count > 0) { - char c; + if (p & 1) { + char c; count--; get_user(c,buf++); func_scr_writew((c << 8) | (func_scr_readw(org) & 0xff), org); org++; } - } - while (count > 1) { - unsigned short w; - get_user(w, (const unsigned short *) buf); - func_scr_writew(w, org++); - buf += 2; - count -= 2; - } - if (count > 0) { - unsigned char c; - get_user(c, (const unsigned char*)buf++); - func_scr_writew((func_scr_readw(org) & 0xff00) | c, org); + while (count > 1) { + unsigned short w; + get_user(w, (const unsigned short *) buf); + func_scr_writew(w, org++); + buf += 2; + count -= 2; + } + if (count > 0) { + unsigned char c; + get_user(c, (const unsigned char*)buf++); + func_scr_writew((func_scr_readw(org) & 0xff00) | c, org); + } } } written = buf - buf0;
|  |