From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753436AbdCAWda (ORCPT ); Wed, 1 Mar 2017 17:33:30 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35896 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752261AbdCAWdX (ORCPT ); Wed, 1 Mar 2017 17:33:23 -0500 Subject: Re: [PATCH] staging: speakup: Comparison to NULL could be written To: Arushi Singhal , w.d.hubbs@gmail.com References: <20170301192140.GA30680@arushi-HP-Pavilion-Notebook> Cc: Chris Brannon , Kirk Reiser , Samuel Thibault , Greg Kroah-Hartman , speakup@linux-speakup.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com From: David Daney Message-ID: Date: Wed, 1 Mar 2017 11:52:47 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170301192140.GA30680@arushi-HP-Pavilion-Notebook> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/01/2017 11:21 AM, Arushi Singhal wrote: > Fixed coding style for null comparisons in speakup driver to be more > consistant with the rest of the kernel coding style. > > Signed-off-by: Arushi Singhal > --- > drivers/staging/speakup/fakekey.c | 2 +- > drivers/staging/speakup/kobjects.c | 2 +- > drivers/staging/speakup/main.c | 38 +++++++++++++++++++------------------- > 3 files changed, 21 insertions(+), 21 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/kobjects.c b/drivers/staging/speakup/kobjects.c > index 5d871ec3693c..fdd6e4b33951 100644 > --- a/drivers/staging/speakup/kobjects.c > +++ b/drivers/staging/speakup/kobjects.c > @@ -391,7 +391,7 @@ static ssize_t synth_store(struct kobject *kobj, struct kobj_attribute *attr, > len--; > new_synth_name[len] = '\0'; > spk_strlwr(new_synth_name); > - if ((synth != NULL) && (!strcmp(new_synth_name, synth->name))) { > + if ((synth) && (!strcmp(new_synth_name, synth->name))) { With the change, the parenthesis are not needed. In fact were then needed before? There are two sets of unneeded parenthesis, get rid of them both.