staging: comedi: amplc_pci230: don't begin line with binary operator
If an expression involving a binary operator needs to be split across two lines, put the split after the operator. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8b39e8e973
commit
76cb39e014
1 changed files with 43 additions and 43 deletions
|
@ -682,8 +682,8 @@ static int get_resources(struct comedi_device *dev, unsigned int res_mask,
|
||||||
} else if (devpriv->res_owner[i] != owner) {
|
} else if (devpriv->res_owner[i] != owner) {
|
||||||
for (b = 1, i = 0; claimed != 0; b <<= 1, i++) {
|
for (b = 1, i = 0; claimed != 0; b <<= 1, i++) {
|
||||||
if ((claimed & b) != 0) {
|
if ((claimed & b) != 0) {
|
||||||
devpriv->res_owner[i]
|
devpriv->res_owner[i] =
|
||||||
= OWNER_NONE;
|
OWNER_NONE;
|
||||||
claimed &= ~b;
|
claimed &= ~b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -884,8 +884,8 @@ static int pci230_ai_rinsn(struct comedi_device *dev,
|
||||||
gainshift = chan & ~1;
|
gainshift = chan & ~1;
|
||||||
adccon |= PCI230_ADC_IM_SE;
|
adccon |= PCI230_ADC_IM_SE;
|
||||||
}
|
}
|
||||||
devpriv->adcg = (devpriv->adcg & ~(3 << gainshift))
|
devpriv->adcg = (devpriv->adcg & ~(3 << gainshift)) |
|
||||||
| (pci230_ai_gain[range] << gainshift);
|
(pci230_ai_gain[range] << gainshift);
|
||||||
if (devpriv->ai_bipolar)
|
if (devpriv->ai_bipolar)
|
||||||
adccon |= PCI230_ADC_IR_BIP;
|
adccon |= PCI230_ADC_IR_BIP;
|
||||||
else
|
else
|
||||||
|
@ -1095,8 +1095,8 @@ static int pci230_ao_cmdtest(struct comedi_device *dev,
|
||||||
* The only flags allowed are CR_EDGE and CR_INVERT.
|
* The only flags allowed are CR_EDGE and CR_INVERT.
|
||||||
* The CR_EDGE flag is ignored.
|
* The CR_EDGE flag is ignored.
|
||||||
*/
|
*/
|
||||||
if ((cmd->scan_begin_arg
|
if ((cmd->scan_begin_arg &
|
||||||
& (CR_FLAGS_MASK & ~(CR_EDGE | CR_INVERT))) != 0) {
|
(CR_FLAGS_MASK & ~(CR_EDGE | CR_INVERT))) != 0) {
|
||||||
cmd->scan_begin_arg = COMBINE(cmd->scan_begin_arg, 0,
|
cmd->scan_begin_arg = COMBINE(cmd->scan_begin_arg, 0,
|
||||||
CR_FLAGS_MASK &
|
CR_FLAGS_MASK &
|
||||||
~(CR_EDGE | CR_INVERT));
|
~(CR_EDGE | CR_INVERT));
|
||||||
|
@ -1186,8 +1186,8 @@ static void pci230_ao_stop(struct comedi_device *dev,
|
||||||
* disable FIFO.
|
* disable FIFO.
|
||||||
*/
|
*/
|
||||||
devpriv->daccon &= PCI230_DAC_OR_MASK;
|
devpriv->daccon &= PCI230_DAC_OR_MASK;
|
||||||
outw(devpriv->daccon | PCI230P2_DAC_FIFO_RESET
|
outw(devpriv->daccon | PCI230P2_DAC_FIFO_RESET |
|
||||||
| PCI230P2_DAC_FIFO_UNDERRUN_CLEAR,
|
PCI230P2_DAC_FIFO_UNDERRUN_CLEAR,
|
||||||
dev->iobase + PCI230_DACCON);
|
dev->iobase + PCI230_DACCON);
|
||||||
}
|
}
|
||||||
/* Release resources. */
|
/* Release resources. */
|
||||||
|
@ -1307,10 +1307,10 @@ static int pci230_handle_ao_fifo(struct comedi_device *dev,
|
||||||
* to FIFO. Set FIFO interrupt trigger level
|
* to FIFO. Set FIFO interrupt trigger level
|
||||||
* to 'empty'.
|
* to 'empty'.
|
||||||
*/
|
*/
|
||||||
devpriv->daccon = (devpriv->daccon
|
devpriv->daccon =
|
||||||
&
|
(devpriv->daccon &
|
||||||
~PCI230P2_DAC_INT_FIFO_MASK)
|
~PCI230P2_DAC_INT_FIFO_MASK) |
|
||||||
| PCI230P2_DAC_INT_FIFO_EMPTY;
|
PCI230P2_DAC_INT_FIFO_EMPTY;
|
||||||
outw(devpriv->daccon,
|
outw(devpriv->daccon,
|
||||||
dev->iobase + PCI230_DACCON);
|
dev->iobase + PCI230_DACCON);
|
||||||
}
|
}
|
||||||
|
@ -1322,8 +1322,8 @@ static int pci230_handle_ao_fifo(struct comedi_device *dev,
|
||||||
events |= COMEDI_CB_OVERFLOW | COMEDI_CB_ERROR;
|
events |= COMEDI_CB_OVERFLOW | COMEDI_CB_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((events & (COMEDI_CB_EOA | COMEDI_CB_ERROR | COMEDI_CB_OVERFLOW))
|
if ((events &
|
||||||
!= 0) {
|
(COMEDI_CB_EOA | COMEDI_CB_ERROR | COMEDI_CB_OVERFLOW)) != 0) {
|
||||||
/* Stopping AO due to completion or error. */
|
/* Stopping AO due to completion or error. */
|
||||||
pci230_ao_stop(dev, s);
|
pci230_ao_stop(dev, s);
|
||||||
running = 0;
|
running = 0;
|
||||||
|
@ -1420,8 +1420,8 @@ static void pci230_ao_start(struct comedi_device *dev,
|
||||||
scantrig = PCI230P2_DAC_TRIG_NONE;
|
scantrig = PCI230P2_DAC_TRIG_NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
devpriv->daccon = (devpriv->daccon
|
devpriv->daccon =
|
||||||
& ~PCI230P2_DAC_TRIG_MASK) |
|
(devpriv->daccon & ~PCI230P2_DAC_TRIG_MASK) |
|
||||||
scantrig;
|
scantrig;
|
||||||
outw(devpriv->daccon, dev->iobase + PCI230_DACCON);
|
outw(devpriv->daccon, dev->iobase + PCI230_DACCON);
|
||||||
}
|
}
|
||||||
|
@ -1521,16 +1521,16 @@ static int pci230_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
|
||||||
*
|
*
|
||||||
* N.B. DAC FIFO interrupts are currently disabled.
|
* N.B. DAC FIFO interrupts are currently disabled.
|
||||||
*/
|
*/
|
||||||
daccon |= PCI230P2_DAC_FIFO_EN | PCI230P2_DAC_FIFO_RESET
|
daccon |= PCI230P2_DAC_FIFO_EN | PCI230P2_DAC_FIFO_RESET |
|
||||||
| PCI230P2_DAC_FIFO_UNDERRUN_CLEAR
|
PCI230P2_DAC_FIFO_UNDERRUN_CLEAR |
|
||||||
| PCI230P2_DAC_TRIG_NONE | PCI230P2_DAC_INT_FIFO_NHALF;
|
PCI230P2_DAC_TRIG_NONE | PCI230P2_DAC_INT_FIFO_NHALF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set DACCON. */
|
/* Set DACCON. */
|
||||||
outw(daccon, dev->iobase + PCI230_DACCON);
|
outw(daccon, dev->iobase + PCI230_DACCON);
|
||||||
/* Preserve most of DACCON apart from write-only, transient bits. */
|
/* Preserve most of DACCON apart from write-only, transient bits. */
|
||||||
devpriv->daccon = daccon
|
devpriv->daccon = daccon & ~(PCI230P2_DAC_FIFO_RESET |
|
||||||
& ~(PCI230P2_DAC_FIFO_RESET | PCI230P2_DAC_FIFO_UNDERRUN_CLEAR);
|
PCI230P2_DAC_FIFO_UNDERRUN_CLEAR);
|
||||||
|
|
||||||
if (cmd->scan_begin_src == TRIG_TIMER) {
|
if (cmd->scan_begin_src == TRIG_TIMER) {
|
||||||
/*
|
/*
|
||||||
|
@ -1797,8 +1797,8 @@ static int pci230_ai_cmdtest(struct comedi_device *dev,
|
||||||
* The only flags allowed are CR_INVERT and CR_EDGE.
|
* The only flags allowed are CR_INVERT and CR_EDGE.
|
||||||
* CR_EDGE is required.
|
* CR_EDGE is required.
|
||||||
*/
|
*/
|
||||||
if ((cmd->convert_arg & (CR_FLAGS_MASK & ~CR_INVERT))
|
if ((cmd->convert_arg &
|
||||||
!= CR_EDGE) {
|
(CR_FLAGS_MASK & ~CR_INVERT)) != CR_EDGE) {
|
||||||
/* Set CR_EDGE, preserve CR_INVERT. */
|
/* Set CR_EDGE, preserve CR_INVERT. */
|
||||||
cmd->convert_arg = COMBINE(cmd->start_arg,
|
cmd->convert_arg = COMBINE(cmd->start_arg,
|
||||||
(CR_EDGE | 0),
|
(CR_EDGE | 0),
|
||||||
|
@ -1907,8 +1907,8 @@ static void pci230_ai_update_fifo_trigger_level(struct comedi_device *dev,
|
||||||
scanlen >= PCI230_ADC_FIFOLEVEL_HALFFULL) {
|
scanlen >= PCI230_ADC_FIFOLEVEL_HALFFULL) {
|
||||||
wake = PCI230_ADC_FIFOLEVEL_HALFFULL;
|
wake = PCI230_ADC_FIFOLEVEL_HALFFULL;
|
||||||
} else {
|
} else {
|
||||||
wake = (devpriv->ai_scan_count * scanlen)
|
wake = (devpriv->ai_scan_count * scanlen) -
|
||||||
- devpriv->ai_scan_pos;
|
devpriv->ai_scan_pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (wake >= PCI230_ADC_FIFOLEVEL_HALFFULL) {
|
if (wake >= PCI230_ADC_FIFOLEVEL_HALFFULL) {
|
||||||
|
@ -2043,8 +2043,8 @@ static void pci230_ai_stop(struct comedi_device *dev,
|
||||||
* Reset FIFO, disable FIFO and set start conversion source to none.
|
* Reset FIFO, disable FIFO and set start conversion source to none.
|
||||||
* Keep se/diff and bip/uni settings.
|
* Keep se/diff and bip/uni settings.
|
||||||
*/
|
*/
|
||||||
devpriv->adccon = (devpriv->adccon & (PCI230_ADC_IR_MASK
|
devpriv->adccon =
|
||||||
| PCI230_ADC_IM_MASK)) |
|
(devpriv->adccon & (PCI230_ADC_IR_MASK | PCI230_ADC_IM_MASK)) |
|
||||||
PCI230_ADC_TRIG_NONE;
|
PCI230_ADC_TRIG_NONE;
|
||||||
outw(devpriv->adccon | PCI230_ADC_FIFO_RESET,
|
outw(devpriv->adccon | PCI230_ADC_FIFO_RESET,
|
||||||
dev->iobase + PCI230_ADCCON);
|
dev->iobase + PCI230_ADCCON);
|
||||||
|
@ -2115,8 +2115,8 @@ static void pci230_ai_start(struct comedi_device *dev,
|
||||||
conv = PCI230_ADC_TRIG_Z2CT2;
|
conv = PCI230_ADC_TRIG_Z2CT2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
devpriv->adccon = (devpriv->adccon & ~PCI230_ADC_TRIG_MASK)
|
devpriv->adccon =
|
||||||
| conv;
|
(devpriv->adccon & ~PCI230_ADC_TRIG_MASK) | conv;
|
||||||
outw(devpriv->adccon, dev->iobase + PCI230_ADCCON);
|
outw(devpriv->adccon, dev->iobase + PCI230_ADCCON);
|
||||||
if (cmd->convert_src == TRIG_INT)
|
if (cmd->convert_src == TRIG_INT)
|
||||||
async->inttrig = pci230_ai_inttrig_convert;
|
async->inttrig = pci230_ai_inttrig_convert;
|
||||||
|
@ -2187,8 +2187,8 @@ static void pci230_ai_start(struct comedi_device *dev,
|
||||||
* gated on to start counting.
|
* gated on to start counting.
|
||||||
*/
|
*/
|
||||||
zgat = GAT_CONFIG(1, GAT_VCC);
|
zgat = GAT_CONFIG(1, GAT_VCC);
|
||||||
outb(zgat, devpriv->iobase1
|
outb(zgat, devpriv->iobase1 +
|
||||||
+ PCI230_ZGAT_SCE);
|
PCI230_ZGAT_SCE);
|
||||||
break;
|
break;
|
||||||
case TRIG_INT:
|
case TRIG_INT:
|
||||||
async->inttrig =
|
async->inttrig =
|
||||||
|
@ -2240,8 +2240,8 @@ static void pci230_handle_ai(struct comedi_device *dev,
|
||||||
(scanlen > PCI230_ADC_FIFOLEVEL_HALFFULL)) {
|
(scanlen > PCI230_ADC_FIFOLEVEL_HALFFULL)) {
|
||||||
todo = PCI230_ADC_FIFOLEVEL_HALFFULL;
|
todo = PCI230_ADC_FIFOLEVEL_HALFFULL;
|
||||||
} else {
|
} else {
|
||||||
todo = (devpriv->ai_scan_count * scanlen)
|
todo = (devpriv->ai_scan_count * scanlen) -
|
||||||
- devpriv->ai_scan_pos;
|
devpriv->ai_scan_pos;
|
||||||
if (todo > PCI230_ADC_FIFOLEVEL_HALFFULL)
|
if (todo > PCI230_ADC_FIFOLEVEL_HALFFULL)
|
||||||
todo = PCI230_ADC_FIFOLEVEL_HALFFULL;
|
todo = PCI230_ADC_FIFOLEVEL_HALFFULL;
|
||||||
}
|
}
|
||||||
|
@ -2270,8 +2270,8 @@ static void pci230_handle_ai(struct comedi_device *dev,
|
||||||
/* FIFO not empty. */
|
/* FIFO not empty. */
|
||||||
if (devpriv->hwver > 0) {
|
if (devpriv->hwver > 0) {
|
||||||
/* Read PCI230+/260+ ADC FIFO level. */
|
/* Read PCI230+/260+ ADC FIFO level. */
|
||||||
fifoamount = inw(dev->iobase
|
fifoamount =
|
||||||
+ PCI230P_ADCFFLEV);
|
inw(dev->iobase + PCI230P_ADCFFLEV);
|
||||||
if (fifoamount == 0) {
|
if (fifoamount == 0) {
|
||||||
/* Shouldn't happen. */
|
/* Shouldn't happen. */
|
||||||
break;
|
break;
|
||||||
|
@ -2417,8 +2417,8 @@ static int pci230_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
|
||||||
gainshift = (chan & ~1);
|
gainshift = (chan & ~1);
|
||||||
adcen |= 1 << chan;
|
adcen |= 1 << chan;
|
||||||
}
|
}
|
||||||
devpriv->adcg = (devpriv->adcg & ~(3 << gainshift))
|
devpriv->adcg = (devpriv->adcg & ~(3 << gainshift)) |
|
||||||
| (pci230_ai_gain[range] << gainshift);
|
(pci230_ai_gain[range] << gainshift);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set channel scan list. */
|
/* Set channel scan list. */
|
||||||
|
@ -2490,8 +2490,8 @@ static int pci230_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
|
||||||
zgat = GAT_CONFIG(0, GAT_VCC);
|
zgat = GAT_CONFIG(0, GAT_VCC);
|
||||||
outb(zgat, devpriv->iobase1 + PCI230_ZGAT_SCE);
|
outb(zgat, devpriv->iobase1 + PCI230_ZGAT_SCE);
|
||||||
pci230_ct_setup_ns_mode(dev, 0, I8254_MODE1,
|
pci230_ct_setup_ns_mode(dev, 0, I8254_MODE1,
|
||||||
((uint64_t) cmd->convert_arg
|
((uint64_t)cmd->convert_arg *
|
||||||
* cmd->scan_end_arg),
|
cmd->scan_end_arg),
|
||||||
TRIG_ROUND_UP);
|
TRIG_ROUND_UP);
|
||||||
if (cmd->scan_begin_src == TRIG_TIMER) {
|
if (cmd->scan_begin_src == TRIG_TIMER) {
|
||||||
/*
|
/*
|
||||||
|
@ -2746,8 +2746,8 @@ static int pci230_attach_common(struct comedi_device *dev,
|
||||||
* Temporarily enable DAC FIFO, reset it and disable
|
* Temporarily enable DAC FIFO, reset it and disable
|
||||||
* FIFO wraparound.
|
* FIFO wraparound.
|
||||||
*/
|
*/
|
||||||
outw(devpriv->daccon | PCI230P2_DAC_FIFO_EN
|
outw(devpriv->daccon | PCI230P2_DAC_FIFO_EN |
|
||||||
| PCI230P2_DAC_FIFO_RESET,
|
PCI230P2_DAC_FIFO_RESET,
|
||||||
dev->iobase + PCI230_DACCON);
|
dev->iobase + PCI230_DACCON);
|
||||||
/* Clear DAC FIFO channel enable register. */
|
/* Clear DAC FIFO channel enable register. */
|
||||||
outw(0, dev->iobase + PCI230P2_DACEN);
|
outw(0, dev->iobase + PCI230P2_DACEN);
|
||||||
|
@ -2759,8 +2759,8 @@ static int pci230_attach_common(struct comedi_device *dev,
|
||||||
outb(0, devpriv->iobase1 + PCI230_INT_SCE);
|
outb(0, devpriv->iobase1 + PCI230_INT_SCE);
|
||||||
/* Set ADC to a reasonable state. */
|
/* Set ADC to a reasonable state. */
|
||||||
devpriv->adcg = 0;
|
devpriv->adcg = 0;
|
||||||
devpriv->adccon = PCI230_ADC_TRIG_NONE | PCI230_ADC_IM_SE
|
devpriv->adccon = PCI230_ADC_TRIG_NONE | PCI230_ADC_IM_SE |
|
||||||
| PCI230_ADC_IR_BIP;
|
PCI230_ADC_IR_BIP;
|
||||||
outw(1 << 0, dev->iobase + PCI230_ADCEN);
|
outw(1 << 0, dev->iobase + PCI230_ADCEN);
|
||||||
outw(devpriv->adcg, dev->iobase + PCI230_ADCG);
|
outw(devpriv->adcg, dev->iobase + PCI230_ADCG);
|
||||||
outw(devpriv->adccon | PCI230_ADC_FIFO_RESET,
|
outw(devpriv->adccon | PCI230_ADC_FIFO_RESET,
|
||||||
|
|
Loading…
Add table
Reference in a new issue