History

vc: switch state to bool

The code currently uses bitfields to store true-false values. Switch all of that to bools. Apart from the cleanup, it saves 20B of code as many shifts, ANDs, and ORs became simple movzb's.

Jiri Slaby committed 6 years ago

Commit 77bc14f1 parent b84ae3d7 files · +33 −29Browse files

Showing the changes to include/linux (2 of 7 files). Show all

Unified · Split

2 files
  1. include/linux/console.h +1 −1
  2. include/linux/console_struct.h +4 −4
include/linux/console.h+1−1
@@ -78,7 +78,7 @@ struct consw { · 77 unmodified lines
7878 void (*con_save_screen)(struct vc_data *vc);
7979 u8 (*con_build_attr)(struct vc_data *vc, u8 color,
8080 enum vc_intensity intensity,
81− u8 blink, u8 underline, u8 reverse, u8 italic);
81+ bool blink, bool underline, bool reverse, bool italic);
8282 void (*con_invert_region)(struct vc_data *vc, u16 *p, int count);
8383 u16 *(*con_screen_pos)(struct vc_data *vc, int offset);
8484 unsigned long (*con_getxy)(struct vc_data *vc, unsigned long position,
include/linux/console_struct.h+4−4
@@ -54,10 +54,10 @@ struct vc_state { · 53 unmodified lines
5454
5555 /* attribute flags */
5656 enum vc_intensity intensity;
57− unsigned int italic : 1;
58− unsigned int underline : 1;
59− unsigned int blink : 1;
60− unsigned int reverse : 1;
57+ bool italic;
58+ bool underline;
59+ bool blink;
60+ bool reverse;
6161 };
6262
6363 /*