From: Hartmut Knaack <knaack.h@gmx.de>
To: Roberta Dobrescu <roberta.dobrescu@gmail.com>,
jic23@kernel.org, linux-iio@vger.kernel.org
Cc: octavian.purdila@intel.com, daniel.baluta@intel.com,
lars@metafoo.de, Michael.Hennerich@analog.com, pmeerw@pmeerw.net
Subject: Re: [PATCH 1/3] iio: frequency: Remove 'out of memory' message
Date: Fri, 19 Dec 2014 00:22:57 +0100 [thread overview]
Message-ID: <549361D1.8030101@gmx.de> (raw)
In-Reply-To: <1418721107-5429-2-git-send-email-roberta.dobrescu@gmail.com>
Roberta Dobrescu schrieb am 16.12.2014 um 10:11:
> This patch fixes the following checkpatch.pl warning:
> WARNING: Possible unnecessary 'out of memory' message
Hi Roberta,
I think this is slightly more complex. This function is used in adf4350_probe():
if (spi->dev.of_node) {
pdata = adf4350_parse_dt(&spi->dev);
if (pdata == NULL)
return -EINVAL;
Since pdata will only be NULL in the case, where you dropped the error message,
I think the EINVAL here should be changed to ENOMEM as well.
>
> Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
> ---
> drivers/iio/frequency/adf4350.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
> index 63a25d9..2b301eb 100644
> --- a/drivers/iio/frequency/adf4350.c
> +++ b/drivers/iio/frequency/adf4350.c
> @@ -387,10 +387,8 @@ static struct adf4350_platform_data *adf4350_parse_dt(struct device *dev)
> int ret;
>
> pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> - if (!pdata) {
> - dev_err(dev, "could not allocate memory for platform data\n");
> + if (!pdata)
> return NULL;
> - }
>
> strncpy(&pdata->name[0], np->name, SPI_NAME_SIZE - 1);
>
>
next prev parent reply other threads:[~2014-12-18 23:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-16 9:11 [PATCH 0/3] iio: frequency: Fix checkpatch warnings Roberta Dobrescu
2014-12-16 9:11 ` [PATCH 1/3] iio: frequency: Remove 'out of memory' message Roberta Dobrescu
2014-12-16 11:22 ` Daniel Baluta
2014-12-18 16:14 ` Lars-Peter Clausen
2014-12-18 23:22 ` Hartmut Knaack [this message]
2014-12-23 8:51 ` Daniel Baluta
2014-12-23 9:07 ` Lars-Peter Clausen
2014-12-23 9:24 ` Daniel Baluta
2014-12-23 20:21 ` Hartmut Knaack
2014-12-23 21:46 ` Lars-Peter Clausen
2014-12-26 9:38 ` Jonathan Cameron
2014-12-16 9:11 ` [PATCH 2/3] iio: frequency: Remove unnecessary braces around single statement block Roberta Dobrescu
2014-12-16 11:23 ` Daniel Baluta
2014-12-18 16:13 ` Lars-Peter Clausen
2014-12-26 9:39 ` Jonathan Cameron
2014-12-16 9:11 ` [PATCH 3/3] iio: frequency: Use usleep_range instead of msleep Roberta Dobrescu
2014-12-18 16:09 ` Lars-Peter Clausen
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=549361D1.8030101@gmx.de \
--to=knaack.h@gmx.de \
--cc=Michael.Hennerich@analog.com \
--cc=daniel.baluta@intel.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=octavian.purdila@intel.com \
--cc=pmeerw@pmeerw.net \
--cc=roberta.dobrescu@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 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).