From: Markus Elfring <Markus.Elfring@web.de>
To: Clark Wang <xiaoning.wang@nxp.com>, linux-spi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Mark Brown <broonie@kernel.org>
Subject: Re: [PATCH 2/5] spi: lpspi: add NULL check when probe device
Date: Tue, 14 Jul 2020 10:48:18 +0200 [thread overview]
Message-ID: <40ba9761-3f51-3f7f-5026-eed613dbf6dc@web.de> (raw)
…
> +++ b/drivers/spi/spi-fsl-lpspi.c
> @@ -841,6 +841,11 @@ static int fsl_lpspi_probe(struct platform_device *pdev)
> u32 temp;
> bool is_slave;
>
> + if (!np && !lpspi_platform_info) {
> + dev_err(&pdev->dev, "can't get the platform data\n");
> + return -EINVAL;
> + }
…
How do you think about to combine these null pointer checks by the logical
operator “or” instead of “and”?
Regards,
Markus
next reply other threads:[~2020-07-14 8:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-14 8:48 Markus Elfring [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-07-14 7:52 [PATCH 0/5] Some bug fix for lpspi Clark Wang
2020-07-14 7:52 ` [PATCH 2/5] spi: lpspi: add NULL check when probe device Clark Wang
2020-07-21 23:44 ` Mark Brown
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=40ba9761-3f51-3f7f-5026-eed613dbf6dc@web.de \
--to=markus.elfring@web.de \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=xiaoning.wang@nxp.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;
as well as URLs for NNTP newsgroup(s).