linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging:iio:dac: Fix kcalloc parameters swapped
@ 2012-02-11  1:00 Axel Lin
  2012-02-12 12:09 ` Lars-Peter Clausen
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-02-11  1:00 UTC (permalink / raw)
  To: linux-kernel
  Cc: Michael Hennerich, Jonathan Cameron, Greg Kroah-Hartman,
	Lars-Peter Clausen, linux-iio, devel

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>
---
 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;
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging:iio:dac: Fix kcalloc parameters swapped
  2012-02-11  1:00 [PATCH] staging:iio:dac: Fix kcalloc parameters swapped Axel Lin
@ 2012-02-12 12:09 ` Lars-Peter Clausen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars-Peter Clausen @ 2012-02-12 12:09 UTC (permalink / raw)
  To: Axel Lin
  Cc: linux-kernel, Michael Hennerich, Jonathan Cameron,
	Greg Kroah-Hartman, linux-iio, devel

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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-12 12:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-11  1:00 [PATCH] staging:iio:dac: Fix kcalloc parameters swapped Axel Lin
2012-02-12 12:09 ` Lars-Peter Clausen

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).