Commit c9219a55 authored by Tamara Diaconita's avatar Tamara Diaconita Committed by Greg Kroah-Hartman

staging: speakup: kobjects: Align the code

Fixed the checkpath.pl issue:
CHECK: Aligment should match open paranthesis.

Added and deleted spaces and tabs to align the code.
Signed-off-by: default avatarTamara Diaconita <diaconita.tamara@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 51c3d034
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
* This is called when a user reads the characters or chartab sys file. * This is called when a user reads the characters or chartab sys file.
*/ */
static ssize_t chars_chartab_show(struct kobject *kobj, static ssize_t chars_chartab_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf) struct kobj_attribute *attr, char *buf)
{ {
int i; int i;
int len = 0; int len = 0;
...@@ -79,7 +79,7 @@ static ssize_t chars_chartab_show(struct kobject *kobj, ...@@ -79,7 +79,7 @@ static ssize_t chars_chartab_show(struct kobject *kobj,
* character descriptions or chartab entries. * character descriptions or chartab entries.
*/ */
static void report_char_chartab_status(int reset, int received, int used, static void report_char_chartab_status(int reset, int received, int used,
int rejected, int do_characters) int rejected, int do_characters)
{ {
static char const *object_type[] = { static char const *object_type[] = {
"character class entries", "character class entries",
...@@ -92,7 +92,7 @@ static void report_char_chartab_status(int reset, int received, int used, ...@@ -92,7 +92,7 @@ static void report_char_chartab_status(int reset, int received, int used,
pr_info("%s reset to defaults\n", object_type[do_characters]); pr_info("%s reset to defaults\n", object_type[do_characters]);
} else if (received) { } else if (received) {
len = snprintf(buf, sizeof(buf), len = snprintf(buf, sizeof(buf),
" updated %d of %d %s\n", " updated %d of %d %s\n",
used, received, object_type[do_characters]); used, received, object_type[do_characters]);
if (rejected) if (rejected)
snprintf(buf + (len - 1), sizeof(buf) - (len - 1), snprintf(buf + (len - 1), sizeof(buf) - (len - 1),
...@@ -106,7 +106,7 @@ static void report_char_chartab_status(int reset, int received, int used, ...@@ -106,7 +106,7 @@ static void report_char_chartab_status(int reset, int received, int used,
* This is called when a user changes the characters or chartab parameters. * This is called when a user changes the characters or chartab parameters.
*/ */
static ssize_t chars_chartab_store(struct kobject *kobj, static ssize_t chars_chartab_store(struct kobject *kobj,
struct kobj_attribute *attr, const char *buf, size_t count) struct kobj_attribute *attr, const char *buf, size_t count)
{ {
char *cp = (char *)buf; char *cp = (char *)buf;
char *end = cp + count; /* the null at the end of the buffer */ char *end = cp + count; /* the null at the end of the buffer */
...@@ -213,7 +213,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj, ...@@ -213,7 +213,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
spin_unlock_irqrestore(&speakup_info.spinlock, flags); spin_unlock_irqrestore(&speakup_info.spinlock, flags);
report_char_chartab_status(reset, received, used, rejected, report_char_chartab_status(reset, received, used, rejected,
do_characters); do_characters);
return retval; return retval;
} }
...@@ -221,7 +221,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj, ...@@ -221,7 +221,7 @@ static ssize_t chars_chartab_store(struct kobject *kobj,
* This is called when a user reads the keymap parameter. * This is called when a user reads the keymap parameter.
*/ */
static ssize_t keymap_show(struct kobject *kobj, struct kobj_attribute *attr, static ssize_t keymap_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf) char *buf)
{ {
char *cp = buf; char *cp = buf;
int i; int i;
...@@ -257,7 +257,7 @@ static ssize_t keymap_show(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -257,7 +257,7 @@ static ssize_t keymap_show(struct kobject *kobj, struct kobj_attribute *attr,
* This is called when a user changes the keymap parameter. * This is called when a user changes the keymap parameter.
*/ */
static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr, static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
int i; int i;
ssize_t ret = count; ssize_t ret = count;
...@@ -291,9 +291,9 @@ static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -291,9 +291,9 @@ static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr,
i *= (int)cp1[-1] + 1; i *= (int)cp1[-1] + 1;
i += 2; /* 0 and last map ver */ i += 2; /* 0 and last map ver */
if (cp1[-3] != KEY_MAP_VER || cp1[-1] > 10 || 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, pr_warn("i %d %d %d %d\n", i,
(int)cp1[-3], (int)cp1[-2], (int)cp1[-1]); (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
kfree(in_buff); kfree(in_buff);
spin_unlock_irqrestore(&speakup_info.spinlock, flags); spin_unlock_irqrestore(&speakup_info.spinlock, flags);
return -EINVAL; return -EINVAL;
...@@ -307,7 +307,7 @@ static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -307,7 +307,7 @@ static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr,
if (i != 0 || cp1[-1] != KEY_MAP_VER || cp1[-2] != 0) { if (i != 0 || cp1[-1] != KEY_MAP_VER || cp1[-2] != 0) {
ret = -EINVAL; ret = -EINVAL;
pr_warn("end %d %d %d %d\n", i, pr_warn("end %d %d %d %d\n", i,
(int)cp1[-3], (int)cp1[-2], (int)cp1[-1]); (int)cp1[-3], (int)cp1[-2], (int)cp1[-1]);
} else { } else {
if (spk_set_key_info(in_buff, spk_key_buf)) { if (spk_set_key_info(in_buff, spk_key_buf)) {
spk_set_key_info(spk_key_defaults, spk_key_buf); spk_set_key_info(spk_key_defaults, spk_key_buf);
...@@ -324,7 +324,7 @@ static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -324,7 +324,7 @@ static ssize_t keymap_store(struct kobject *kobj, struct kobj_attribute *attr,
* This is called when a user changes the value of the silent parameter. * This is called when a user changes the value of the silent parameter.
*/ */
static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr, static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
int len; int len;
struct vc_data *vc = vc_cons[fg_console].d; struct vc_data *vc = vc_cons[fg_console].d;
...@@ -363,7 +363,7 @@ static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -363,7 +363,7 @@ static ssize_t silent_store(struct kobject *kobj, struct kobj_attribute *attr,
* This is called when a user reads the synth setting. * This is called when a user reads the synth setting.
*/ */
static ssize_t synth_show(struct kobject *kobj, struct kobj_attribute *attr, static ssize_t synth_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf) char *buf)
{ {
int rv; int rv;
...@@ -378,7 +378,7 @@ static ssize_t synth_show(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -378,7 +378,7 @@ static ssize_t synth_show(struct kobject *kobj, struct kobj_attribute *attr,
* This is called when a user requests to change synthesizers. * This is called when a user requests to change synthesizers.
*/ */
static ssize_t synth_store(struct kobject *kobj, struct kobj_attribute *attr, static ssize_t synth_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
int len; int len;
char new_synth_name[10]; char new_synth_name[10];
...@@ -404,7 +404,7 @@ static ssize_t synth_store(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -404,7 +404,7 @@ static ssize_t synth_store(struct kobject *kobj, struct kobj_attribute *attr,
* This is called when text is sent to the synth via the synth_direct file. * This is called when text is sent to the synth via the synth_direct file.
*/ */
static ssize_t synth_direct_store(struct kobject *kobj, static ssize_t synth_direct_store(struct kobject *kobj,
struct kobj_attribute *attr, const char *buf, size_t count) struct kobj_attribute *attr, const char *buf, size_t count)
{ {
u_char tmp[256]; u_char tmp[256];
int len; int len;
...@@ -434,7 +434,7 @@ static ssize_t synth_direct_store(struct kobject *kobj, ...@@ -434,7 +434,7 @@ static ssize_t synth_direct_store(struct kobject *kobj,
* This function is called when a user reads the version. * This function is called when a user reads the version.
*/ */
static ssize_t version_show(struct kobject *kobj, struct kobj_attribute *attr, static ssize_t version_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf) char *buf)
{ {
char *cp; char *cp;
...@@ -450,7 +450,7 @@ static ssize_t version_show(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -450,7 +450,7 @@ static ssize_t version_show(struct kobject *kobj, struct kobj_attribute *attr,
* This is called when a user reads the punctuation settings. * This is called when a user reads the punctuation settings.
*/ */
static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr, static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf) char *buf)
{ {
int i; int i;
char *cp = buf; char *cp = buf;
...@@ -470,7 +470,7 @@ static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -470,7 +470,7 @@ static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr,
var = spk_get_punc_var(p_header->var_id); var = spk_get_punc_var(p_header->var_id);
if (!var) { if (!var) {
pr_warn("var is null, p_header->var_id is %i\n", pr_warn("var is null, p_header->var_id is %i\n",
p_header->var_id); p_header->var_id);
return -EINVAL; return -EINVAL;
} }
...@@ -490,7 +490,7 @@ static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -490,7 +490,7 @@ static ssize_t punc_show(struct kobject *kobj, struct kobj_attribute *attr,
* This is called when a user changes the punctuation settings. * This is called when a user changes the punctuation settings.
*/ */
static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr, static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
int x; int x;
struct st_var_header *p_header; struct st_var_header *p_header;
...@@ -512,7 +512,7 @@ static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -512,7 +512,7 @@ static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr,
var = spk_get_punc_var(p_header->var_id); var = spk_get_punc_var(p_header->var_id);
if (!var) { if (!var) {
pr_warn("var is null, p_header->var_id is %i\n", pr_warn("var is null, p_header->var_id is %i\n",
p_header->var_id); p_header->var_id);
return -EINVAL; return -EINVAL;
} }
...@@ -537,7 +537,7 @@ static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -537,7 +537,7 @@ static ssize_t punc_store(struct kobject *kobj, struct kobj_attribute *attr,
* This function is called when a user reads one of the variable parameters. * This function is called when a user reads one of the variable parameters.
*/ */
ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr, ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf) char *buf)
{ {
int rv = 0; int rv = 0;
struct st_var_header *param; struct st_var_header *param;
...@@ -581,7 +581,7 @@ ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -581,7 +581,7 @@ ssize_t spk_var_show(struct kobject *kobj, struct kobj_attribute *attr,
break; break;
default: default:
rv = sprintf(buf, "Bad parameter %s, type %i\n", rv = sprintf(buf, "Bad parameter %s, type %i\n",
param->name, param->var_type); param->name, param->var_type);
break; break;
} }
spin_unlock_irqrestore(&speakup_info.spinlock, flags); spin_unlock_irqrestore(&speakup_info.spinlock, flags);
...@@ -593,7 +593,7 @@ EXPORT_SYMBOL_GPL(spk_var_show); ...@@ -593,7 +593,7 @@ EXPORT_SYMBOL_GPL(spk_var_show);
* Used to reset either default_pitch or default_vol. * Used to reset either default_pitch or default_vol.
*/ */
static inline void spk_reset_default_value(char *header_name, static inline void spk_reset_default_value(char *header_name,
int *synth_default_value, int idx) int *synth_default_value, int idx)
{ {
struct st_var_header *param; struct st_var_header *param;
...@@ -613,7 +613,7 @@ static inline void spk_reset_default_value(char *header_name, ...@@ -613,7 +613,7 @@ static inline void spk_reset_default_value(char *header_name,
* variable parameters. * variable parameters.
*/ */
ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr, ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
struct st_var_header *param; struct st_var_header *param;
int ret; int ret;
...@@ -662,9 +662,9 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -662,9 +662,9 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr,
var_data = param->data; var_data = param->data;
value = var_data->u.n.value; value = var_data->u.n.value;
spk_reset_default_value("pitch", synth->default_pitch, spk_reset_default_value("pitch", synth->default_pitch,
value); value);
spk_reset_default_value("vol", synth->default_vol, spk_reset_default_value("vol", synth->default_vol,
value); value);
} }
break; break;
case VAR_STRING: case VAR_STRING:
...@@ -679,7 +679,7 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -679,7 +679,7 @@ ssize_t spk_var_store(struct kobject *kobj, struct kobj_attribute *attr,
ret = spk_set_string_var(cp, param, len); ret = spk_set_string_var(cp, param, len);
if (ret == -E2BIG) if (ret == -E2BIG)
pr_warn("value too long for %s\n", pr_warn("value too long for %s\n",
param->name); param->name);
break; break;
default: default:
pr_warn("%s unknown type %d\n", pr_warn("%s unknown type %d\n",
...@@ -699,7 +699,7 @@ EXPORT_SYMBOL_GPL(spk_var_store); ...@@ -699,7 +699,7 @@ EXPORT_SYMBOL_GPL(spk_var_store);
*/ */
static ssize_t message_show_helper(char *buf, enum msg_index_t first, static ssize_t message_show_helper(char *buf, enum msg_index_t first,
enum msg_index_t last) enum msg_index_t last)
{ {
size_t bufsize = PAGE_SIZE; size_t bufsize = PAGE_SIZE;
char *buf_pointer = buf; char *buf_pointer = buf;
...@@ -712,7 +712,7 @@ static ssize_t message_show_helper(char *buf, enum msg_index_t first, ...@@ -712,7 +712,7 @@ static ssize_t message_show_helper(char *buf, enum msg_index_t first,
if (bufsize <= 1) if (bufsize <= 1)
break; break;
printed = scnprintf(buf_pointer, bufsize, "%d\t%s\n", printed = scnprintf(buf_pointer, bufsize, "%d\t%s\n",
index, spk_msg_get(cursor)); index, spk_msg_get(cursor));
buf_pointer += printed; buf_pointer += printed;
bufsize -= printed; bufsize -= printed;
} }
...@@ -721,7 +721,7 @@ static ssize_t message_show_helper(char *buf, enum msg_index_t first, ...@@ -721,7 +721,7 @@ static ssize_t message_show_helper(char *buf, enum msg_index_t first,
} }
static void report_msg_status(int reset, int received, int used, static void report_msg_status(int reset, int received, int used,
int rejected, char *groupname) int rejected, char *groupname)
{ {
int len; int len;
char buf[160]; char buf[160];
...@@ -742,7 +742,7 @@ static void report_msg_status(int reset, int received, int used, ...@@ -742,7 +742,7 @@ static void report_msg_status(int reset, int received, int used,
} }
static ssize_t message_store_helper(const char *buf, size_t count, static ssize_t message_store_helper(const char *buf, size_t count,
struct msg_group_t *group) struct msg_group_t *group)
{ {
char *cp = (char *)buf; char *cp = (char *)buf;
char *end = cp + count; char *end = cp + count;
...@@ -826,7 +826,7 @@ static ssize_t message_store_helper(const char *buf, size_t count, ...@@ -826,7 +826,7 @@ static ssize_t message_store_helper(const char *buf, size_t count,
} }
static ssize_t message_show(struct kobject *kobj, static ssize_t message_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf) struct kobj_attribute *attr, char *buf)
{ {
ssize_t retval = 0; ssize_t retval = 0;
struct msg_group_t *group = spk_find_msg_group(attr->attr.name); struct msg_group_t *group = spk_find_msg_group(attr->attr.name);
...@@ -842,7 +842,7 @@ static ssize_t message_show(struct kobject *kobj, ...@@ -842,7 +842,7 @@ static ssize_t message_show(struct kobject *kobj,
} }
static ssize_t message_store(struct kobject *kobj, struct kobj_attribute *attr, static ssize_t message_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
struct msg_group_t *group = spk_find_msg_group(attr->attr.name); struct msg_group_t *group = spk_find_msg_group(attr->attr.name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment