Commit 6ac986d0 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: drivers/*.c: add missing braces {} to if/else branches

According to the CodingStyle, braces should  be used on all branches
if thet are used on any branch,
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c8f4b98f
...@@ -1508,8 +1508,9 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev, ...@@ -1508,8 +1508,9 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev,
dac08_write(dev, s->maxdata / 2); dac08_write(dev, s->maxdata / 2);
s->readback[i] = s->maxdata / 2; s->readback[i] = s->maxdata / 2;
} }
} else } else {
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
}
/* make sure mailbox 4 is empty */ /* make sure mailbox 4 is empty */
inl(devpriv->s5933_config + AMCC_OP_REG_IMB4); inl(devpriv->s5933_config + AMCC_OP_REG_IMB4);
......
...@@ -2630,8 +2630,9 @@ static int ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -2630,8 +2630,9 @@ static int ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
bits |= ADC_START_TRIG_EXT_BITS; bits |= ADC_START_TRIG_EXT_BITS;
if (cmd->start_arg & CR_INVERT) if (cmd->start_arg & CR_INVERT)
bits |= ADC_START_TRIG_FALLING_BIT; bits |= ADC_START_TRIG_FALLING_BIT;
} else if (cmd->start_src == TRIG_NOW) } else if (cmd->start_src == TRIG_NOW) {
bits |= ADC_START_TRIG_SOFT_BITS; bits |= ADC_START_TRIG_SOFT_BITS;
}
if (use_hw_sample_counter(cmd)) if (use_hw_sample_counter(cmd))
bits |= ADC_SAMPLE_COUNTER_EN_BIT; bits |= ADC_SAMPLE_COUNTER_EN_BIT;
writew(bits, devpriv->main_iobase + ADC_CONTROL0_REG); writew(bits, devpriv->main_iobase + ADC_CONTROL0_REG);
...@@ -2820,8 +2821,9 @@ static void handle_ai_interrupt(struct comedi_device *dev, ...@@ -2820,8 +2821,9 @@ static void handle_ai_interrupt(struct comedi_device *dev,
if (devpriv->ai_cmd_running) { if (devpriv->ai_cmd_running) {
spin_unlock_irqrestore(&dev->spinlock, flags); spin_unlock_irqrestore(&dev->spinlock, flags);
pio_drain_ai_fifo(dev); pio_drain_ai_fifo(dev);
} else } else {
spin_unlock_irqrestore(&dev->spinlock, flags); spin_unlock_irqrestore(&dev->spinlock, flags);
}
} }
/* if we are have all the data, then quit */ /* if we are have all the data, then quit */
if ((cmd->stop_src == TRIG_COUNT && if ((cmd->stop_src == TRIG_COUNT &&
...@@ -3810,8 +3812,9 @@ static int setup_subdevices(struct comedi_device *dev) ...@@ -3810,8 +3812,9 @@ static int setup_subdevices(struct comedi_device *dev)
s->maxdata = 1; s->maxdata = 1;
s->range_table = &range_digital; s->range_table = &range_digital;
s->insn_bits = di_rbits; s->insn_bits = di_rbits;
} else } else {
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
}
/* digital output */ /* digital output */
if (thisboard->layout == LAYOUT_64XX) { if (thisboard->layout == LAYOUT_64XX) {
...@@ -3822,8 +3825,9 @@ static int setup_subdevices(struct comedi_device *dev) ...@@ -3822,8 +3825,9 @@ static int setup_subdevices(struct comedi_device *dev)
s->maxdata = 1; s->maxdata = 1;
s->range_table = &range_digital; s->range_table = &range_digital;
s->insn_bits = do_wbits; s->insn_bits = do_wbits;
} else } else {
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
}
/* 8255 */ /* 8255 */
s = &dev->subdevices[4]; s = &dev->subdevices[4];
...@@ -3851,8 +3855,9 @@ static int setup_subdevices(struct comedi_device *dev) ...@@ -3851,8 +3855,9 @@ static int setup_subdevices(struct comedi_device *dev)
s->range_table = &range_digital; s->range_table = &range_digital;
s->insn_config = dio_60xx_config_insn; s->insn_config = dio_60xx_config_insn;
s->insn_bits = dio_60xx_wbits; s->insn_bits = dio_60xx_wbits;
} else } else {
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
}
/* caldac */ /* caldac */
s = &dev->subdevices[6]; s = &dev->subdevices[6];
...@@ -3891,8 +3896,9 @@ static int setup_subdevices(struct comedi_device *dev) ...@@ -3891,8 +3896,9 @@ static int setup_subdevices(struct comedi_device *dev)
ad8402_write(dev, i, s->maxdata / 2); ad8402_write(dev, i, s->maxdata / 2);
s->readback[i] = s->maxdata / 2; s->readback[i] = s->maxdata / 2;
} }
} else } else {
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
}
/* serial EEPROM, if present */ /* serial EEPROM, if present */
s = &dev->subdevices[8]; s = &dev->subdevices[8];
...@@ -3902,8 +3908,9 @@ static int setup_subdevices(struct comedi_device *dev) ...@@ -3902,8 +3908,9 @@ static int setup_subdevices(struct comedi_device *dev)
s->n_chan = 128; s->n_chan = 128;
s->maxdata = 0xffff; s->maxdata = 0xffff;
s->insn_read = eeprom_read_insn; s->insn_read = eeprom_read_insn;
} else } else {
s->type = COMEDI_SUBD_UNUSED; s->type = COMEDI_SUBD_UNUSED;
}
/* user counter subd XXX */ /* user counter subd XXX */
s = &dev->subdevices[9]; s = &dev->subdevices[9];
......
...@@ -1700,8 +1700,9 @@ static int ni_ao_setup_MITE_dma(struct comedi_device *dev) ...@@ -1700,8 +1700,9 @@ static int ni_ao_setup_MITE_dma(struct comedi_device *dev)
mite_prep_dma(devpriv->ao_mite_chan, 16, 32); mite_prep_dma(devpriv->ao_mite_chan, 16, 32);
} }
mite_dma_arm(devpriv->ao_mite_chan); mite_dma_arm(devpriv->ao_mite_chan);
} else } else {
retval = -EIO; retval = -EIO;
}
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
return retval; return retval;
...@@ -4961,8 +4962,9 @@ static int ni_set_master_clock(struct comedi_device *dev, ...@@ -4961,8 +4962,9 @@ static int ni_set_master_clock(struct comedi_device *dev,
} }
devpriv->clock_ns = period_ns; devpriv->clock_ns = period_ns;
devpriv->clock_source = source; devpriv->clock_source = source;
} else } else {
return -EINVAL; return -EINVAL;
}
} }
} }
return 3; return 3;
......
...@@ -354,8 +354,9 @@ static int setup_mite_dma(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -354,8 +354,9 @@ static int setup_mite_dma(struct comedi_device *dev, struct comedi_subdevice *s)
if (devpriv->di_mite_chan) { if (devpriv->di_mite_chan) {
mite_prep_dma(devpriv->di_mite_chan, 32, 32); mite_prep_dma(devpriv->di_mite_chan, 32, 32);
mite_dma_arm(devpriv->di_mite_chan); mite_dma_arm(devpriv->di_mite_chan);
} else } else {
retval = -EIO; retval = -EIO;
}
spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags); spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
return retval; return retval;
......
...@@ -411,8 +411,9 @@ static int __unioxx5_subdev_init(struct comedi_device *dev, ...@@ -411,8 +411,9 @@ static int __unioxx5_subdev_init(struct comedi_device *dev,
if (ndef_flag) { if (ndef_flag) {
usp->usp_module_type[i] = 0; usp->usp_module_type[i] = 0;
ndef_flag = 0; ndef_flag = 0;
} else } else {
usp->usp_module_type[i] = inb(iobase + 6); usp->usp_module_type[i] = inb(iobase + 6);
}
udelay(1); udelay(1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment