Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: speakup: fixes braces {} should be used on all arms of this statement

This patch fixes the checks reported by checkpatch.pl
for braces {} should be used on all arms of this statement.

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Arushi Singhal and committed by
Greg Kroah-Hartman
0dcb2124 b8f107bc

+37 -28
+21 -14
drivers/staging/speakup/main.c
··· 406 406 if (bg > 7) { 407 407 synth_printf(" %s ", spk_msg_get(MSG_ON_BLINKING)); 408 408 bg -= 8; 409 - } else 409 + } else { 410 410 synth_printf(" %s ", spk_msg_get(MSG_ON)); 411 + } 411 412 synth_printf("%s\n", spk_msg_get(MSG_COLORS_START + bg)); 412 413 } 413 414 ··· 638 637 break; 639 638 spk_y--; 640 639 spk_x = vc->vc_cols - 1; 641 - } else 640 + } else { 642 641 spk_x--; 642 + } 643 643 spk_pos -= 2; 644 644 ch = get_char(vc, (u_short *)spk_pos, &temp); 645 645 if (ch == SPACE || ch == 0) ··· 693 691 spk_y++; 694 692 spk_x = 0; 695 693 edge_said = edge_right; 696 - } else 694 + } else { 697 695 spk_x++; 696 + } 698 697 spk_pos += 2; 699 698 last_state = state; 700 699 } ··· 726 723 spk_pitch_shift++; 727 724 else /* synth has no pitch */ 728 725 last_cap = spk_str_caps_stop; 729 - } else 726 + } else { 730 727 str_cap = spk_str_caps_stop; 728 + } 731 729 if (str_cap != last_cap) { 732 730 synth_printf("%s", str_cap); 733 731 last_cap = str_cap; ··· 1352 1348 if (!speakup_console[vc_num]) 1353 1349 return -ENOMEM; 1354 1350 speakup_date(vc); 1355 - } else if (!spk_parked) 1351 + } else if (!spk_parked) { 1356 1352 speakup_date(vc); 1353 + } 1357 1354 1358 1355 return 0; 1359 1356 } ··· 1407 1402 prev_cursor_track = cursor_track; 1408 1403 cursor_track = read_all_mode; 1409 1404 spk_reset_index_count(0); 1410 - if (get_sentence_buf(vc, 0) == -1) 1405 + if (get_sentence_buf(vc, 0) == -1) { 1411 1406 kbd_fakekey2(vc, RA_DOWN_ARROW); 1412 - else { 1407 + } else { 1413 1408 say_sentence_num(0, 0); 1414 1409 synth_insert_next_index(0); 1415 1410 start_read_all_timer(vc, RA_TIMER); ··· 1456 1451 if (!say_sentence_num(sentcount + 1, 1)) { 1457 1452 sn = 1; 1458 1453 spk_reset_index_count(sn); 1459 - } else 1454 + } else { 1460 1455 synth_insert_next_index(0); 1456 + } 1461 1457 if (!say_sentence_num(sn, 0)) { 1462 1458 kbd_fakekey2(vc, RA_FIND_NEXT_SENT); 1463 1459 return; ··· 1487 1481 rv = get_sentence_buf(vc, 0); 1488 1482 if (rv == -1) 1489 1483 read_all_doc(vc); 1490 - if (rv == 0) 1484 + if (rv == 0) { 1491 1485 kbd_fakekey2(vc, RA_FIND_NEXT_SENT); 1492 - else { 1486 + } else { 1493 1487 say_sentence_num(1, 0); 1494 1488 synth_insert_next_index(0); 1495 1489 start_read_all_timer(vc, RA_TIMER); ··· 2185 2179 if (type == KT_SPEC && value == 1) { 2186 2180 value = '\n'; 2187 2181 type = KT_LATIN; 2188 - } else if (type == KT_LETTER) 2182 + } else if (type == KT_LETTER) { 2189 2183 type = KT_LATIN; 2190 - else if (value == 0x7f) 2184 + } else if (value == 0x7f) { 2191 2185 value = 8; /* make del = backspace */ 2186 + } 2192 2187 ret = (*spk_special_handler) (vc, type, value, keycode); 2193 2188 spk_close_press = 0; 2194 2189 if (ret < 0) ··· 2283 2276 speakup_deallocate(vc); 2284 2277 break; 2285 2278 case VT_WRITE: 2286 - if (param->c == '\b') 2279 + if (param->c == '\b') { 2287 2280 speakup_bs(vc); 2288 - else { 2281 + } else { 2289 2282 u16 d = param->c; 2290 2283 speakup_con_write(vc, &d, 1); 2291 2284 }
+3 -3
drivers/staging/speakup/speakup_decext.c
··· 195 195 spin_lock_irqsave(&speakup_info.spinlock, flags); 196 196 synth_buffer_getc(); 197 197 spin_unlock_irqrestore(&speakup_info.spinlock, flags); 198 - if (ch == '[') 198 + if (ch == '[') { 199 199 in_escape = 1; 200 - else if (ch == ']') 200 + } else if (ch == ']') { 201 201 in_escape = 0; 202 - else if (ch <= SPACE) { 202 + } else if (ch <= SPACE) { 203 203 if (!in_escape && strchr(",.!?;:", last)) 204 204 synth->io_ops->synth_out(synth, PROCSPEECH); 205 205 if (time_after_eq(jiffies, jiff_max)) {
+3 -3
drivers/staging/speakup/speakup_decpc.c
··· 410 410 spin_lock_irqsave(&speakup_info.spinlock, flags); 411 411 synth_buffer_getc(); 412 412 spin_unlock_irqrestore(&speakup_info.spinlock, flags); 413 - if (ch == '[') 413 + if (ch == '[') { 414 414 in_escape = 1; 415 - else if (ch == ']') 415 + } else if (ch == ']') { 416 416 in_escape = 0; 417 - else if (ch <= SPACE) { 417 + } else if (ch <= SPACE) { 418 418 if (!in_escape && strchr(",.!?;:", last)) 419 419 dt_sendchar(PROCSPEECH); 420 420 if (time_after_eq(jiffies, jiff_max)) {
+3 -3
drivers/staging/speakup/speakup_dectlk.c
··· 260 260 spin_lock_irqsave(&speakup_info.spinlock, flags); 261 261 synth_buffer_getc(); 262 262 spin_unlock_irqrestore(&speakup_info.spinlock, flags); 263 - if (ch == '[') 263 + if (ch == '[') { 264 264 in_escape = 1; 265 - else if (ch == ']') 265 + } else if (ch == ']') { 266 266 in_escape = 0; 267 - else if (ch <= SPACE) { 267 + } else if (ch <= SPACE) { 268 268 if (!in_escape && strchr(",.!?;:", last)) 269 269 synth->io_ops->synth_out(synth, PROCSPEECH); 270 270 if (time_after_eq(jiffies, jiff_max)) {
+7 -5
drivers/staging/speakup/varhandlers.c
··· 258 258 if (var->p_val != var_data->u.s.default_val) 259 259 strcpy((char *)var->p_val, var_data->u.s.default_val); 260 260 return -ERESTART; 261 - } else if (var->p_val) 261 + } else if (var->p_val) { 262 262 strcpy((char *)var->p_val, page); 263 - else 263 + } else { 264 264 return -E2BIG; 265 + } 265 266 return 0; 266 267 } 267 268 ··· 282 281 spk_chartab[*cp] &= ~mask; 283 282 } 284 283 cp = (u_char *)input; 285 - if (!cp) 284 + if (!cp) { 286 285 cp = spk_punc_info[which].value; 287 - else { 286 + } else { 288 287 for (; *cp; cp++) { 289 288 if (*cp < SPACE) 290 289 break; 291 290 if (mask < PUNC) { 292 291 if (!(spk_chartab[*cp] & PUNC)) 293 292 break; 294 - } else if (spk_chartab[*cp] & B_NUM) 293 + } else if (spk_chartab[*cp] & B_NUM) { 295 294 break; 295 + } 296 296 } 297 297 if (*cp) 298 298 return -EINVAL;