From: Greg KH <gregkh@linuxfoundation.org>
To: Katie Dunne <kdunne@mail.ccsf.edu>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] Staging: fwserial: Replace NULL comparison with !foo
Date: Tue, 3 Mar 2015 22:32:47 -0800 [thread overview]
Message-ID: <20150304063247.GA21721@kroah.com> (raw)
In-Reply-To: <20150303181351.GA13380@katie-Inspiron-5748>
On Tue, Mar 03, 2015 at 10:13:51AM -0800, Katie Dunne wrote:
> Addresses checkpatch.pl check
> CHECK: Comparison to NULL could be written "!fifi->data"
>
> Makes the indicated replacements
>
> Signed-off-by: Katie Dunne <kdunne@mail.ccsf.edu>
> ---
> drivers/staging/fwserial/dma_fifo.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/fwserial/dma_fifo.c b/drivers/staging/fwserial/dma_fifo.c
> index 0279062..4c50e08 100644
> --- a/drivers/staging/fwserial/dma_fifo.c
> +++ b/drivers/staging/fwserial/dma_fifo.c
> @@ -106,7 +106,7 @@ void dma_fifo_free(struct dma_fifo *fifo)
> {
> struct dma_pending *pending, *next;
>
> - if (fifo->data == NULL)
> + if (!fifo->data)
I really don't like this type of change, as you now loose the typesafe
check for NULL and not 0, and it makes it a tiny bit harder to read.
So just please ignore that checkpatch warning, it's not that good.
thanks,
greg k-h
prev parent reply other threads:[~2015-03-04 6:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-03 18:13 [PATCH] Staging: fwserial: Replace NULL comparison with !foo Katie Dunne
2015-03-04 6:32 ` Greg KH [this message]
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=20150304063247.GA21721@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=kdunne@mail.ccsf.edu \
--cc=outreachy-kernel@googlegroups.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.