Discussion:
[Patch v2] staging: speakup: rename enum constants in CamelCase notation
Samuel Thibault
2018-07-26 07:16:32 UTC
Permalink
Subject: [PATCH v2] staging: speakup: rename enum constants in CamelCase
checkpatch.pl generates the following warnings.
CHECK: Avoid CamelCase: <CT_Off>
CHECK: Avoid CamelCase: <CT_On>
CHECK: Avoid CamelCase: <CT_Highlight>
CHECK: Avoid CamelCase: <CT_Window>
CHECK: Avoid CamelCase: <CT_Max>
Enum constants representing cursor track modes
like CT_Off, CT_On etc. are written
in CamelCase notation which is not the preferred
coding style in the Linux kernel and hence appears
as a warning by checkpatch. Rename CT_Off, CT_On,
CT_Highlight, CT_Window and CT_Max to CT_OFF, CT_ON,
CT_HIGHLIGHT, CT_WINDOW and CT_MAX respectively so
that they are no longer in CamelCase notation.
---
drivers/staging/speakup/main.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index 7824aa3..4a377b0 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -96,13 +96,13 @@ static int cursor_track = 1, prev_cursor_track = 1;
/* cursor track modes, must be ordered same as cursor_msgs */
enum {
CT_OFF = 0,
- CT_On,
- CT_Highlight,
- CT_Window,
- CT_Max
+ CT_ON,
+ CT_HIGHLIGHT,
+ CT_WINDOW,
+ CT_MAX
};
-#define read_all_mode CT_Max
+#define read_all_mode CT_MAX
static struct tty_struct *tty;
@@ -1288,7 +1288,7 @@ static void toggle_cursoring(struct vc_data *vc)
{
if (cursor_track == read_all_mode)
cursor_track = prev_cursor_track;
- if (++cursor_track >= CT_Max)
+ if (++cursor_track >= CT_MAX)
cursor_track = 0;
synth_printf("%s\n", spk_msg_get(MSG_CURSOR_MSGS_START + cursor_track));
}
@@ -1552,7 +1552,7 @@ static void do_handle_cursor(struct vc_data *vc, u_char value, char up_flag)
old_cursor_y = vc->vc_y;
speakup_console[vc->vc_num]->ht.cy = vc->vc_y;
cursor_con = vc->vc_num;
- if (cursor_track == CT_Highlight)
+ if (cursor_track == CT_HIGHLIGHT)
reset_highlight_buffers(vc);
cursor_timeout = spk_get_var(CURSOR_TIME);
mod_timer(&cursor_timer,
@@ -1701,14 +1701,14 @@ static void cursor_done(struct timer_list *unused)
handle_cursor_read_all(vc, read_all_key);
goto out;
}
- if (cursor_track == CT_Highlight) {
+ if (cursor_track == CT_HIGHLIGHT) {
if (speak_highlight(vc)) {
spk_keydown = 0;
is_cursor = 0;
goto out;
}
}
- if (cursor_track == CT_Window)
+ if (cursor_track == CT_WINDOW)
speakup_win_say(vc);
else if (is_cursor == 1 || is_cursor == 4)
say_line_from_to(vc, 0, vc->vc_cols, 0);
@@ -1757,7 +1757,7 @@ static void speakup_con_write(struct vc_data *vc, u16 *str, int len)
if (spk_bell_pos && spk_keydown && (vc->vc_x == spk_bell_pos - 1))
bleep(3);
if ((is_cursor) || (cursor_track == read_all_mode)) {
- if (cursor_track == CT_Highlight)
+ if (cursor_track == CT_HIGHLIGHT)
update_color_buffer(vc, str, len);
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return;
--
2.7.4
--
Samuel
<N> (* If you have a precise idea of the intended use of the following code, please
<N> write to ***@inria.fr and ask for the prize :-)
<N> -- Eduardo (11/8/97) *)
-+- N sur #ens-mim - et c'était un des développeurs -+-
Loading...