Staging: speakup: Clear hi font bit from attributes
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Tue, 15 Mar 2016 20:34:59 +0000 (21:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 28 Mar 2016 14:30:36 +0000 (07:30 -0700)
Previously, speakup would see the hi-font bit in attributes.
Since this bit has nothing to do with attributes, we need to clear it.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/speakup/main.c

index a22fb07512a12959b4448ff227269e3e3783b4d3..97ca4ecca8a910f3fbad0ae8c26868de0ca5795b 100644 (file)
@@ -263,7 +263,7 @@ static struct notifier_block vt_notifier_block = {
 static unsigned char get_attributes(struct vc_data *vc, u16 *pos)
 {
        pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, 1);
-       return (u_char) (scr_readw(pos) >> 8);
+       return (scr_readw(pos) & ~vc->vc_hi_font_mask) >> 8;
 }
 
 static void speakup_date(struct vc_data *vc)
@@ -473,8 +473,10 @@ static u16 get_char(struct vc_data *vc, u16 *pos, u_char *attribs)
                w = scr_readw(pos);
                c = w & 0xff;
 
-               if (w & vc->vc_hi_font_mask)
+               if (w & vc->vc_hi_font_mask) {
+                       w &= ~vc->vc_hi_font_mask;
                        c |= 0x100;
+               }
 
                ch = inverse_translate(vc, c, 0);
                *attribs = (w & 0xff00) >> 8;