All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shivani Bhardwaj <shivanib134@gmail.com>
To: Shraddha Barke <shraddha.6596@gmail.com>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH 2/3] Staging: wilc1000: host_interface: Remove extra NULL test
Date: Mon, 12 Oct 2015 21:18:57 +0530	[thread overview]
Message-ID: <CAKHNQQHnYQ3jR3iyzkWbSOLr6EMDMpL+jjv2=A2QBy=Yy+3qBg@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1510122108570.26851@shraddha-370R4E-370R4V-370R5E-3570RE-370R5V>

On Mon, Oct 12, 2015 at 9:12 PM, Shraddha Barke <shraddha.6596@gmail.com> wrote:
>
>
> On Mon, 12 Oct 2015, Shivani Bhardwaj wrote:
>
>> Remove NULL test statement as it is preceded by another NULL test on the
>> same variable in the code.
>> Issue found using coccinelle.
>
>
> While you are at it, you might want to consider taking a closer look at this
> file. There are other instances of unnecessary null test which can be
> found using Coccinelle.I didn't work on this one since you already are :)
>
> Shraddha

Thanks! Are you writing your own cocci scripts? I used the one made
available by Julia, it finds only one.

>>
>>
>> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
>> ---
>> drivers/staging/wilc1000/host_interface.c | 7 ++-----
>> 1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/staging/wilc1000/host_interface.c
>> b/drivers/staging/wilc1000/host_interface.c
>> index d279eba..b6eea9a 100644
>> --- a/drivers/staging/wilc1000/host_interface.c
>> +++ b/drivers/staging/wilc1000/host_interface.c
>> @@ -6038,11 +6038,8 @@ s32 host_int_deinit(tstrWILC_WFIDrv *hWFIDrv)
>>         if (ret)
>>                 s32Error = -ENOENT;
>>
>> -       if (pstrWFIDrv != NULL) {
>> -               kfree(pstrWFIDrv);
>> -               /* pstrWFIDrv=NULL; */
>> -
>> -       }
>> +       kfree(pstrWFIDrv);
>> +       /* pstrWFIDrv=NULL; */
>>
>>         clients_count--; /* Decrease number of created entities */
>>         terminated_handle = NULL;
>> --
>> 2.1.0
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "outreachy-kernel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to outreachy-kernel+unsubscribe@googlegroups.com.
>> To post to this group, send email to outreachy-kernel@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/outreachy-kernel/c122920d4c47aae820bb3a350cdb8511376b0c3c.1444655924.git.shivanib134%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>


  reply	other threads:[~2015-10-12 15:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12 13:34 [PATCH 0/3] Fix issues detected by coccinelle Shivani Bhardwaj
2015-10-12 13:35 ` [PATCH 1/3] Staging: wilc1000: host_interface: Replace kmalloc with kzalloc Shivani Bhardwaj
2015-10-12 13:45   ` [Outreachy kernel] " Shraddha Barke
2015-10-12 13:35 ` [PATCH 2/3] Staging: wilc1000: host_interface: Remove extra NULL test Shivani Bhardwaj
2015-10-12 15:42   ` [Outreachy kernel] " Shraddha Barke
2015-10-12 15:48     ` Shivani Bhardwaj [this message]
2015-10-12 13:36 ` [PATCH 3/3] Staging: wilc1000: host_interface: Remove unused code Shivani Bhardwaj
2015-10-12 13:54   ` [Outreachy kernel] " Julia Lawall
2015-10-12 14:21     ` Shivani Bhardwaj
2015-10-12 14:27       ` Julia Lawall
2015-10-12 15:24         ` Shivani Bhardwaj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKHNQQHnYQ3jR3iyzkWbSOLr6EMDMpL+jjv2=A2QBy=Yy+3qBg@mail.gmail.com' \
    --to=shivanib134@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=shraddha.6596@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.