From: Jeremiah Mahler <jmmahler@gmail.com>
To: Loic Pefferkorn <loic@loicp.eu>
Cc: gregkh@linuxfoundation.org, alan@linux.intel.com,
jun.j.tian@intel.com, octavian.purdila@intel.com, nnk@google.com,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: goldfish: Fix minor coding style
Date: Sat, 13 Dec 2014 09:55:18 -0800 [thread overview]
Message-ID: <20141213175518.GA28616@hudson.localdomain> (raw)
In-Reply-To: <e2a3b3ccf85790c865683832698908458931be6a.1418487651.git.loic@loicp.eu>
Loic,
On Sat, Dec 13, 2014 at 05:29:26PM +0100, Loic Pefferkorn wrote:
> Hello,
>
> The convention for checking for NULL pointers is !ptr and not ptr == NULL.
> This patch fixes such occurences in goldfish driver, it applies against next-20141212
>
Whose convention is this? I can't find any mention in
Documention/CodingStyle. checkpatch.pl doesn't complain about them.
And there are almost three thousand examples in staging which don't
use this convention.
linux-next$ grep -r "== NULL" drivers/staging/* | wc -l
2844
>
> Signed-off-by: Loic Pefferkorn <loic@loicp.eu>
> ---
> drivers/staging/goldfish/goldfish_audio.c | 8 ++++----
> drivers/staging/goldfish/goldfish_nand.c | 10 +++++-----
> 2 files changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/staging/goldfish/goldfish_audio.c b/drivers/staging/goldfish/goldfish_audio.c
> index f200359..7ab034b 100644
> --- a/drivers/staging/goldfish/goldfish_audio.c
> +++ b/drivers/staging/goldfish/goldfish_audio.c
> @@ -273,19 +273,19 @@ static int goldfish_audio_probe(struct platform_device *pdev)
> dma_addr_t buf_addr;
>
> data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
> - if (data == NULL)
> + if (!data)
> return -ENOMEM;
> spin_lock_init(&data->lock);
> init_waitqueue_head(&data->wait);
> platform_set_drvdata(pdev, data);
>
> r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (r == NULL) {
> + if (!r) {
> dev_err(&pdev->dev, "platform_get_resource failed\n");
> return -ENODEV;
> }
> data->reg_base = devm_ioremap(&pdev->dev, r->start, PAGE_SIZE);
> - if (data->reg_base == NULL)
> + if (!data->reg_base)
> return -ENOMEM;
>
[...]
--
- Jeremiah Mahler
next prev parent reply other threads:[~2014-12-13 17:55 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-13 16:29 Loic Pefferkorn
2014-12-13 17:55 ` Jeremiah Mahler [this message]
2014-12-13 18:22 ` Loic Pefferkorn
2014-12-13 19:46 ` Jeremiah Mahler
2014-12-15 11:44 ` [PATCH] checkpatch giving bogus advice (was staging: goldfish: Fix minor coding style) One Thousand Gnomes
2014-12-15 11:59 ` Dan Carpenter
2014-12-16 0:50 ` Joe Perches
2014-12-15 13:03 ` Jeremiah Mahler
2014-12-15 13:43 ` Dan Carpenter
2014-12-15 14:08 ` Jeremiah Mahler
2014-12-13 19:07 ` [PATCH] staging: goldfish: Fix minor coding style One Thousand Gnomes
2014-12-13 21:20 ` Loic Pefferkorn
2014-12-15 11:51 ` One Thousand Gnomes
2014-12-15 12:26 ` Loic Pefferkorn
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=20141213175518.GA28616@hudson.localdomain \
--to=jmmahler@gmail.com \
--cc=alan@linux.intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jun.j.tian@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=loic@loicp.eu \
--cc=nnk@google.com \
--cc=octavian.purdila@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®