Re: [PATCH 16/17] staging: comedi: s526: remove struct s526GPCTConfig

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

 



On Wed, Sep 19, 2012 at 03:12:54PM -0700, H Hartley Sweeten wrote:
> +	case INSN_CONFIG_GPCT_PULSE_TRAIN_GENERATOR:
>  		/* data[0] contains the PULSE_WIDTH
>  		   data[1] contains the PULSE_PERIOD
>  		   @pre PULSE_PERIOD > PULSE_WIDTH > 0
>  		   The above periods must be expressed as a multiple of the
>  		   pulse frequency on the selected source
>  		 */
> -		if ((data[1] > data[0]) && (data[0] > 0)) {
> -			devpriv->s526_gpct_config[chan].data[0] = data[0];
> -			devpriv->s526_gpct_config[chan].data[1] = data[1];
> -		} else {
> +		if ((data[1] < data[0]) || !data[0])
                     ^^^^^^^^^^^^^^^^^
Should this be:
		if ((data[1] <= data[0] ...
That would match the original code better.

regards,
dan carpenter

>  			return -EINVAL;
> -		}
>  
>  		/* Fall thru to write the PULSE_WIDTH */
>  
> -	case PositionMeasurement:
> -	case SinglePulseGeneration:
> +	case INSN_CONFIG_GPCT_QUADRATURE_ENCODER:
> +	case INSN_CONFIG_GPCT_SINGLE_PULSE_GENERATOR:
>  		outw((data[0] >> 16) & 0xffff, chan_iobase + REG_C0H);
>  		outw(data[0] & 0xffff, chan_iobase + REG_C0L);
>  		break;

_______________________________________________
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