From b4b7ff4b08e691656c9d77c758fc355833128ac0 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Wed, 20 Jan 2016 14:01:31 -0300 Subject: Linux-libre 4.4-gnu --- drivers/staging/speakup/buffers.c | 3 +- drivers/staging/speakup/devsynth.c | 4 +-- drivers/staging/speakup/i18n.c | 2 +- drivers/staging/speakup/kobjects.c | 16 +++++------ drivers/staging/speakup/selection.c | 2 +- drivers/staging/speakup/serialio.c | 4 +-- drivers/staging/speakup/speakup_audptr.c | 2 +- drivers/staging/speakup/speakup_dectlk.c | 3 +- drivers/staging/speakup/speakup_soft.c | 3 +- drivers/staging/speakup/spk_priv.h | 42 ++++++++++++++-------------- drivers/staging/speakup/spk_priv_keyinfo.h | 44 +++++++++++++++--------------- drivers/staging/speakup/varhandlers.c | 20 +++++++------- 12 files changed, 73 insertions(+), 72 deletions(-) (limited to 'drivers/staging/speakup') diff --git a/drivers/staging/speakup/buffers.c b/drivers/staging/speakup/buffers.c index d4d45989b..8565c2343 100644 --- a/drivers/staging/speakup/buffers.c +++ b/drivers/staging/speakup/buffers.c @@ -101,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/drivers/staging/speakup/devsynth.c b/drivers/staging/speakup/devsynth.c index 71c728acf..d1ffdf4c0 100644 --- a/drivers/staging/speakup/devsynth.c +++ b/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/drivers/staging/speakup/i18n.c b/drivers/staging/speakup/i18n.c index f06174754..12f880ed4 100644 --- a/drivers/staging/speakup/i18n.c +++ b/drivers/staging/speakup/i18n.c @@ -389,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/drivers/staging/speakup/kobjects.c b/drivers/staging/speakup/kobjects.c index 958add483..fdfeb42b2 100644 --- a/drivers/staging/speakup/kobjects.c +++ b/drivers/staging/speakup/kobjects.c @@ -368,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); @@ -459,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; @@ -501,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; @@ -546,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); @@ -622,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/drivers/staging/speakup/selection.c b/drivers/staging/speakup/selection.c index 98af3b1f2..aa5ab6c80 100644 --- a/drivers/staging/speakup/selection.c +++ b/drivers/staging/speakup/selection.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include "speakup.h" diff --git a/drivers/staging/speakup/serialio.c b/drivers/staging/speakup/serialio.c index 66ac999a0..3b5835b28 100644 --- a/drivers/staging/speakup/serialio.c +++ b/drivers/staging/speakup/serialio.c @@ -101,7 +101,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, @@ -127,7 +127,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 */ diff --git a/drivers/staging/speakup/speakup_audptr.c b/drivers/staging/speakup/speakup_audptr.c index ea89e36ec..a9a687232 100644 --- a/drivers/staging/speakup/speakup_audptr.c +++ b/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/drivers/staging/speakup/speakup_dectlk.c b/drivers/staging/speakup/speakup_dectlk.c index b5a23d42f..09063b823 100644 --- a/drivers/staging/speakup/speakup_dectlk.c +++ b/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/drivers/staging/speakup/speakup_soft.c b/drivers/staging/speakup/speakup_soft.c index 366358b60..b2eb5b133 100644 --- a/drivers/staging/speakup/speakup_soft.c +++ b/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 #include /* for misc_register, and SYNTH_MINOR */ diff --git a/drivers/staging/speakup/spk_priv.h b/drivers/staging/speakup/spk_priv.h index 1ef3795b8..9bb281d36 100644 --- a/drivers/staging/speakup/spk_priv.h +++ b/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/drivers/staging/speakup/spk_priv_keyinfo.h b/drivers/staging/speakup/spk_priv_keyinfo.h index 95c473a7e..3116ef78c 100644 --- a/drivers/staging/speakup/spk_priv_keyinfo.h +++ b/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/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c index 75bf40c14..ab4fe8de4 100644 --- a/drivers/staging/speakup/varhandlers.c +++ b/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; @@ -288,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; @@ -313,7 +313,7 @@ char *spk_strlwr(char *s) { char *p; - if (s == NULL) + if (!s) return NULL; for (p = s; *p; p++) @@ -323,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 == ',') -- cgit v1.2.3-54-g00ecf