Re: [PATCH] staging:iio:dac: Fix kcalloc parameters swapped

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>

Acked-by: Lars-Peter Clausen <lars@xxxxxxxxxx>

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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux