Re: [PATCH 09/11] staging: speakup: Simplify the NULL comparisons

2017-03-23 Thread Greg KH
On Tue, Mar 21, 2017 at 05:12:33PM +0530, Arushi Singhal wrote:
> 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 
> ---
>  drivers/staging/speakup/fakekey.c |  2 +-
>  drivers/staging/speakup/main.c| 32 
>  2 files changed, 17 insertions(+), 17 deletions(-)

You used this same subject line in this series, not good :(

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/11] staging: speakup: Simplify the NULL comparisons

2017-03-21 Thread Arushi Singhal
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 
---
 drivers/staging/speakup/fakekey.c |  2 +-
 drivers/staging/speakup/main.c| 32 
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/speakup/fakekey.c 
b/drivers/staging/speakup/fakekey.c
index d76da0a1382c..294c74b47224 100644
--- a/drivers/staging/speakup/fakekey.c
+++ b/drivers/staging/speakup/fakekey.c
@@ -56,7 +56,7 @@ int speakup_add_virtual_keyboard(void)
 
 void speakup_remove_virtual_keyboard(void)
 {
-   if (virt_keyboard != NULL) {
+   if (virt_keyboard) {
input_unregister_device(virt_keyboard);
virt_keyboard = NULL;
}
diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index def1a36da9dd..7568e8149613 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -304,7 +304,7 @@ static void speakup_shut_up(struct vc_data *vc)
spk_shut_up |= 0x01;
spk_parked &= 0xfe;
speakup_date(vc);
-   if (synth != NULL)
+   if (synth)
spk_do_flush();
 }
 
@@ -449,7 +449,7 @@ static void speak_char(u16 ch)
}
 
cp = spk_characters[ch];
-   if (cp == NULL) {
+   if (!cp) {
pr_info("speak_char: cp == NULL!\n");
return;
}
@@ -1177,7 +1177,7 @@ static void do_handle_shift(struct vc_data *vc, u_char 
value, char up_flag)
 {
unsigned long flags;
 
-   if (synth == NULL || up_flag || spk_killed)
+   if (!synth || up_flag || spk_killed)
return;
spin_lock_irqsave(_info.spinlock, flags);
if (cursor_track == read_all_mode) {
@@ -1215,7 +1215,7 @@ static void do_handle_latin(struct vc_data *vc, u_char 
value, char up_flag)
spin_unlock_irqrestore(_info.spinlock, flags);
return;
}
-   if (synth == NULL || spk_killed) {
+   if (!synth || spk_killed) {
spin_unlock_irqrestore(_info.spinlock, flags);
return;
}
@@ -1341,7 +1341,7 @@ static int speakup_allocate(struct vc_data *vc)
int vc_num;
 
vc_num = vc->vc_num;
-   if (speakup_console[vc_num] == NULL) {
+   if (!speakup_console[vc_num]) {
speakup_console[vc_num] = kzalloc(sizeof(*speakup_console[0]),
  GFP_ATOMIC);
if (!speakup_console[vc_num])
@@ -1394,7 +1394,7 @@ static void kbd_fakekey2(struct vc_data *vc, int command)
 
 static void read_all_doc(struct vc_data *vc)
 {
-   if ((vc->vc_num != fg_console) || synth == NULL || spk_shut_up)
+   if ((vc->vc_num != fg_console) || !synth || spk_shut_up)
return;
if (!synth_supports_indexing())
return;
@@ -1509,7 +1509,7 @@ static int pre_handle_cursor(struct vc_data *vc, u_char 
value, char up_flag)
spin_lock_irqsave(_info.spinlock, flags);
if (cursor_track == read_all_mode) {
spk_parked &= 0xfe;
-   if (synth == NULL || up_flag || spk_shut_up) {
+   if (!synth || up_flag || spk_shut_up) {
spin_unlock_irqrestore(_info.spinlock, flags);
return NOTIFY_STOP;
}
@@ -1531,7 +1531,7 @@ static void do_handle_cursor(struct vc_data *vc, u_char 
value, char up_flag)
 
spin_lock_irqsave(_info.spinlock, flags);
spk_parked &= 0xfe;
-   if (synth == NULL || up_flag || spk_shut_up || cursor_track == CT_Off) {
+   if (!synth || up_flag || spk_shut_up || cursor_track == CT_Off) {
spin_unlock_irqrestore(_info.spinlock, flags);
return;
}
@@ -1730,7 +1730,7 @@ static void speakup_bs(struct vc_data *vc)
return;
if (!spk_parked)
speakup_date(vc);
-   if (spk_shut_up || synth == NULL) {
+   if (spk_shut_up || !synth) {
spin_unlock_irqrestore(_info.spinlock, flags);
return;
}
@@ -1747,7 +1747,7 @@ static void speakup_con_write(struct vc_data *vc, u16 
*str, int len)
 {
unsigned long flags;
 
-   if ((vc->vc_num != fg_console) || spk_shut_up || synth == NULL)
+   if ((vc->vc_num != fg_console) || spk_shut_up || !synth)
return;
if (!spin_trylock_irqsave(_info.spinlock, flags))
/* Speakup output, discard */
@@ -1776,7 +1776,7 @@ static void speakup_con_update(struct vc_data *vc)
 {
unsigned long flags;
 
-   if (speakup_console[vc->vc_num] == NULL || spk_parked)
+   if (!speakup_console[vc->vc_num] || spk_parked)
return;
if (!spin_trylock_irqsave(_info.spinlock, flags))
/* Speakup output,