From: Shraddha Barke <shraddha.6596@xxxxxxxxx> According to kernel coding style, add space around "+","-" and "&" Warning detected using checkpatch. Signed-off-by: Shraddha Barke <shraddha.6596@xxxxxxxxx> --- drivers/staging/speakup/keyhelp.c | 18 +++++----- drivers/staging/speakup/kobjects.c | 56 ++++++++++++++++---------------- drivers/staging/speakup/selection.c | 2 +- drivers/staging/speakup/serialio.c | 14 ++++---- drivers/staging/speakup/speakup_acntpc.c | 32 +++++++++--------- 5 files changed, 61 insertions(+), 61 deletions(-) diff --git a/drivers/staging/speakup/keyhelp.c b/drivers/staging/speakup/keyhelp.c index 237e0d0..ce94cb1 100644 --- a/drivers/staging/speakup/keyhelp.c +++ b/drivers/staging/speakup/keyhelp.c @@ -70,7 +70,7 @@ static void build_key_data(void) for (i = 0; i < nstates; i++, kp++) { if (!*kp) continue; - if ((state_tbl[i]&16) != 0 && *kp == SPK_KEY) + if ((state_tbl[i] & 16) != 0 && *kp == SPK_KEY) continue; counters[*kp]++; } @@ -79,7 +79,7 @@ static void build_key_data(void) if (counters[i] == 0) continue; key_offsets[i] = offset; - offset += (counters[i]+1); + offset += (counters[i] + 1); if (offset >= MAXKEYS) break; } @@ -93,7 +93,7 @@ static void build_key_data(void) ch1 = *kp++; if (!ch1) continue; - if ((state_tbl[i]&16) != 0 && ch1 == SPK_KEY) + if ((state_tbl[i] & 16) != 0 && ch1 == SPK_KEY) continue; key = (state_tbl[i] << 8) + ch; counters[ch1]--; @@ -126,14 +126,14 @@ static int help_init(void) int i; int num_funcs = MSG_FUNCNAMES_END - MSG_FUNCNAMES_START + 1; - state_tbl = spk_our_keys[0]+SHIFT_TBL_SIZE+2; + state_tbl = spk_our_keys[0] + SHIFT_TBL_SIZE + 2; for (i = 0; i < num_funcs; i++) { char *cur_funcname = spk_msg_get(MSG_FUNCNAMES_START + i); if (start == *cur_funcname) continue; start = *cur_funcname; - letter_offsets[(start&31)-1] = i; + letter_offsets[(start & 31) - 1] = i; } return 0; } @@ -156,12 +156,12 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key) ch |= 32; /* lower case */ if (ch < 'a' || ch > 'z') return -1; - if (letter_offsets[ch-'a'] == -1) { + if (letter_offsets[ch - 'a'] == -1) { synth_printf(spk_msg_get(MSG_NO_COMMAND), ch); 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) <= @@ -182,7 +182,7 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key) name = NULL; if ((type != KT_SPKUP) && (key > 0) && (key <= num_key_names)) { synth_printf("%s\n", - spk_msg_get(MSG_KEYNAMES_START + key-1)); + spk_msg_get(MSG_KEYNAMES_START + key - 1)); return 1; } for (i = 0; funcvals[i] != 0 && !name; i++) { @@ -191,7 +191,7 @@ int spk_handle_help(struct vc_data *vc, u_char type, u_char ch, u_short key) } if (!name) return -1; - kp = spk_our_keys[key]+1; + kp = spk_our_keys[key] + 1; for (i = 0; i < nstates; i++) { if (ch == kp[i]) break; diff --git a/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index 13b4eba..eacbfb1 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -251,7 +251,7 @@ static ssize_t keymap_show(struct kobject *kobj, struct kobj_attribute *attr, } cp += sprintf(cp, "0, %d\n", KEY_MAP_VER); spin_unlock_irqrestore(&speakup_info.spinlock, flags); - return (int)(cp-buf); + return (int)(cp - buf); } /* @@ -288,11 +288,11 @@ static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr, cp = spk_s2uchar(cp, cp1); cp1++; } - i = (int)cp1[-2]+1; - i *= (int)cp1[-1]+1; + i = (int)cp1[-2] + 1; + i *= (int)cp1[-1] + 1; i += 2; /* 0 and last map ver */ if (cp1[-3] != KEY_MAP_VER || cp1[-1] > 10 || - i+SHIFT_TBL_SIZE+4 >= sizeof(spk_key_buf)) { + i + SHIFT_TBL_SIZE + 4 >= sizeof(spk_key_buf)) { pr_warn("i %d %d %d %d\n", i, (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]); kfree(in_buff); @@ -344,15 +344,15 @@ static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr, return -EINVAL; } spin_lock_irqsave(&speakup_info.spinlock, flags); - if (ch&2) { + if (ch & 2) { shut = 1; spk_do_flush(); } else { shut = 0; } - if (ch&4) + if (ch & 4) shut |= 0x40; - if (ch&1) + if (ch & 1) spk_shut_up |= shut; else spk_shut_up &= ~shut; @@ -476,12 +476,12 @@ static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr, pb = (struct st_bits_data *) &spk_punc_info[var->value]; mask = pb->mask; for (i = 33; i < 128; i++) { - if (!(spk_chartab[i]&mask)) + if (!(spk_chartab[i] & mask)) continue; *cp++ = (char)i; } spin_unlock_irqrestore(&speakup_info.spinlock, flags); - return cp-buf; + return cp - buf; } /* @@ -572,7 +572,7 @@ ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr, *cp1++ = '"'; *cp1++ = '\n'; *cp1 = '\0'; - rv = cp1-buf; + rv = cp1 - buf; } else { rv = sprintf(buf, "\"\"\n"); } @@ -862,42 +862,42 @@ static struct kobj_attribute version_attribute = __ATTR_RO(version); static struct kobj_attribute delimiters_attribute = - __ATTR(delimiters, S_IWUSR|S_IRUGO, punc_show, punc_store); + __ATTR(delimiters, S_IWUSR | S_IRUGO, punc_show, punc_store); static struct kobj_attribute ex_num_attribute = - __ATTR(ex_num, S_IWUSR|S_IRUGO, punc_show, punc_store); + __ATTR(ex_num, S_IWUSR | S_IRUGO, punc_show, punc_store); static struct kobj_attribute punc_all_attribute = - __ATTR(punc_all, S_IWUSR|S_IRUGO, punc_show, punc_store); + __ATTR(punc_all, S_IWUSR | S_IRUGO, punc_show, punc_store); static struct kobj_attribute punc_most_attribute = - __ATTR(punc_most, S_IWUSR|S_IRUGO, punc_show, punc_store); + __ATTR(punc_most, S_IWUSR | S_IRUGO, punc_show, punc_store); static struct kobj_attribute punc_some_attribute = - __ATTR(punc_some, S_IWUSR|S_IRUGO, punc_show, punc_store); + __ATTR(punc_some, S_IWUSR | S_IRUGO, punc_show, punc_store); static struct kobj_attribute repeats_attribute = - __ATTR(repeats, S_IWUSR|S_IRUGO, punc_show, punc_store); + __ATTR(repeats, S_IWUSR | S_IRUGO, punc_show, punc_store); static struct kobj_attribute attrib_bleep_attribute = - __ATTR(attrib_bleep, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(attrib_bleep, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute bell_pos_attribute = - __ATTR(bell_pos, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(bell_pos, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute bleep_time_attribute = - __ATTR(bleep_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(bleep_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute bleeps_attribute = - __ATTR(bleeps, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(bleeps, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute cursor_time_attribute = - __ATTR(cursor_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(cursor_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute key_echo_attribute = - __ATTR(key_echo, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(key_echo, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute no_interrupt_attribute = - __ATTR(no_interrupt, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(no_interrupt, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute punc_level_attribute = - __ATTR(punc_level, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(punc_level, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute reading_punc_attribute = - __ATTR(reading_punc, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(reading_punc, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute say_control_attribute = - __ATTR(say_control, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(say_control, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute say_word_ctl_attribute = - __ATTR(say_word_ctl, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(say_word_ctl, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute spell_delay_attribute = - __ATTR(spell_delay, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(spell_delay, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); /* * These attributes are i18n related. diff --git a/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c index cf854ad..3f7fb33 100644 --- a/drivers/staging/speakup/selection.c +++ b/drivers/staging/speakup/selection.c @@ -99,7 +99,7 @@ int speakup_set_selection(struct tty_struct *tty) sel_start = new_sel_start; sel_end = new_sel_end; /* Allocate a new buffer before freeing the old one ... */ - bp = kmalloc((sel_end-sel_start)/2+1, GFP_ATOMIC); + bp = kmalloc((sel_end - sel_start) / 2 + 1, GFP_ATOMIC); if (!bp) { speakup_clear_selection(); return -ENOMEM; diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c index 3b5835b..2033faa 100644 --- a/drivers/staging/speakup/serialio.c +++ b/drivers/staging/speakup/serialio.c @@ -88,7 +88,7 @@ static irqreturn_t synth_readbuf_handler(int irq, void *dev_id) spin_lock_irqsave(&speakup_info.spinlock, flags); while (inb_p(speakup_info.port_tts + UART_LSR) & UART_LSR_DR) { - c = inb_p(speakup_info.port_tts+UART_RX); + c = inb_p(speakup_info.port_tts + UART_RX); synth->read_buff_add((u_char) c); /*printk(KERN_ERR "c = %d\n", c); */ /*pr_warn("C = %d\n", c); */ @@ -113,12 +113,12 @@ static void start_serial_interrupt(int irq) outb(UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2, speakup_info.port_tts + UART_MCR); /* Turn on Interrupts */ - outb(UART_IER_MSI|UART_IER_RLSI|UART_IER_RDI, + outb(UART_IER_MSI | UART_IER_RLSI | UART_IER_RDI, speakup_info.port_tts + UART_IER); - inb(speakup_info.port_tts+UART_LSR); - inb(speakup_info.port_tts+UART_RX); - inb(speakup_info.port_tts+UART_IIR); - inb(speakup_info.port_tts+UART_MSR); + inb(speakup_info.port_tts + UART_LSR); + inb(speakup_info.port_tts + UART_RX); + inb(speakup_info.port_tts + UART_IIR); + inb(speakup_info.port_tts + UART_MSR); outb(1, speakup_info.port_tts + UART_FCR); /* Turn FIFO On */ } @@ -131,7 +131,7 @@ void spk_stop_serial_interrupt(void) return; /* Turn off interrupts */ - outb(0, speakup_info.port_tts+UART_IER); + outb(0, speakup_info.port_tts + UART_IER); /* Free IRQ */ free_irq(serstate->irq, (void *) synth_readbuf_handler); } diff --git a/drivers/staging/speakup/speakup_acntpc.c b/drivers/staging/speakup/speakup_acntpc.c index efb791b..2649ff1 100644 --- a/drivers/staging/speakup/speakup_acntpc.c +++ b/drivers/staging/speakup/speakup_acntpc.c @@ -1,4 +1,4 @@ -/* + /* * written by: Kirk Reiser <kirk@xxxxxxxxxxxxxx> * this version considerably modified by David Borowski, david575@xxxxxxxxxx * @@ -57,28 +57,28 @@ static struct var_t vars[] = { * These attributes will appear in /sys/accessibility/speakup/acntpc. */ static struct kobj_attribute caps_start_attribute = - __ATTR(caps_start, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(caps_start, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute caps_stop_attribute = - __ATTR(caps_stop, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(caps_stop, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute pitch_attribute = - __ATTR(pitch, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(pitch, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute rate_attribute = - __ATTR(rate, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(rate, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute tone_attribute = - __ATTR(tone, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(tone, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute vol_attribute = - __ATTR(vol, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(vol, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute delay_time_attribute = - __ATTR(delay_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(delay_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute direct_attribute = - __ATTR(direct, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(direct, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute full_time_attribute = - __ATTR(full_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(full_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute jiffy_delta_attribute = - __ATTR(jiffy_delta, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(jiffy_delta, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); static struct kobj_attribute trigger_time_attribute = - __ATTR(trigger_time, S_IWUSR|S_IRUGO, spk_var_show, spk_var_store); + __ATTR(trigger_time, S_IWUSR | S_IRUGO, spk_var_show, spk_var_store); /* * Create a group of attributes so that we can create and destroy them all @@ -233,7 +233,7 @@ static void do_catch_up(struct spk_synth *synth) delay_time_val = delay_time->u.n.value; spin_unlock_irqrestore(&speakup_info.spinlock, flags); schedule_timeout(msecs_to_jiffies(delay_time_val)); - jiff_max = jiffies+jiffy_delta_val; + jiff_max = jiffies + jiffy_delta_val; } } timeout = SPK_XMITR_TIMEOUT; @@ -260,13 +260,13 @@ static int synth_probe(struct spk_synth *synth) speakup_info.port_tts = port_forced; pr_info("probe forced to %x by kernel command line\n", speakup_info.port_tts); - if (synth_request_region(speakup_info.port_tts-1, + if (synth_request_region(speakup_info.port_tts - 1, SYNTH_IO_EXTENT)) { pr_warn("sorry, port already reserved\n"); return -EBUSY; } - port_val = inw(speakup_info.port_tts-1); - synth_port_control = speakup_info.port_tts-1; + port_val = inw(speakup_info.port_tts - 1); + synth_port_control = speakup_info.port_tts - 1; } else { for (i = 0; synth_portlist[i]; i++) { if (synth_request_region(synth_portlist[i], -- 2.1.4 _______________________________________________ Speakup mailing list Speakup@xxxxxxxxxxxxxxxxx http://linux-speakup.org/cgi-bin/mailman/listinfo/speakup