From: Lars-Peter Clausen <lars@metafoo.de>
To: Axel Lin <axel.lin@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Michael Hennerich <michael.hennerich@analog.com>,
Jonathan Cameron <jic23@cam.ac.uk>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-iio@vger.kernel.org, devel@driverdev.osuosl.org
Subject: Re: [PATCH] staging:iio:dac: Fix kcalloc parameters swapped
Date: Sun, 12 Feb 2012 13:09:42 +0100 [thread overview]
Message-ID: <4F37AC06.1050909@metafoo.de> (raw)
In-Reply-To: <1328922048.2787.1.camel@phoenix>
On 02/11/2012 02:00 AM, Axel Lin wrote:
> The first parameter should be "number of elements" and the second parameter
> should be "element size".
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
> drivers/staging/iio/dac/ad5360.c | 4 ++--
> drivers/staging/iio/dac/ad5380.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/iio/dac/ad5360.c b/drivers/staging/iio/dac/ad5360.c
> index 710b256..cec3693 100644
> --- a/drivers/staging/iio/dac/ad5360.c
> +++ b/drivers/staging/iio/dac/ad5360.c
> @@ -439,8 +439,8 @@ static int __devinit ad5360_alloc_channels(struct iio_dev *indio_dev)
> struct iio_chan_spec *channels;
> unsigned int i;
>
> - channels = kcalloc(sizeof(struct iio_chan_spec),
> - st->chip_info->num_channels, GFP_KERNEL);
> + channels = kcalloc(st->chip_info->num_channels,
> + sizeof(struct iio_chan_spec), GFP_KERNEL);
>
> if (!channels)
> return -ENOMEM;
> diff --git a/drivers/staging/iio/dac/ad5380.c b/drivers/staging/iio/dac/ad5380.c
> index eff97ae0..4c50716 100644
> --- a/drivers/staging/iio/dac/ad5380.c
> +++ b/drivers/staging/iio/dac/ad5380.c
> @@ -363,8 +363,8 @@ static int __devinit ad5380_alloc_channels(struct iio_dev *indio_dev)
> struct iio_chan_spec *channels;
> unsigned int i;
>
> - channels = kcalloc(sizeof(struct iio_chan_spec),
> - st->chip_info->num_channels, GFP_KERNEL);
> + channels = kcalloc(st->chip_info->num_channels,
> + sizeof(struct iio_chan_spec), GFP_KERNEL);
>
> if (!channels)
> return -ENOMEM;
prev parent reply other threads:[~2012-02-12 12:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-11 1:00 [PATCH] staging:iio:dac: Fix kcalloc parameters swapped Axel Lin
2012-02-12 12:09 ` Lars-Peter Clausen [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=4F37AC06.1050909@metafoo.de \
--to=lars@metafoo.de \
--cc=axel.lin@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@cam.ac.uk \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.hennerich@analog.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).