Skip to content

Commit ffc825a

Browse files
vsyrjalahdeller
authored andcommitted
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: Ville Syrjälä <[email protected]> Acked-by: Helge Deller <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 91a2564 commit ffc825a

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

drivers/video/fbdev/core/fbcon.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,12 @@ static bool fbcon_skip_panic(struct fb_info *info)
288288
#endif
289289
}
290290

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

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

299299
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,
12661266
struct fbcon_display *p = &fb_display[vc->vc_num];
12671267
u_int y_break;
12681268

1269-
if (fbcon_is_inactive(vc, info))
1269+
if (!fbcon_is_active(vc, info))
12701270
return;
12711271

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

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

1324-
if (!fbcon_is_inactive(vc, info))
1324+
if (fbcon_is_active(vc, info))
13251325
ops->clear_margins(vc, info, margin_color, bottom_only);
13261326
}
13271327

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

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

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

13391339
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,
17391739
struct fb_info *info = fbcon_info_from_console(vc->vc_num);
17401740
struct fbcon_display *p = &fb_display[vc->vc_num];
17411741

1742-
if (fbcon_is_inactive(vc, info))
1742+
if (!fbcon_is_active(vc, info))
17431743
return;
17441744

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

1766-
if (fbcon_is_inactive(vc, info))
1766+
if (!fbcon_is_active(vc, info))
17671767
return true;
17681768

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

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

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

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

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

2590-
if (fbcon_is_inactive(vc, info))
2590+
if (!fbcon_is_active(vc, info))
25912591
return;
25922592

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

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

0 commit comments

Comments
 (0)