diff options
Diffstat (limited to 'kernel/drivers/staging/speakup')
21 files changed, 199 insertions, 166 deletions
diff --git a/kernel/drivers/staging/speakup/buffers.c b/kernel/drivers/staging/speakup/buffers.c index d45c8afb0..8565c2343 100644 --- a/kernel/drivers/staging/speakup/buffers.c +++ b/kernel/drivers/staging/speakup/buffers.c @@ -63,7 +63,8 @@ void synth_buffer_add(char ch) { if (!synth->alive) { /* This makes sure that we won't stop TTYs if there is no synth - * to restart them */ + * to restart them + */ return; } if (synth_buffer_free() <= 100) { @@ -100,6 +101,7 @@ EXPORT_SYMBOL_GPL(synth_buffer_peek); void synth_buffer_clear(void) { - buff_in = buff_out = synth_buffer; + buff_in = synth_buffer; + buff_out = synth_buffer; } EXPORT_SYMBOL_GPL(synth_buffer_clear); diff --git a/kernel/drivers/staging/speakup/devsynth.c b/kernel/drivers/staging/speakup/devsynth.c index 71c728acf..d1ffdf4c0 100644 --- a/kernel/drivers/staging/speakup/devsynth.c +++ b/kernel/drivers/staging/speakup/devsynth.c @@ -22,7 +22,7 @@ static ssize_t speakup_file_write(struct file *fp, const char __user *buffer, unsigned long flags; u_char buf[256]; - if (synth == NULL) + if (!synth) return -ENODEV; while (count > 0) { bytes = min(count, sizeof(buf)); @@ -45,7 +45,7 @@ static ssize_t speakup_file_read(struct file *fp, char __user *buf, static int speakup_file_open(struct inode *ip, struct file *fp) { - if (synth == NULL) + if (!synth) return -ENODEV; if (xchg(&dev_opened, 1)) return -EBUSY; diff --git a/kernel/drivers/staging/speakup/fakekey.c b/kernel/drivers/staging/speakup/fakekey.c index 4299cf45f..5e1f16c36 100644 --- a/kernel/drivers/staging/speakup/fakekey.c +++ b/kernel/drivers/staging/speakup/fakekey.c @@ -81,6 +81,7 @@ void speakup_fake_down_arrow(void) __this_cpu_write(reporting_keystroke, true); input_report_key(virt_keyboard, KEY_DOWN, PRESSED); input_report_key(virt_keyboard, KEY_DOWN, RELEASED); + input_sync(virt_keyboard); __this_cpu_write(reporting_keystroke, false); /* reenable preemption */ diff --git a/kernel/drivers/staging/speakup/i18n.c b/kernel/drivers/staging/speakup/i18n.c index 9ea16c5b4..12f880ed4 100644 --- a/kernel/drivers/staging/speakup/i18n.c +++ b/kernel/drivers/staging/speakup/i18n.c @@ -1,5 +1,6 @@ /* Internationalization implementation. Includes definitions of English - * string arrays, and the i18n pointer. */ + * string arrays, and the i18n pointer. + */ #include <linux/slab.h> /* For kmalloc. */ #include <linux/ctype.h> @@ -388,7 +389,7 @@ static struct msg_group_t all_groups[] = { }, }; -static const int num_groups = sizeof(all_groups) / sizeof(struct msg_group_t); +static const int num_groups = ARRAY_SIZE(all_groups); char *spk_msg_get(enum msg_index_t index) { diff --git a/kernel/drivers/staging/speakup/i18n.h b/kernel/drivers/staging/speakup/i18n.h index 326d086f9..8fcce5666 100644 --- a/kernel/drivers/staging/speakup/i18n.h +++ b/kernel/drivers/staging/speakup/i18n.h @@ -224,11 +224,11 @@ struct msg_group_t { enum msg_index_t end; }; -extern char *spk_msg_get(enum msg_index_t index); -extern ssize_t spk_msg_set(enum msg_index_t index, char *text, size_t length); -extern struct msg_group_t *spk_find_msg_group(const char *group_name); -extern void spk_reset_msg_group(struct msg_group_t *group); -extern void spk_initialize_msgs(void); -extern void spk_free_user_msgs(void); +char *spk_msg_get(enum msg_index_t index); +ssize_t spk_msg_set(enum msg_index_t index, char *text, size_t length); +struct msg_group_t *spk_find_msg_group(const char *group_name); +void spk_reset_msg_group(struct msg_group_t *group); +void spk_initialize_msgs(void); +void spk_free_user_msgs(void); #endif diff --git a/kernel/drivers/staging/speakup/keyhelp.c b/kernel/drivers/staging/speakup/keyhelp.c index 947567421..02d5c706a 100644 --- a/kernel/drivers/staging/speakup/keyhelp.c +++ b/kernel/drivers/staging/speakup/keyhelp.c @@ -165,7 +165,7 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key) synth_printf("\n"); return 1; } - cur_item = letter_offsets[ch-'a']; + cur_item = letter_offsets[ch-'a']; } else if (type == KT_CUR) { if (ch == 0 && (MSG_FUNCNAMES_START + cur_item + 1) <= diff --git a/kernel/drivers/staging/speakup/kobjects.c b/kernel/drivers/staging/speakup/kobjects.c index 0211df600..fdfeb42b2 100644 --- a/kernel/drivers/staging/speakup/kobjects.c +++ b/kernel/drivers/staging/speakup/kobjects.c @@ -240,7 +240,8 @@ static ssize_t keymap_show(struct kobject *kobj, struct kobj_attribute *attr, cp += sprintf(cp, "%d, %d, %d,\n", KEY_MAP_VER, num_keys, nstates); cp1 += 2; /* now pointing at shift states */ /* dump num_keys+1 as first row is shift states + flags, - * each subsequent row is key + states */ + * each subsequent row is key + states + */ for (n = 0; n <= num_keys; n++) { for (i = 0; i <= nstates; i++) { ch = *cp1++; @@ -367,7 +368,7 @@ static ssize_t synth_show(struct kobject *kobj, struct kobj_attribute *attr, { int rv; - if (synth == NULL) + if (!synth) rv = sprintf(buf, "%s\n", "none"); else rv = sprintf(buf, "%s\n", synth->name); @@ -458,14 +459,14 @@ static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; p_header = spk_var_header_by_name(attr->attr.name); - if (p_header == NULL) { + if (!p_header) { pr_warn("p_header is null, attr->attr.name is %s\n", attr->attr.name); return -EINVAL; } var = spk_get_punc_var(p_header->var_id); - if (var == NULL) { + if (!var) { pr_warn("var is null, p_header->var_id is %i\n", p_header->var_id); return -EINVAL; @@ -500,14 +501,14 @@ static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr, return -EINVAL; p_header = spk_var_header_by_name(attr->attr.name); - if (p_header == NULL) { + if (!p_header) { pr_warn("p_header is null, attr->attr.name is %s\n", attr->attr.name); return -EINVAL; } var = spk_get_punc_var(p_header->var_id); - if (var == NULL) { + if (!var) { pr_warn("var is null, p_header->var_id is %i\n", p_header->var_id); return -EINVAL; @@ -545,7 +546,7 @@ ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; param = spk_var_header_by_name(attr->attr.name); - if (param == NULL) + if (!param) return -EINVAL; spin_lock_irqsave(&speakup_info.spinlock, flags); @@ -621,9 +622,9 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr, unsigned long flags; param = spk_var_header_by_name(attr->attr.name); - if (param == NULL) + if (!param) return -EINVAL; - if (param->data == NULL) + if (!param->data) return 0; ret = 0; cp = (char *)buf; diff --git a/kernel/drivers/staging/speakup/main.c b/kernel/drivers/staging/speakup/main.c index c95597641..63c59bc89 100644 --- a/kernel/drivers/staging/speakup/main.c +++ b/kernel/drivers/staging/speakup/main.c @@ -128,7 +128,8 @@ static char *phonetic[] = { /* array of 256 char pointers (one for each character description) * initialized to default_chars and user selectable via - * /proc/speakup/characters */ + * /proc/speakup/characters + */ char *spk_characters[256]; char *spk_default_chars[256] = { @@ -194,7 +195,8 @@ char *spk_default_chars[256] = { /* array of 256 u_short (one for each character) * initialized to default_chartab and user selectable via - * /sys/module/speakup/parameters/chartab */ + * /sys/module/speakup/parameters/chartab + */ u_short spk_chartab[256]; static u_short default_chartab[256] = { @@ -540,7 +542,8 @@ static void say_next_char(struct vc_data *vc) * see if there is a word starting on the next position to the right * and return that word if it exists. If it does not exist it will * move left to the beginning of any previous word on the line or the - * beginning off the line whichever comes first.. */ + * beginning off the line whichever comes first.. + */ static u_long get_word(struct vc_data *vc) { @@ -1113,7 +1116,8 @@ static void spkup_write(const char *in_buf, int count) * suppress multiple to get rid of long pauses and * clear repeat count * so if someone has - * repeats on you don't get nothing repeated count */ + * repeats on you don't get nothing repeated count + */ if (ch != old_ch) synth_printf("%c", ch); else @@ -1509,7 +1513,8 @@ static void do_handle_cursor(struct vc_data *vc, u_char value, char up_flag) if (spk_no_intr) spk_do_flush(); /* the key press flushes if !no_inter but we want to flush on cursor - * moves regardless of no_inter state */ + * moves regardless of no_inter state + */ is_cursor = value + 1; old_cursor_pos = vc->vc_pos; old_cursor_x = vc->vc_x; @@ -1597,7 +1602,7 @@ static int count_highlight_color(struct vc_data *vc) static int get_highlight_color(struct vc_data *vc) { int i, j; - unsigned int cptr[8], tmp; + unsigned int cptr[8]; int vc_num = vc->vc_num; for (i = 0; i < 8; i++) @@ -1606,11 +1611,8 @@ static int get_highlight_color(struct vc_data *vc) for (i = 0; i < 7; i++) for (j = i + 1; j < 8; j++) if (speakup_console[vc_num]->ht.bgcount[cptr[i]] > - speakup_console[vc_num]->ht.bgcount[cptr[j]]) { - tmp = cptr[i]; - cptr[i] = cptr[j]; - cptr[j] = tmp; - } + speakup_console[vc_num]->ht.bgcount[cptr[j]]) + swap(cptr[i], cptr[j]); for (i = 0; i < 8; i++) if (speakup_console[vc_num]->ht.bgcount[cptr[i]] != 0) diff --git a/kernel/drivers/staging/speakup/selection.c b/kernel/drivers/staging/speakup/selection.c index a0315701c..41ef099b7 100644 --- a/kernel/drivers/staging/speakup/selection.c +++ b/kernel/drivers/staging/speakup/selection.c @@ -7,7 +7,7 @@ #include <linux/workqueue.h> #include <linux/tty.h> #include <linux/tty_flip.h> -#include <asm/cmpxchg.h> +#include <linux/atomic.h> #include "speakup.h" @@ -114,7 +114,8 @@ int speakup_set_selection(struct tty_struct *tty) obp = bp; if (!((i + 2) % vc->vc_size_row)) { /* strip trailing blanks from line and add newline, - unless non-space at end of line. */ + * unless non-space at end of line. + */ if (obp != bp) { bp = obp; *bp++ = '\r'; @@ -141,7 +142,9 @@ static void __speakup_paste_selection(struct work_struct *work) struct tty_ldisc *ld; DECLARE_WAITQUEUE(wait, current); - ld = tty_ldisc_ref_wait(tty); + ld = tty_ldisc_ref(tty); + if (!ld) + goto tty_unref; tty_buffer_lock_exclusive(&vc->port); add_wait_queue(&vc->paste_wait, &wait); @@ -161,6 +164,7 @@ static void __speakup_paste_selection(struct work_struct *work) tty_buffer_unlock_exclusive(&vc->port); tty_ldisc_deref(ld); +tty_unref: tty_kref_put(tty); } diff --git a/kernel/drivers/staging/speakup/serialio.c b/kernel/drivers/staging/speakup/serialio.c index 1d9d51bdf..a5bbb338f 100644 --- a/kernel/drivers/staging/speakup/serialio.c +++ b/kernel/drivers/staging/speakup/serialio.c @@ -6,6 +6,11 @@ #include "spk_priv.h" #include "serialio.h" +#include <linux/serial_core.h> +/* WARNING: Do not change this to <linux/serial.h> without testing that + * SERIAL_PORT_DFNS does get defined to the appropriate value. */ +#include <asm/serial.h> + #ifndef SERIAL_PORT_DFNS #define SERIAL_PORT_DFNS #endif @@ -23,9 +28,15 @@ const struct old_serial_port *spk_serial_init(int index) int baud = 9600, quot = 0; unsigned int cval = 0; int cflag = CREAD | HUPCL | CLOCAL | B9600 | CS8; - const struct old_serial_port *ser = rs_table + index; + const struct old_serial_port *ser; int err; + if (index >= ARRAY_SIZE(rs_table)) { + pr_info("no port info for ttyS%d\n", index); + return NULL; + } + ser = rs_table + index; + /* Divisor, bytesize and parity */ quot = ser->baud_base / baud; cval = cflag & (CSIZE | CSTOPB); @@ -51,7 +62,8 @@ const struct old_serial_port *spk_serial_init(int index) } /* Disable UART interrupts, set DTR and RTS high - * and set speed. */ + * and set speed. + */ outb(cval | UART_LCR_DLAB, ser->port + UART_LCR); /* set DLAB */ outb(quot & 0xff, ser->port + UART_DLL); /* LS of divisor */ outb(quot >> 8, ser->port + UART_DLM); /* MS of divisor */ @@ -100,7 +112,7 @@ static void start_serial_interrupt(int irq) { int rv; - if (synth->read_buff_add == NULL) + if (!synth->read_buff_add) return; rv = request_irq(irq, synth_readbuf_handler, IRQF_SHARED, @@ -126,7 +138,7 @@ void spk_stop_serial_interrupt(void) if (speakup_info.port_tts == 0) return; - if (synth->read_buff_add == NULL) + if (!synth->read_buff_add) return; /* Turn off interrupts */ @@ -145,7 +157,8 @@ int spk_wait_for_xmitr(void) synth->alive = 0; /* 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 */ + * let application flood anyway + */ speakup_start_ttys(); timeouts = 0; return 0; @@ -163,7 +176,8 @@ int spk_wait_for_xmitr(void) /* CTS */ if (--tmout == 0) { /* pr_warn("%s: timed out (cts)\n", - * synth->long_name); */ + * synth->long_name); + */ timeouts++; return 0; } @@ -217,4 +231,3 @@ void spk_serial_release(void) speakup_info.port_tts = 0; } EXPORT_SYMBOL_GPL(spk_serial_release); - diff --git a/kernel/drivers/staging/speakup/speakup.h b/kernel/drivers/staging/speakup/speakup.h index a7f496242..df74c912d 100644 --- a/kernel/drivers/staging/speakup/speakup.h +++ b/kernel/drivers/staging/speakup/speakup.h @@ -42,46 +42,44 @@ #define IS_CHAR(x, type) (spk_chartab[((u_char)x)]&type) #define IS_TYPE(x, type) ((spk_chartab[((u_char)x)]&type) == type) -extern int speakup_thread(void *data); -extern void spk_reset_default_chars(void); -extern void spk_reset_default_chartab(void); -extern void synth_start(void); +int speakup_thread(void *data); +void spk_reset_default_chars(void); +void spk_reset_default_chartab(void); +void synth_start(void); void synth_insert_next_index(int sent_num); void spk_reset_index_count(int sc); void spk_get_index_count(int *linecount, int *sentcount); -extern int spk_set_key_info(const u_char *key_info, u_char *k_buffer); -extern char *spk_strlwr(char *s); -extern char *spk_s2uchar(char *start, char *dest); -extern int speakup_kobj_init(void); -extern void speakup_kobj_exit(void); -extern int spk_chartab_get_value(char *keyword); -extern void speakup_register_var(struct var_t *var); -extern void speakup_unregister_var(enum var_id_t var_id); -extern struct st_var_header *spk_get_var_header(enum var_id_t var_id); -extern struct st_var_header *spk_var_header_by_name(const char *name); -extern struct punc_var_t *spk_get_punc_var(enum var_id_t var_id); -extern int spk_set_num_var(int val, struct st_var_header *var, int how); -extern int spk_set_string_var(const char *page, struct st_var_header *var, - int len); -extern int spk_set_mask_bits(const char *input, const int which, const int how); +int spk_set_key_info(const u_char *key_info, u_char *k_buffer); +char *spk_strlwr(char *s); +char *spk_s2uchar(char *start, char *dest); +int speakup_kobj_init(void); +void speakup_kobj_exit(void); +int spk_chartab_get_value(char *keyword); +void speakup_register_var(struct var_t *var); +void speakup_unregister_var(enum var_id_t var_id); +struct st_var_header *spk_get_var_header(enum var_id_t var_id); +struct st_var_header *spk_var_header_by_name(const char *name); +struct punc_var_t *spk_get_punc_var(enum var_id_t var_id); +int spk_set_num_var(int val, struct st_var_header *var, int how); +int spk_set_string_var(const char *page, struct st_var_header *var, int len); +int spk_set_mask_bits(const char *input, const int which, const int how); extern special_func spk_special_handler; -extern int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, - u_short key); -extern int synth_init(char *name); -extern void synth_release(void); +int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key); +int synth_init(char *name); +void synth_release(void); -extern void spk_do_flush(void); -extern void speakup_start_ttys(void); -extern void synth_buffer_add(char ch); -extern void synth_buffer_clear(void); -extern void speakup_clear_selection(void); -extern int speakup_set_selection(struct tty_struct *tty); -extern int speakup_paste_selection(struct tty_struct *tty); -extern void speakup_cancel_paste(void); -extern void speakup_register_devsynth(void); -extern void speakup_unregister_devsynth(void); -extern void synth_write(const char *buf, size_t count); -extern int synth_supports_indexing(void); +void spk_do_flush(void); +void speakup_start_ttys(void); +void synth_buffer_add(char ch); +void synth_buffer_clear(void); +void speakup_clear_selection(void); +int speakup_set_selection(struct tty_struct *tty); +int speakup_paste_selection(struct tty_struct *tty); +void speakup_cancel_paste(void); +void speakup_register_devsynth(void); +void speakup_unregister_devsynth(void); +void synth_write(const char *buf, size_t count); +int synth_supports_indexing(void); extern struct vc_data *spk_sel_cons; extern unsigned short spk_xs, spk_ys, spk_xe, spk_ye; /* our region points */ diff --git a/kernel/drivers/staging/speakup/speakup_acnt.h b/kernel/drivers/staging/speakup/speakup_acnt.h index 6376fca9e..107ec1155 100644 --- a/kernel/drivers/staging/speakup/speakup_acnt.h +++ b/kernel/drivers/staging/speakup/speakup_acnt.h @@ -6,10 +6,12 @@ /* Port Status Flags */ #define SYNTH_READABLE 0x01 /* mask for bit which is nonzero if a - byte can be read from the data port */ + * byte can be read from the data port + */ #define SYNTH_WRITABLE 0x02 /* mask for RDY bit, which when set to - 1, indicates the data port is ready - to accept a byte of data. */ + * 1, indicates the data port is ready + * to accept a byte of data. + */ #define SYNTH_QUIET 'S' /* synth is not speaking */ #define SYNTH_FULL 'F' /* synth is full. */ #define SYNTH_ALMOST_EMPTY 'M' /* synth has less than 2 seconds of text left */ diff --git a/kernel/drivers/staging/speakup/speakup_audptr.c b/kernel/drivers/staging/speakup/speakup_audptr.c index ea89e36ec..a9a687232 100644 --- a/kernel/drivers/staging/speakup/speakup_audptr.c +++ b/kernel/drivers/staging/speakup/speakup_audptr.c @@ -162,7 +162,7 @@ static void synth_version(struct spk_synth *synth) static int synth_probe(struct spk_synth *synth) { - int failed = 0; + int failed; failed = spk_serial_synth_probe(synth); if (failed == 0) diff --git a/kernel/drivers/staging/speakup/speakup_decpc.c b/kernel/drivers/staging/speakup/speakup_decpc.c index 437e13a85..4893fef3f 100644 --- a/kernel/drivers/staging/speakup/speakup_decpc.c +++ b/kernel/drivers/staging/speakup/speakup_decpc.c @@ -88,8 +88,9 @@ #define CTRL_last_index 0x0b00 /* get last index spoken */ #define CTRL_io_priority 0x0c00 /* change i/o priority */ #define CTRL_free_mem 0x0d00 /* get free paragraphs on module */ -#define CTRL_get_lang 0x0e00 /* return bit mask of loaded - * languages */ +#define CTRL_get_lang 0x0e00 /* return bit mask of loaded + * languages + */ #define CMD_test 0x2000 /* self-test request */ #define TEST_mask 0x0F00 /* isolate test field */ #define TEST_null 0x0000 /* no test requested */ @@ -500,4 +501,3 @@ MODULE_AUTHOR("David Borowski"); MODULE_DESCRIPTION("Speakup support for DECtalk PC synthesizers"); MODULE_LICENSE("GPL"); MODULE_VERSION(DRV_VERSION); - diff --git a/kernel/drivers/staging/speakup/speakup_dectlk.c b/kernel/drivers/staging/speakup/speakup_dectlk.c index b5a23d42f..09063b823 100644 --- a/kernel/drivers/staging/speakup/speakup_dectlk.c +++ b/kernel/drivers/staging/speakup/speakup_dectlk.c @@ -291,10 +291,9 @@ static void do_catch_up(struct spk_synth *synth) static void synth_flush(struct spk_synth *synth) { - if (in_escape) { + if (in_escape) /* if in command output ']' so we don't get an error */ spk_serial_out(']'); - } in_escape = 0; is_flushing = 1; spk_serial_out(SYNTH_CLEAR); diff --git a/kernel/drivers/staging/speakup/speakup_dtlk.h b/kernel/drivers/staging/speakup/speakup_dtlk.h index d951d18c5..46d885fcf 100644 --- a/kernel/drivers/staging/speakup/speakup_dtlk.h +++ b/kernel/drivers/staging/speakup/speakup_dtlk.h @@ -4,31 +4,37 @@ #define SYNTH_CLEAR 0x18 /* stops speech */ /* TTS Port Status Flags */ #define TTS_READABLE 0x80 /* mask for bit which is nonzero if a - byte can be read from the TTS port */ + * byte can be read from the TTS port + */ #define TTS_SPEAKING 0x40 /* mask for SYNC bit, which is nonzero - while DoubleTalk is producing - output with TTS, PCM or CVSD - synthesizers or tone generators - (that is, all but LPC) */ + * while DoubleTalk is producing + * output with TTS, PCM or CVSD + * synthesizers or tone generators + * (that is, all but LPC) + */ #define TTS_SPEAKING2 0x20 /* mask for SYNC2 bit, - which falls to zero up to 0.4 sec - before speech stops */ + * which falls to zero up to 0.4 sec + * before speech stops + */ #define TTS_WRITABLE 0x10 /* mask for RDY bit, which when set to - 1, indicates the TTS port is ready - to accept a byte of data. The RDY - bit goes zero 2-3 usec after - writing, and goes 1 again 180-190 - usec later. */ + * 1, indicates the TTS port is ready + * to accept a byte of data. The RDY + * bit goes zero 2-3 usec after + * writing, and goes 1 again 180-190 + * usec later. + */ #define TTS_ALMOST_FULL 0x08 /* mask for AF bit: When set to 1, - indicates that less than 300 bytes - are available in the TTS input - buffer. AF is always 0 in the PCM, - TGN and CVSD modes. */ + * indicates that less than 300 bytes + * are available in the TTS input + * buffer. AF is always 0 in the PCM, + * TGN and CVSD modes. + */ #define TTS_ALMOST_EMPTY 0x04 /* mask for AE bit: When set to 1, - indicates that less than 300 bytes - are remaining in DoubleTalk's input - (TTS or PCM) buffer. AE is always 1 - in the TGN and CVSD modes. */ + * indicates that less than 300 bytes + * are remaining in DoubleTalk's input + * (TTS or PCM) buffer. AE is always 1 + * in the TGN and CVSD modes. + */ /* data returned by Interrogate command */ struct synth_settings { @@ -45,10 +51,12 @@ struct synth_settings { u_char ext_dict_loaded; /* 1=exception dictionary loaded */ u_char ext_dict_status; /* 1=exception dictionary enabled */ u_char free_ram; /* # pages (truncated) remaining for - * text buffer */ + * text buffer + */ u_char articulation; /* nA; 0-9 */ u_char reverb; /* nR; 0-9 */ u_char eob; /* 7Fh value indicating end of - * parameter block */ + * parameter block + */ u_char has_indexing; /* nonzero if indexing is implemented */ }; diff --git a/kernel/drivers/staging/speakup/speakup_soft.c b/kernel/drivers/staging/speakup/speakup_soft.c index fb31bb95d..b2eb5b133 100644 --- a/kernel/drivers/staging/speakup/speakup_soft.c +++ b/kernel/drivers/staging/speakup/speakup_soft.c @@ -19,7 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * this code is specificly written as a driver for the speakup screenreview - * package and is not a general device driver. */ + * package and is not a general device driver. + */ #include <linux/unistd.h> #include <linux/miscdevice.h> /* for misc_register, and SYNTH_MINOR */ @@ -356,4 +357,3 @@ MODULE_AUTHOR("Kirk Reiser <kirk@braille.uwo.ca>"); MODULE_DESCRIPTION("Speakup userspace software synthesizer support"); MODULE_LICENSE("GPL"); MODULE_VERSION(DRV_VERSION); - diff --git a/kernel/drivers/staging/speakup/spk_priv.h b/kernel/drivers/staging/speakup/spk_priv.h index 1ef3795b8..9bb281d36 100644 --- a/kernel/drivers/staging/speakup/spk_priv.h +++ b/kernel/drivers/staging/speakup/spk_priv.h @@ -1,26 +1,26 @@ /* spk_priv.h - review functions for the speakup screen review package. - originally written by: Kirk Reiser and Andy Berdan. + * review functions for the speakup screen review package. + * originally written by: Kirk Reiser and Andy Berdan. + * + * extensively modified by David Borowski. + * + * Copyright (C) 1998 Kirk Reiser. + * Copyright (C) 2003 David Borowski. - extensively modified by David Borowski. - - Copyright (C) 1998 Kirk Reiser. - Copyright (C) 2003 David Borowski. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #ifndef _SPEAKUP_PRIVATE_H #define _SPEAKUP_PRIVATE_H diff --git a/kernel/drivers/staging/speakup/spk_priv_keyinfo.h b/kernel/drivers/staging/speakup/spk_priv_keyinfo.h index 95c473a7e..3116ef78c 100644 --- a/kernel/drivers/staging/speakup/spk_priv_keyinfo.h +++ b/kernel/drivers/staging/speakup/spk_priv_keyinfo.h @@ -1,26 +1,26 @@ /* spk_priv.h - review functions for the speakup screen review package. - originally written by: Kirk Reiser and Andy Berdan. - - extensively modified by David Borowski. - - Copyright (C) 1998 Kirk Reiser. - Copyright (C) 2003 David Borowski. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ + * review functions for the speakup screen review package. + * originally written by: Kirk Reiser and Andy Berdan. + * + * extensively modified by David Borowski. + * + * Copyright (C) 1998 Kirk Reiser. + * Copyright (C) 2003 David Borowski. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ #ifndef _SPEAKUP_KEYINFO_H #define _SPEAKUP_KEYINFO_H diff --git a/kernel/drivers/staging/speakup/thread.c b/kernel/drivers/staging/speakup/thread.c index d95efb702..90c383ee7 100644 --- a/kernel/drivers/staging/speakup/thread.c +++ b/kernel/drivers/staging/speakup/thread.c @@ -48,7 +48,8 @@ int speakup_thread(void *data) kd_mksound(our_sound.freq, our_sound.jiffies); if (synth && synth->catch_up && synth->alive) { /* It is up to the callee to take the lock, so that it - * can sleep whenever it likes */ + * can sleep whenever it likes + */ synth->catch_up(synth); } diff --git a/kernel/drivers/staging/speakup/varhandlers.c b/kernel/drivers/staging/speakup/varhandlers.c index 1b0d1c087..ab4fe8de4 100644 --- a/kernel/drivers/staging/speakup/varhandlers.c +++ b/kernel/drivers/staging/speakup/varhandlers.c @@ -90,7 +90,7 @@ void speakup_register_var(struct var_t *var) struct st_var_header *p_header; BUG_ON(!var || var->var_id < 0 || var->var_id >= MAXVARS); - if (var_ptrs[0] == NULL) { + if (!var_ptrs[0]) { for (i = 0; i < MAXVARS; i++) { p_header = &var_headers[i]; var_ptrs[p_header->var_id] = p_header; @@ -130,7 +130,7 @@ struct st_var_header *spk_get_var_header(enum var_id_t var_id) if (var_id < 0 || var_id >= MAXVARS) return NULL; p_header = var_ptrs[var_id]; - if (p_header->data == NULL) + if (!p_header->data) return NULL; return p_header; } @@ -163,7 +163,7 @@ struct punc_var_t *spk_get_punc_var(enum var_id_t var_id) struct punc_var_t *where; where = punc_vars; - while ((where->var_id != -1) && (rv == NULL)) { + while ((where->var_id != -1) && (!rv)) { if (where->var_id == var_id) rv = where; else @@ -183,7 +183,7 @@ int spk_set_num_var(int input, struct st_var_header *var, int how) char *cp; struct var_t *var_data = var->data; - if (var_data == NULL) + if (!var_data) return -ENODATA; if (how == E_NEW_DEFAULT) { @@ -221,9 +221,9 @@ int spk_set_num_var(int input, struct st_var_header *var, int how) if (var_data->u.n.multiplier != 0) val *= var_data->u.n.multiplier; val += var_data->u.n.offset; - if (var->var_id < FIRST_SYNTH_VAR || synth == NULL) + if (var->var_id < FIRST_SYNTH_VAR || !synth) return ret; - if (synth->synth_adjust != NULL) { + if (synth->synth_adjust) { int status = synth->synth_adjust(var); return (status != 0) ? status : ret; @@ -247,7 +247,7 @@ int spk_set_string_var(const char *page, struct st_var_header *var, int len) { struct var_t *var_data = var->data; - if (var_data == NULL) + if (!var_data) return -ENODATA; if (len > MAXVARLEN) return -E2BIG; @@ -269,7 +269,8 @@ int spk_set_string_var(const char *page, struct st_var_header *var, int len) /* spk_set_mask_bits sets or clears the punc/delim/repeat bits, * if input is null uses the defaults. * values for how: 0 clears bits of chars supplied, - * 1 clears allk, 2 sets bits for chars */ + * 1 clears allk, 2 sets bits for chars + */ int spk_set_mask_bits(const char *input, const int which, const int how) { u_char *cp; @@ -287,7 +288,7 @@ int spk_set_mask_bits(const char *input, const int which, const int how) if (*cp < SPACE) break; if (mask < PUNC) { - if (!(spk_chartab[*cp]&PUNC)) + if (!(spk_chartab[*cp] & PUNC)) break; } else if (spk_chartab[*cp]&B_NUM) break; @@ -312,7 +313,7 @@ char *spk_strlwr(char *s) { char *p; - if (s == NULL) + if (!s) return NULL; for (p = s; *p; p++) @@ -322,7 +323,7 @@ char *spk_strlwr(char *s) char *spk_s2uchar(char *start, char *dest) { - int val = 0; + int val; val = simple_strtoul(skip_spaces(start), &start, 10); if (*start == ',') |