Commit ffc825a2 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Helge Deller
Browse files

fbcon: fbcon_is_inactive() -> fbcon_is_active()



Invert fbcon_is_inactive() into fbcon_is_active(). Much easier
on the poor brain when you don't have to do dobule negations
all over the place.

Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: default avatarHelge Deller <deller@gmx.de>
Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 91a25646
Loading
Loading
Loading
Loading
+15 −15
Original line number Diff line number Diff line
@@ -288,12 +288,12 @@ static bool fbcon_skip_panic(struct fb_info *info)
#endif
}

static inline int fbcon_is_inactive(struct vc_data *vc, struct fb_info *info)
static inline int fbcon_is_active(struct vc_data *vc, struct fb_info *info)
{
	struct fbcon_ops *ops = info->fbcon_par;

	return (info->state != FBINFO_STATE_RUNNING ||
		vc->vc_mode != KD_TEXT || ops->graphics || fbcon_skip_panic(info));
	return info->state == FBINFO_STATE_RUNNING &&
		vc->vc_mode == KD_TEXT && !ops->graphics && !fbcon_skip_panic(info);
}

static int get_color(struct vc_data *vc, struct fb_info *info,
@@ -1266,7 +1266,7 @@ static void __fbcon_clear(struct vc_data *vc, unsigned int sy, unsigned int sx,
	struct fbcon_display *p = &fb_display[vc->vc_num];
	u_int y_break;

	if (fbcon_is_inactive(vc, info))
	if (!fbcon_is_active(vc, info))
		return;

	if (!height || !width)
@@ -1310,7 +1310,7 @@ static void fbcon_putcs(struct vc_data *vc, const u16 *s, unsigned int count,
	struct fbcon_display *p = &fb_display[vc->vc_num];
	struct fbcon_ops *ops = info->fbcon_par;

	if (!fbcon_is_inactive(vc, info))
	if (fbcon_is_active(vc, info))
		ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,
			   get_color(vc, info, scr_readw(s), 1),
			   get_color(vc, info, scr_readw(s), 0));
@@ -1321,7 +1321,7 @@ static void fbcon_clear_margins(struct vc_data *vc, int bottom_only)
	struct fb_info *info = fbcon_info_from_console(vc->vc_num);
	struct fbcon_ops *ops = info->fbcon_par;

	if (!fbcon_is_inactive(vc, info))
	if (fbcon_is_active(vc, info))
		ops->clear_margins(vc, info, margin_color, bottom_only);
}

@@ -1333,7 +1333,7 @@ static void fbcon_cursor(struct vc_data *vc, bool enable)

	ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);

	if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
	if (!fbcon_is_active(vc, info) || vc->vc_deccm != 1)
		return;

	if (vc->vc_cursor_type & CUR_SW)
@@ -1739,7 +1739,7 @@ static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx,
	struct fb_info *info = fbcon_info_from_console(vc->vc_num);
	struct fbcon_display *p = &fb_display[vc->vc_num];

	if (fbcon_is_inactive(vc, info))
	if (!fbcon_is_active(vc, info))
		return;

	if (!width || !height)
@@ -1763,7 +1763,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b,
	struct fbcon_display *p = &fb_display[vc->vc_num];
	int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK;

	if (fbcon_is_inactive(vc, info))
	if (!fbcon_is_active(vc, info))
		return true;

	fbcon_cursor(vc, false);
@@ -2147,7 +2147,7 @@ static bool fbcon_switch(struct vc_data *vc)
			fbcon_del_cursor_work(old_info);
	}

	if (fbcon_is_inactive(vc, info) ||
	if (!fbcon_is_active(vc, info) ||
	    ops->blank_state != FB_BLANK_UNBLANK)
		fbcon_del_cursor_work(info);
	else
@@ -2187,7 +2187,7 @@ static bool fbcon_switch(struct vc_data *vc)
	scrollback_max = 0;
	scrollback_current = 0;

	if (!fbcon_is_inactive(vc, info)) {
	if (fbcon_is_active(vc, info)) {
	    ops->var.xoffset = ops->var.yoffset = p->yscroll = 0;
	    ops->update_start(info);
	}
@@ -2243,7 +2243,7 @@ static bool fbcon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
		}
	}

 	if (!fbcon_is_inactive(vc, info)) {
	if (fbcon_is_active(vc, info)) {
		if (ops->blank_state != blank) {
			ops->blank_state = blank;
			fbcon_cursor(vc, !blank);
@@ -2257,7 +2257,7 @@ static bool fbcon_blank(struct vc_data *vc, enum vesa_blank_mode blank,
			update_screen(vc);
	}

	if (mode_switch || fbcon_is_inactive(vc, info) ||
	if (mode_switch || !fbcon_is_active(vc, info) ||
	    ops->blank_state != FB_BLANK_UNBLANK)
		fbcon_del_cursor_work(info);
	else
@@ -2587,7 +2587,7 @@ static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table)
	int i, j, k, depth;
	u8 val;

	if (fbcon_is_inactive(vc, info))
	if (!fbcon_is_active(vc, info))
		return;

	if (!con_is_visible(vc))
@@ -2687,7 +2687,7 @@ static void fbcon_modechanged(struct fb_info *info)
		scrollback_max = 0;
		scrollback_current = 0;

		if (!fbcon_is_inactive(vc, info)) {
		if (fbcon_is_active(vc, info)) {
		    ops->var.xoffset = ops->var.yoffset = p->yscroll = 0;
		    ops->update_start(info);
		}