From e9d1cf89ed5561adc1d36aea6d1349d12dfedd74 Mon Sep 17 00:00:00 2001 From: Ravishankar Date: Thu, 7 Jul 2011 19:53:04 +0530 Subject: [PATCH] Staging: comedi: fix brace coding style issue in serial2002.c This is a patch to the serial2002.c file that fixes up a brace warning found by the checkpatch.pl tool Signed-off-by: Ravishankar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/serial2002.c | 30 +++++++-------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c index 8041d8fb801d..ade2202b6231 100644 --- a/drivers/staging/comedi/drivers/serial2002.c +++ b/drivers/staging/comedi/drivers/serial2002.c @@ -513,9 +513,8 @@ static int serial_2002_open(struct comedi_device *dev) } break; } - if (sign) { + if (sign) min = -min; - } cur_config[channel].min = min; } @@ -554,9 +553,8 @@ static int serial_2002_open(struct comedi_device *dev) } break; } - if (sign) { + if (sign) max = -max; - } cur_config[channel].max = max; } @@ -619,9 +617,8 @@ static int serial_2002_open(struct comedi_device *dev) int j, chan; for (chan = 0, j = 0; j < 32; j++) { - if (c[j].kind == kind) { + if (c[j].kind == kind) chan++; - } } s = &dev->subdevices[i]; s->n_chan = chan; @@ -646,9 +643,8 @@ static int serial_2002_open(struct comedi_device *dev) } for (chan = 0, j = 0; j < 32; j++) { if (c[j].kind == kind) { - if (mapping) { + if (mapping) mapping[chan] = j; - } if (range) { range[j].length = 1; range[j].range.min = @@ -701,9 +697,8 @@ err_alloc_configs: static void serial_2002_close(struct comedi_device *dev) { - if (!IS_ERR(devpriv->tty) && (devpriv->tty != 0)) { + if (!IS_ERR(devpriv->tty) && (devpriv->tty != 0)) filp_close(devpriv->tty, 0); - } } static int serial2002_di_rinsn(struct comedi_device *dev, @@ -720,9 +715,8 @@ static int serial2002_di_rinsn(struct comedi_device *dev, poll_digital(devpriv->tty, chan); while (1) { read = serial_read(devpriv->tty, 1000); - if (read.kind != is_digital || read.index == chan) { + if (read.kind != is_digital || read.index == chan) break; - } } data[n] = read.value; } @@ -762,9 +756,8 @@ static int serial2002_ai_rinsn(struct comedi_device *dev, poll_channel(devpriv->tty, chan); while (1) { read = serial_read(devpriv->tty, 1000); - if (read.kind != is_channel || read.index == chan) { + if (read.kind != is_channel || read.index == chan) break; - } } data[n] = read.value; } @@ -798,9 +791,8 @@ static int serial2002_ao_rinsn(struct comedi_device *dev, int n; int chan = CR_CHAN(insn->chanspec); - for (n = 0; n < insn->n; n++) { + for (n = 0; n < insn->n; n++) data[n] = devpriv->ao_readback[chan]; - } return n; } @@ -819,9 +811,8 @@ static int serial2002_ei_rinsn(struct comedi_device *dev, poll_channel(devpriv->tty, chan); while (1) { read = serial_read(devpriv->tty, 1000); - if (read.kind != is_channel || read.index == chan) { + if (read.kind != is_channel || read.index == chan) break; - } } data[n] = read.value; } @@ -835,9 +826,8 @@ static int serial2002_attach(struct comedi_device *dev, printk("comedi%d: serial2002: ", dev->minor); dev->board_name = thisboard->name; - if (alloc_private(dev, sizeof(struct serial2002_private)) < 0) { + if (alloc_private(dev, sizeof(struct serial2002_private)) < 0) return -ENOMEM; - } dev->open = serial_2002_open; dev->close = serial_2002_close; devpriv->port = it->options[0]; -- 2.39.5