Re: [PATCH v2 4/4] staging: comedi: usbduxsigma: use comedi_offset_munge()

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

 



On Fri, Aug 14, 2015 at 11:34:07AM -0700, H Hartley Sweeten wrote:
> Use the comedi_offset_munge() helper to convert the hardware two's
> complement values to the offset binary format expected by comedi.
> 
> Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
> Cc: Ian Abbott <abbotti@xxxxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> ---
>  drivers/staging/comedi/drivers/usbduxsigma.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c
> index 8b4cafe..3e997f5 100644
> --- a/drivers/staging/comedi/drivers/usbduxsigma.c
> +++ b/drivers/staging/comedi/drivers/usbduxsigma.c
> @@ -230,8 +230,7 @@ static void usbduxsigma_ai_handle_urb(struct comedi_device *dev,
>  			for (i = 0; i < cmd->chanlist_len; i++) {
>  				val = be32_to_cpu(devpriv->in_buf[i + 1]);
>  				val &= 0x00ffffff; /* strip status byte */
> -				val ^= 0x00800000; /* convert to unsigned */
> -
> +				val = comedi_offset_munge(s, val);
>  				if (!comedi_buf_write_samples(s, &val, 1))
>  					return;
>  			}
> @@ -749,9 +748,7 @@ static int usbduxsigma_ai_insn_read(struct comedi_device *dev,
>  		val = be32_to_cpu(get_unaligned((__be32
>  						 *)(devpriv->insn_buf + 1)));
>  		val &= 0x00ffffff;	/* strip status byte */
> -		val ^= 0x00800000;	/* convert to unsigned */
> -
> -		data[i] = val;
> +		data[i] = comedi_offset_munge(s, val);;
This introduces new checkpatch warning about double semicolon.

regards
sudip
_______________________________________________
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