vc: propagate "viewed as bool" from screenpos up

viewed is used as a flag, i.e. bool. So treat is as such in most of the
places. vcs_vc is handled in the next patch.

Note: the last parameter of invert_screen was misnamed in the
declaration since 1.1.92.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20200818085706.12163-3-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jiri Slaby 2020-08-18 10:56:53 +02:00 committed by Greg Kroah-Hartman
parent a5c6bd806d
commit b8209f694f
4 changed files with 16 additions and 14 deletions

View File

@ -257,7 +257,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);
pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, true);
return (scr_readw(pos) & ~vc->vc_hi_font_mask) >> 8;
}
@ -465,7 +465,7 @@ static u16 get_char(struct vc_data *vc, u16 *pos, u_char *attribs)
u16 w;
u16 c;
pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, 1);
pos = screen_pos(vc, pos - (u16 *)vc->vc_origin, true);
w = scr_readw(pos);
c = w & 0xff;

View File

@ -54,7 +54,7 @@ static struct vc_selection {
/* set reverse video on characters s-e of console with selection. */
static inline void highlight(const int s, const int e)
{
invert_screen(vc_sel.cons, s, e-s+2, 1);
invert_screen(vc_sel.cons, s, e-s+2, true);
}
/* use complementary color to show the pointer */

View File

@ -284,7 +284,7 @@ static inline bool con_should_update(const struct vc_data *vc)
}
static inline unsigned short *screenpos(const struct vc_data *vc, int offset,
int viewed)
bool viewed)
{
unsigned short *p;
@ -544,7 +544,7 @@ int vc_uniscr_check(struct vc_data *vc)
* This must be preceded by a successful call to vc_uniscr_check() once
* the console lock has been taken.
*/
void vc_uniscr_copy_line(const struct vc_data *vc, void *dest, int viewed,
void vc_uniscr_copy_line(const struct vc_data *vc, void *dest, bool viewed,
unsigned int row, unsigned int col, unsigned int nr)
{
struct uni_screen *uniscr = get_vc_uniscr(vc);
@ -753,7 +753,7 @@ static void update_attr(struct vc_data *vc)
}
/* Note: inverting the screen twice should revert to the original state */
void invert_screen(struct vc_data *vc, int offset, int count, int viewed)
void invert_screen(struct vc_data *vc, int offset, int count, bool viewed)
{
unsigned short *p;
@ -812,7 +812,7 @@ void complement_pos(struct vc_data *vc, int offset)
if (old_offset != -1 && old_offset >= 0 &&
old_offset < vc->vc_screenbuf_size) {
scr_writew(old, screenpos(vc, old_offset, 1));
scr_writew(old, screenpos(vc, old_offset, true));
if (con_should_update(vc))
vc->vc_sw->con_putc(vc, old, oldy, oldx);
notify_update(vc);
@ -824,7 +824,7 @@ void complement_pos(struct vc_data *vc, int offset)
offset < vc->vc_screenbuf_size) {
unsigned short new;
unsigned short *p;
p = screenpos(vc, offset, 1);
p = screenpos(vc, offset, true);
old = scr_readw(p);
new = old ^ vc->vc_complement_mask;
scr_writew(new, p);
@ -1885,7 +1885,9 @@ static void set_mode(struct vc_data *vc, int on_off)
case 5: /* Inverted screen on/off */
if (vc->vc_decscnm != on_off) {
vc->vc_decscnm = on_off;
invert_screen(vc, 0, vc->vc_screenbuf_size, 0);
invert_screen(vc, 0,
vc->vc_screenbuf_size,
false);
update_attr(vc);
}
break;
@ -4743,7 +4745,7 @@ int con_font_op(struct vc_data *vc, struct console_font_op *op)
/* used by selection */
u16 screen_glyph(const struct vc_data *vc, int offset)
{
u16 w = scr_readw(screenpos(vc, offset, 1));
u16 w = scr_readw(screenpos(vc, offset, true));
u16 c = w & 0xff;
if (w & vc->vc_hi_font_mask)
@ -4763,7 +4765,7 @@ u32 screen_glyph_unicode(const struct vc_data *vc, int n)
EXPORT_SYMBOL_GPL(screen_glyph_unicode);
/* used by vcs - note the word offset */
unsigned short *screen_pos(const struct vc_data *vc, int w_offset, int viewed)
unsigned short *screen_pos(const struct vc_data *vc, int w_offset, bool viewed)
{
return screenpos(vc, 2 * w_offset, viewed);
}

View File

@ -34,11 +34,11 @@ extern unsigned char default_grn[];
extern unsigned char default_blu[];
extern unsigned short *screen_pos(const struct vc_data *vc, int w_offset,
int viewed);
bool viewed);
extern u16 screen_glyph(const struct vc_data *vc, int offset);
extern u32 screen_glyph_unicode(const struct vc_data *vc, int offset);
extern void complement_pos(struct vc_data *vc, int offset);
extern void invert_screen(struct vc_data *vc, int offset, int count, int shift);
extern void invert_screen(struct vc_data *vc, int offset, int count, bool viewed);
extern void getconsxy(const struct vc_data *vc, unsigned char xy[static 2]);
extern void putconsxy(struct vc_data *vc, unsigned char xy[static const 2]);
@ -49,7 +49,7 @@ extern void vcs_scr_updated(struct vc_data *vc);
extern int vc_uniscr_check(struct vc_data *vc);
extern void vc_uniscr_copy_line(const struct vc_data *vc, void *dest,
int viewed,
bool viewed,
unsigned int row, unsigned int col,
unsigned int nr);