USB: usbmon: fix bug in mon_buff_area_shrink
[safe/jmp/linux-2.6] / drivers / video / console / fbcon.h
index beb6a74..89a3468 100644 (file)
@@ -92,7 +92,7 @@ struct fbcon_ops {
 #define attr_fgcol(fgshift,s)    \
        (((s) >> (fgshift)) & 0x0f)
 #define attr_bgcol(bgshift,s)    \
-       (((s) >> (bgshift)) & 0x07)
+       (((s) >> (bgshift)) & 0x0f)
 
 /* Monochrome */
 #define attr_bold(s) \
@@ -110,7 +110,7 @@ static inline int mono_col(const struct fb_info *info)
        __u32 max_len;
        max_len = max(info->var.green.length, info->var.red.length);
        max_len = max(info->var.blue.length, max_len);
-       return ~(0xfff << (max_len & 0xff));
+       return (~(0xfff << max_len)) & 0xff;
 }
 
 static inline int attr_col_ec(int shift, struct vc_data *vc,
@@ -146,10 +146,8 @@ static inline int attr_col_ec(int shift, struct vc_data *vc,
        return is_fg ? fg : bg;
 }
 
-#define attr_bgcol_ec(bgshift,vc,info)         \
-       attr_col_ec(bgshift,vc,info,0);
-#define attr_fgcol_ec(fgshift,vc,info)         \
-       attr_col_ec(fgshift,vc,info,1);
+#define attr_bgcol_ec(bgshift, vc, info) attr_col_ec(bgshift, vc, info, 0)
+#define attr_fgcol_ec(fgshift, vc, info) attr_col_ec(fgshift, vc, info, 1)
 
 /* Font */
 #define REFCOUNT(fd)   (((int *)(fd))[-1])