RE: [PATCH 06/35] staging: comedi: adl_pci9118: sample types are unsigned

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

 



On Wednesday, October 16, 2013 6:40 AM, Ian Abbott wrote:
> Sample values in comedi are generally represented as unsigned values.
> Change the `ao_data[]` and `dmabuf_virt[]` members of `struct
> pci9118_private` and various local variables dealing with sample values
> to use `unsigned short` instead of `short` for consistency.
>
> Also remove the `short *ai_data` member of `struct pci9118_private` as
> it is only assigned to.
>
> Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
> ---
>  drivers/staging/comedi/drivers/adl_pci9118.c | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c
> index bd5c8bb..0f2e859 100644
> --- a/drivers/staging/comedi/drivers/adl_pci9118.c
> +++ b/drivers/staging/comedi/drivers/adl_pci9118.c
> @@ -352,12 +352,11 @@ struct pci9118_private {
>  						 * on external start
>  						 */
>  	unsigned int ai_data_len;
> -	short *ai_data;
> -	short ao_data[2];			/* data output buffer */
> +	unsigned short ao_data[2];		/* data output buffer */
>  	unsigned int ai_scans;			/* number of scans to do */
>  	char dma_doublebuf;			/* we can use double buffering */
>  	unsigned int dma_actbuf;		/* which buffer is used now */
> -	short *dmabuf_virt[2];			/*
> +	unsigned short *dmabuf_virt[2];			/*

Nit. Comment alignment is off.

[snip]

> @@ -1987,8 +1985,8 @@ static int pci9118_common_attach(struct comedi_device *dev, int disable_irq,
>  		for (i = 0; i < 2; i++) {
>  			for (pages = 4; pages >= 0; pages--) {
>  				devpriv->dmabuf_virt[i] =
> -				    (short *)__get_free_pages(GFP_KERNEL,
> -							      pages);
> +				    (unsigned short *)
> +				    __get_free_pages(GFP_KERNEL, pages);

Nit. Is the cast needed?

Regards,
Hartley

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-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