diff options
-rw-r--r-- | drivers/staging/speakup/main.c | 13 | ||||
-rw-r--r-- | drivers/staging/speakup/speakup_decext.c | 3 | ||||
-rw-r--r-- | drivers/staging/speakup/speakup_dectlk.c | 3 | ||||
-rw-r--r-- | drivers/staging/speakup/speakup_soft.c | 4 | ||||
-rw-r--r-- | drivers/staging/speakup/spk_priv_keyinfo.h | 9 | ||||
-rw-r--r-- | drivers/staging/speakup/spk_ttyio.c | 20 | ||||
-rw-r--r-- | drivers/staging/speakup/varhandlers.c | 3 |
7 files changed, 36 insertions, 19 deletions
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c index c092a8ea45e2..b6a65b0c1896 100644 --- a/drivers/staging/speakup/main.c +++ b/drivers/staging/speakup/main.c @@ -901,7 +901,8 @@ static int get_sentence_buf(struct vc_data *vc, int read_punc) while (start < end) { sentbuf[bn][i] = get_char(vc, (u_short *)start, &tmp); if (i > 0) { - if (sentbuf[bn][i] == SPACE && sentbuf[bn][i - 1] == '.' && + if (sentbuf[bn][i] == SPACE && + sentbuf[bn][i - 1] == '.' && numsentences[bn] < 9) { /* Sentence Marker */ numsentences[bn]++; @@ -1235,7 +1236,8 @@ int spk_set_key_info(const u_char *key_info, u_char *k_buffer) key_data_len = (states + 1) * (num_keys + 1); if (key_data_len + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf)) { pr_debug("too many key_infos (%d over %u)\n", - key_data_len + SHIFT_TBL_SIZE + 4, (unsigned int)(sizeof(spk_key_buf))); + key_data_len + SHIFT_TBL_SIZE + 4, + (unsigned int)(sizeof(spk_key_buf))); return -EINVAL; } memset(k_buffer, 0, SHIFT_TBL_SIZE); @@ -1249,8 +1251,8 @@ int spk_set_key_info(const u_char *key_info, u_char *k_buffer) for (i = 1; i <= states; i++) { ch = *cp1++; if (ch >= SHIFT_TBL_SIZE) { - pr_debug("(%d) not valid shift state (max_allowed = %d)\n", ch, - SHIFT_TBL_SIZE); + pr_debug("(%d) not valid shift state (max_allowed = %d)\n", + ch, SHIFT_TBL_SIZE); return -EINVAL; } spk_shift_table[ch] = i; @@ -1258,7 +1260,8 @@ int spk_set_key_info(const u_char *key_info, u_char *k_buffer) keymap_flags = *cp1++; while ((ch = *cp1)) { if (ch >= MAX_KEY) { - pr_debug("(%d), not valid key, (max_allowed = %d)\n", ch, MAX_KEY); + pr_debug("(%d), not valid key, (max_allowed = %d)\n", + ch, MAX_KEY); return -EINVAL; } spk_our_keys[ch] = cp1; diff --git a/drivers/staging/speakup/speakup_decext.c b/drivers/staging/speakup/speakup_decext.c index 3741c0fcf5bb..ddbb7e97d118 100644 --- a/drivers/staging/speakup/speakup_decext.c +++ b/drivers/staging/speakup/speakup_decext.c @@ -192,7 +192,8 @@ static void do_catch_up(struct spk_synth *synth) synth->io_ops->synth_out(synth, PROCSPEECH); if (time_after_eq(jiffies, jiff_max)) { if (!in_escape) - synth->io_ops->synth_out(synth, PROCSPEECH); + synth->io_ops->synth_out(synth, + PROCSPEECH); spin_lock_irqsave(&speakup_info.spinlock, flags); jiffy_delta_val = jiffy_delta->u.n.value; diff --git a/drivers/staging/speakup/speakup_dectlk.c b/drivers/staging/speakup/speakup_dectlk.c index a144f28ee1a8..dccb4ea29d37 100644 --- a/drivers/staging/speakup/speakup_dectlk.c +++ b/drivers/staging/speakup/speakup_dectlk.c @@ -260,7 +260,8 @@ static void do_catch_up(struct spk_synth *synth) synth->io_ops->synth_out(synth, PROCSPEECH); if (time_after_eq(jiffies, jiff_max)) { if (!in_escape) - synth->io_ops->synth_out(synth, PROCSPEECH); + synth->io_ops->synth_out(synth, + PROCSPEECH); spin_lock_irqsave(&speakup_info.spinlock, flags); jiffy_delta_val = jiffy_delta->u.n.value; diff --git a/drivers/staging/speakup/speakup_soft.c b/drivers/staging/speakup/speakup_soft.c index 947c79532e10..edff6ce85655 100644 --- a/drivers/staging/speakup/speakup_soft.c +++ b/drivers/staging/speakup/speakup_soft.c @@ -12,7 +12,9 @@ #include <linux/unistd.h> #include <linux/miscdevice.h> /* for misc_register, and SYNTH_MINOR */ #include <linux/poll.h> /* for poll_wait() */ -#include <linux/sched/signal.h> /* schedule(), signal_pending(), TASK_INTERRUPTIBLE */ + +/* schedule(), signal_pending(), TASK_INTERRUPTIBLE */ +#include <linux/sched/signal.h> #include "spk_priv.h" #include "speakup.h" diff --git a/drivers/staging/speakup/spk_priv_keyinfo.h b/drivers/staging/speakup/spk_priv_keyinfo.h index cc99fcd1bc6e..1f789bd1c678 100644 --- a/drivers/staging/speakup/spk_priv_keyinfo.h +++ b/drivers/staging/speakup/spk_priv_keyinfo.h @@ -61,11 +61,16 @@ #define SPEAKUP_HELP 0x2d #define TOGGLE_CURSORING 0x2e #define READ_ALL_DOC 0x2f -#define SPKUP_MAX_FUNC 0x30 /* one greater than the last func handler */ + +/* one greater than the last func handler */ +#define SPKUP_MAX_FUNC 0x30 + #define SPK_KEY 0x80 #define FIRST_EDIT_BITS 0x22 #define FIRST_SET_VAR SPELL_DELAY -#define VAR_START 0x40 /* increase if adding more than 0x3f functions */ + +/* increase if adding more than 0x3f functions */ +#define VAR_START 0x40 /* keys for setting variables, must be ordered same as the enum for var_ids */ /* with dec being even and inc being 1 greater */ diff --git a/drivers/staging/speakup/spk_ttyio.c b/drivers/staging/speakup/spk_ttyio.c index 005de0024dd4..0057eb980bec 100644 --- a/drivers/staging/speakup/spk_ttyio.c +++ b/drivers/staging/speakup/spk_ttyio.c @@ -128,7 +128,8 @@ struct spk_io_ops spk_ttyio_ops = { }; EXPORT_SYMBOL_GPL(spk_ttyio_ops); -static inline void get_termios(struct tty_struct *tty, struct ktermios *out_termios) +static inline void get_termios(struct tty_struct *tty, + struct ktermios *out_termios) { down_read(&tty->termios_rwsem); *out_termios = tty->termios; @@ -167,8 +168,9 @@ static int spk_ttyio_initialise_ldisc(struct spk_synth *synth) tmp_termios.c_cflag |= CRTSCTS; tty_set_termios(tty, &tmp_termios); /* - * check c_cflag to see if it's updated as tty_set_termios may not return - * error even when no tty bits are changed by the request. + * check c_cflag to see if it's updated as tty_set_termios + * may not return error even when no tty bits are + * changed by the request. */ get_termios(tty, &tmp_termios); if (!(tmp_termios.c_cflag & CRTSCTS)) @@ -207,10 +209,11 @@ static int spk_ttyio_out(struct spk_synth *in_synth, const char ch) /* No room */ return 0; if (ret < 0) { - pr_warn("%s: I/O error, deactivating speakup\n", in_synth->long_name); - /* No synth any more, so nobody will restart TTYs, and we thus - * need to do it ourselves. Now that there is no synth we can - * let application flood anyway + pr_warn("%s: I/O error, deactivating speakup\n", + in_synth->long_name); + /* No synth any more, so nobody will restart TTYs, + * and we thus need to do it ourselves. Now that there + * is no synth we can let application flood anyway */ in_synth->alive = 0; speakup_start_ttys(); @@ -371,7 +374,8 @@ const char *spk_ttyio_synth_immediate(struct spk_synth *synth, const char *buff) while ((ch = *buff)) { if (ch == '\n') ch = synth->procspeech; - if (tty_write_room(speakup_tty) < 1 || !synth->io_ops->synth_out(synth, ch)) + if (tty_write_room(speakup_tty) < 1 || + !synth->io_ops->synth_out(synth, ch)) return buff; buff++; } diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c index 3c944cb8f547..5741d1cb6227 100644 --- a/drivers/staging/speakup/varhandlers.c +++ b/drivers/staging/speakup/varhandlers.c @@ -238,7 +238,8 @@ int spk_set_num_var(int input, struct st_var_header *var, int how) if (!var_data->u.n.out_str) sprintf(cp, var_data->u.n.synth_fmt, (int)val); else - sprintf(cp, var_data->u.n.synth_fmt, var_data->u.n.out_str[val]); + sprintf(cp, var_data->u.n.synth_fmt, + var_data->u.n.out_str[val]); synth_printf("%s", cp); return 0; } |