Re: [PATCH 059/112] staging: comedi: dyna_pci10xx: remove subdevice pointer math

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

 






> H Hartley Sweeten <hartleys@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> Convert the comedi_subdevice access from pointer math to array
> access.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> ---
>  drivers/staging/comedi/drivers/dyna_pci10xx.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/dyna_pci10xx.c 
> b/drivers/staging/comedi/drivers/dyna_pci10xx.c
> index 9d55aa9..6f612be 100644
> --- a/drivers/staging/comedi/drivers/dyna_pci10xx.c
> +++ b/drivers/staging/comedi/drivers/dyna_pci10xx.c
> @@ -208,7 +208,7 @@ static int dyna_pci10xx_attach_pci(struct 
> comedi_device *dev,
>  		return ret;
>  
>  	/* analog input */
> -	s = dev->subdevices + 0;
> +	s = &dev->subdevices[0];
>  	s->type = COMEDI_SUBD_AI;
>  	s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF;
>  	s->n_chan = 16;
> @@ -218,7 +218,7 @@ static int dyna_pci10xx_attach_pci(struct 
> comedi_device *dev,
>  	s->insn_read = dyna_pci10xx_insn_read_ai;
>  
>  	/* analog output */
> -	s = dev->subdevices + 1;
> +	s = &dev->subdevices[1];
>  	s->type = COMEDI_SUBD_AO;
>  	s->subdev_flags = SDF_WRITABLE;
>  	s->n_chan = 16;
> @@ -228,7 +228,7 @@ static int dyna_pci10xx_attach_pci(struct 
> comedi_device *dev,
>  	s->insn_write = dyna_pci10xx_insn_write_ao;
>  
>  	/* digital input */
> -	s = dev->subdevices + 2;
> +	s = &dev->subdevices[2];
>  	s->type = COMEDI_SUBD_DI;
>  	s->subdev_flags = SDF_READABLE | SDF_GROUND;
>  	s->n_chan = 16;
> @@ -238,7 +238,7 @@ static int dyna_pci10xx_attach_pci(struct 
> comedi_device *dev,
>  	s->insn_bits = dyna_pci10xx_di_insn_bits;
>  
>  	/* digital output */
> -	s = dev->subdevices + 3;
> +	s = &dev->subdevices[3];
>  	s->type = COMEDI_SUBD_DO;
>  	s->subdev_flags = SDF_WRITABLE | SDF_GROUND;
>  	s->n_chan = 16;
> -- 
> 1.7.11
> 
> _______________________________________________
> devel mailing list
> devel@xxxxxxxxxxxxxxxxxxxxxx
> http://driverdev.linuxdriverproject.org/mailman/listinfo/devel
_______________________________________________
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