Skip to content

Commit 81b96e4

Browse files
vsyrjalahdeller
authored andcommitted
fbcon: Use 'bool' where appopriate
Use 'bool' type where it makes more sense than 'int'. v2: Rebase due to corrected 'fbcon_cursor_blink' initial value Acked-by: Helge Deller <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 311b078 commit 81b96e4

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

drivers/video/fbdev/core/fbcon.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ static int logo_shown = FBCON_LOGO_CANSHOW;
134134
/* console mappings */
135135
static unsigned int first_fb_vc;
136136
static unsigned int last_fb_vc = MAX_NR_CONSOLES - 1;
137-
static int fbcon_is_default = 1;
137+
static bool fbcon_is_default = true;
138138
static int primary_device = -1;
139-
static int fbcon_has_console_bind;
139+
static bool fbcon_has_console_bind;
140140

141141
#ifdef CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY
142142
static int map_override;
@@ -288,7 +288,7 @@ static bool fbcon_skip_panic(struct fb_info *info)
288288
#endif
289289
}
290290

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

@@ -297,7 +297,7 @@ static inline int fbcon_is_active(struct vc_data *vc, struct fb_info *info)
297297
}
298298

299299
static int get_color(struct vc_data *vc, struct fb_info *info,
300-
u16 c, int is_fg)
300+
u16 c, bool is_fg)
301301
{
302302
int depth = fb_get_color_depth(&info->var, &info->fix);
303303
int color = 0;
@@ -365,12 +365,12 @@ static int get_color(struct vc_data *vc, struct fb_info *info,
365365

366366
static int get_fg_color(struct vc_data *vc, struct fb_info *info, u16 c)
367367
{
368-
return get_color(vc, info, c, 1);
368+
return get_color(vc, info, c, true);
369369
}
370370

371371
static int get_bg_color(struct vc_data *vc, struct fb_info *info, u16 c)
372372
{
373-
return get_color(vc, info, c, 0);
373+
return get_color(vc, info, c, false);
374374
}
375375

376376
static void fb_flashcursor(struct work_struct *work)
@@ -474,7 +474,7 @@ static int __init fb_console_setup(char *this_opt)
474474
last_fb_vc = simple_strtoul(options, &options, 10) - 1;
475475
if (last_fb_vc < first_fb_vc || last_fb_vc >= MAX_NR_CONSOLES)
476476
last_fb_vc = MAX_NR_CONSOLES - 1;
477-
fbcon_is_default = 0;
477+
fbcon_is_default = false;
478478
continue;
479479
}
480480

@@ -569,7 +569,7 @@ static int do_fbcon_takeover(int show_logo)
569569
con2fb_map[i] = -1;
570570
info_idx = -1;
571571
} else {
572-
fbcon_has_console_bind = 1;
572+
fbcon_has_console_bind = true;
573573
}
574574

575575
return err;
@@ -2817,7 +2817,7 @@ static void fbcon_unbind(void)
28172817
fbcon_is_default);
28182818

28192819
if (!ret)
2820-
fbcon_has_console_bind = 0;
2820+
fbcon_has_console_bind = false;
28212821
}
28222822
#else
28232823
static inline void fbcon_unbind(void) {}
@@ -3268,8 +3268,9 @@ static ssize_t cursor_blink_store(struct device *device,
32683268
const char *buf, size_t count)
32693269
{
32703270
struct fb_info *info;
3271-
int blink, idx;
32723271
char **last = NULL;
3272+
bool blink;
3273+
int idx;
32733274

32743275
console_lock();
32753276
idx = con2fb_map[fg_console];

0 commit comments

Comments
 (0)