From: Jonathan Cameron <jic23@kernel.org>
To: Andrey Smirnov <andrew.smirnov@gmail.com>, linux-iio@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] IIO: si7020: Allocate correct amount of memory in devm_iio_device_alloc
Date: Sat, 14 Feb 2015 11:36:56 +0000 [thread overview]
Message-ID: <54DF3358.5070709@kernel.org> (raw)
In-Reply-To: <1423814321-15606-1-git-send-email-andrew.smirnov@gmail.com>
On 13/02/15 07:58, Andrey Smirnov wrote:
> Since only a pointer to struct i2c_client is stored in a private area
> of IIO device created by the driver there's no need to allocate
> sizeof(struct i2c_client) worth of storage.
>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Applied to the fixes-togreg branch of iio.git.
Marked for stable to make sure this confusion doesn't arise
again!
Jonathan
> ---
> drivers/iio/humidity/si7020.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/humidity/si7020.c b/drivers/iio/humidity/si7020.c
> index 69e49f5..fa3b809 100644
> --- a/drivers/iio/humidity/si7020.c
> +++ b/drivers/iio/humidity/si7020.c
> @@ -126,7 +126,7 @@ static int si7020_probe(struct i2c_client *client,
> /* Wait the maximum power-up time after software reset. */
> msleep(15);
>
> - indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*client));
> + indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data));
> if (!indio_dev)
> return -ENOMEM;
>
> --
> 2.1.0
>
prev parent reply other threads:[~2015-02-14 11:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-13 7:58 [PATCH] IIO: si7020: Allocate correct amount of memory in devm_iio_device_alloc Andrey Smirnov
2015-02-14 11:36 ` Jonathan Cameron [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=54DF3358.5070709@kernel.org \
--to=jic23@kernel.org \
--cc=andrew.smirnov@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).