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

staging: speakup: Remove the explicit NULL comparison

Fixed coding style for null comparisons in speakup driver to be more
consistant with the rest of the kernel coding style.
Replaced 'x != NULL' with 'x' and 'x = NULL' with '!x'.

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
0d6ff616 f239d3db

+17 -17
+1 -1
drivers/staging/speakup/fakekey.c
··· 56 56 57 57 void speakup_remove_virtual_keyboard(void) 58 58 { 59 - if (virt_keyboard != NULL) { 59 + if (virt_keyboard) { 60 60 input_unregister_device(virt_keyboard); 61 61 virt_keyboard = NULL; 62 62 }
+16 -16
drivers/staging/speakup/main.c
··· 301 301 spk_shut_up |= 0x01; 302 302 spk_parked &= 0xfe; 303 303 speakup_date(vc); 304 - if (synth != NULL) 304 + if (synth) 305 305 spk_do_flush(); 306 306 } 307 307 ··· 446 446 } 447 447 448 448 cp = spk_characters[ch]; 449 - if (cp == NULL) { 449 + if (!cp) { 450 450 pr_info("speak_char: cp == NULL!\n"); 451 451 return; 452 452 } ··· 1171 1171 { 1172 1172 unsigned long flags; 1173 1173 1174 - if (synth == NULL || up_flag || spk_killed) 1174 + if (!synth || up_flag || spk_killed) 1175 1175 return; 1176 1176 spin_lock_irqsave(&speakup_info.spinlock, flags); 1177 1177 if (cursor_track == read_all_mode) { ··· 1209 1209 spin_unlock_irqrestore(&speakup_info.spinlock, flags); 1210 1210 return; 1211 1211 } 1212 - if (synth == NULL || spk_killed) { 1212 + if (!synth || spk_killed) { 1213 1213 spin_unlock_irqrestore(&speakup_info.spinlock, flags); 1214 1214 return; 1215 1215 } ··· 1346 1346 int vc_num; 1347 1347 1348 1348 vc_num = vc->vc_num; 1349 - if (speakup_console[vc_num] == NULL) { 1349 + if (!speakup_console[vc_num]) { 1350 1350 speakup_console[vc_num] = kzalloc(sizeof(*speakup_console[0]), 1351 1351 gfp_flags); 1352 1352 if (!speakup_console[vc_num]) ··· 1399 1399 1400 1400 static void read_all_doc(struct vc_data *vc) 1401 1401 { 1402 - if ((vc->vc_num != fg_console) || synth == NULL || spk_shut_up) 1402 + if ((vc->vc_num != fg_console) || !synth || spk_shut_up) 1403 1403 return; 1404 1404 if (!synth_supports_indexing()) 1405 1405 return; ··· 1514 1514 spin_lock_irqsave(&speakup_info.spinlock, flags); 1515 1515 if (cursor_track == read_all_mode) { 1516 1516 spk_parked &= 0xfe; 1517 - if (synth == NULL || up_flag || spk_shut_up) { 1517 + if (!synth || up_flag || spk_shut_up) { 1518 1518 spin_unlock_irqrestore(&speakup_info.spinlock, flags); 1519 1519 return NOTIFY_STOP; 1520 1520 } ··· 1536 1536 1537 1537 spin_lock_irqsave(&speakup_info.spinlock, flags); 1538 1538 spk_parked &= 0xfe; 1539 - if (synth == NULL || up_flag || spk_shut_up || cursor_track == CT_Off) { 1539 + if (!synth || up_flag || spk_shut_up || cursor_track == CT_Off) { 1540 1540 spin_unlock_irqrestore(&speakup_info.spinlock, flags); 1541 1541 return; 1542 1542 } ··· 1732 1732 return; 1733 1733 if (!spk_parked) 1734 1734 speakup_date(vc); 1735 - if (spk_shut_up || synth == NULL) { 1735 + if (spk_shut_up || !synth) { 1736 1736 spin_unlock_irqrestore(&speakup_info.spinlock, flags); 1737 1737 return; 1738 1738 } ··· 1749 1749 { 1750 1750 unsigned long flags; 1751 1751 1752 - if ((vc->vc_num != fg_console) || spk_shut_up || synth == NULL) 1752 + if ((vc->vc_num != fg_console) || spk_shut_up || !synth) 1753 1753 return; 1754 1754 if (!spin_trylock_irqsave(&speakup_info.spinlock, flags)) 1755 1755 /* Speakup output, discard */ ··· 1778 1778 { 1779 1779 unsigned long flags; 1780 1780 1781 - if (speakup_console[vc->vc_num] == NULL || spk_parked) 1781 + if (!speakup_console[vc->vc_num] || spk_parked) 1782 1782 return; 1783 1783 if (!spin_trylock_irqsave(&speakup_info.spinlock, flags)) 1784 1784 /* Speakup output, discard */ ··· 1793 1793 int on_off = 2; 1794 1794 char *label; 1795 1795 1796 - if (synth == NULL || up_flag || spk_killed) 1796 + if (!synth || up_flag || spk_killed) 1797 1797 return; 1798 1798 spin_lock_irqsave(&speakup_info.spinlock, flags); 1799 1799 spk_shut_up &= 0xfe; ··· 1837 1837 1838 1838 var_id = var_id / 2 + FIRST_SET_VAR; 1839 1839 p_header = spk_get_var_header(var_id); 1840 - if (p_header == NULL) 1840 + if (!p_header) 1841 1841 return -1; 1842 1842 if (p_header->var_type != VAR_NUM) 1843 1843 return -1; ··· 1920 1920 { 1921 1921 int val = this_speakup_key - (FIRST_EDIT_BITS - 1); 1922 1922 1923 - if (spk_special_handler != NULL || val < 1 || val > 6) { 1923 + if (spk_special_handler || val < 1 || val > 6) { 1924 1924 synth_printf("%s\n", spk_msg_get(MSG_ERROR)); 1925 1925 return; 1926 1926 } ··· 2014 2014 2015 2015 static void speakup_goto(struct vc_data *vc) 2016 2016 { 2017 - if (spk_special_handler != NULL) { 2017 + if (spk_special_handler) { 2018 2018 synth_printf("%s\n", spk_msg_get(MSG_ERROR)); 2019 2019 return; 2020 2020 } ··· 2165 2165 } 2166 2166 } 2167 2167 no_map: 2168 - if (type == KT_SPKUP && spk_special_handler == NULL) { 2168 + if (type == KT_SPKUP && !spk_special_handler) { 2169 2169 do_spkup(vc, new_key); 2170 2170 spk_close_press = 0; 2171 2171 ret = 1;