diff options
author | Bill Pemberton <wfp5p@virginia.edu> | 2009-03-17 02:04:23 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-04-03 21:53:54 (GMT) |
commit | 82675f3547ba2a0732beabd9bb4393535f74408c (patch) | |
tree | 91142ea65d09dfad30643af5988d0a46ed89f23c /drivers/staging/comedi/kcomedilib | |
parent | dedd1325f1d53e2a2604457c4b3af9e62dde5001 (diff) | |
download | linux-fsl-qoriq-82675f3547ba2a0732beabd9bb4393535f74408c.tar.xz |
Staging: comedi: Remove curly braces where they are not needed
Changes as suggested by checkpatch.pl.
Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/comedi/kcomedilib')
-rw-r--r-- | drivers/staging/comedi/kcomedilib/get.c | 4 | ||||
-rw-r--r-- | drivers/staging/comedi/kcomedilib/kcomedilib_main.c | 35 |
2 files changed, 19 insertions, 20 deletions
diff --git a/drivers/staging/comedi/kcomedilib/get.c b/drivers/staging/comedi/kcomedilib/get.c index 7817337..36778b3 100644 --- a/drivers/staging/comedi/kcomedilib/get.c +++ b/drivers/staging/comedi/kcomedilib/get.c @@ -160,9 +160,9 @@ int comedi_get_krange(comedi_t *d, unsigned int subdevice, unsigned int chan, } else { lr = s->range_table; } - if (range >= lr->length) { + if (range >= lr->length) return -EINVAL; - } + memcpy(krange, lr->range + range, sizeof(comedi_krange)); return 0; diff --git a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c index 94a5067..7818e39 100644 --- a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c +++ b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c @@ -331,9 +331,9 @@ int comedi_lock(comedi_t *d, unsigned int subdevice) unsigned long flags; int ret = 0; - if (subdevice >= dev->n_subdevices) { + if (subdevice >= dev->n_subdevices) return -EINVAL; - } + s = dev->subdevices + subdevice; comedi_spin_lock_irqsave(&s->spin_lock, flags); @@ -375,9 +375,9 @@ int comedi_unlock(comedi_t *d, unsigned int subdevice) comedi_async *async; int ret; - if (subdevice >= dev->n_subdevices) { + if (subdevice >= dev->n_subdevices) return -EINVAL; - } + s = dev->subdevices + subdevice; async = s->async; @@ -425,9 +425,9 @@ int comedi_cancel(comedi_t *d, unsigned int subdevice) comedi_subdevice *s; int ret = 0; - if (subdevice >= dev->n_subdevices) { + if (subdevice >= dev->n_subdevices) return -EINVAL; - } + s = dev->subdevices + subdevice; if (s->lock && s->lock != d) @@ -450,9 +450,9 @@ int comedi_cancel(comedi_t *d, unsigned int subdevice) return ret; #ifdef CONFIG_COMEDI_RT - if (comedi_get_subdevice_runflags(s) & SRF_RT) { + if (comedi_get_subdevice_runflags(s) & SRF_RT) comedi_switch_to_non_rt(dev); - } + #endif comedi_set_subdevice_runflags(s, SRF_RUNNING | SRF_RT, 0); s->async->inttrig = NULL; @@ -471,9 +471,9 @@ int comedi_register_callback(comedi_t *d, unsigned int subdevice, comedi_subdevice *s; comedi_async *async; - if (subdevice >= dev->n_subdevices) { + if (subdevice >= dev->n_subdevices) return -EINVAL; - } + s = dev->subdevices + subdevice; async = s->async; @@ -507,9 +507,9 @@ int comedi_poll(comedi_t *d, unsigned int subdevice) comedi_subdevice *s = dev->subdevices; comedi_async *async; - if (subdevice >= dev->n_subdevices) { + if (subdevice >= dev->n_subdevices) return -EINVAL; - } + s = dev->subdevices + subdevice; async = s->async; @@ -533,17 +533,16 @@ int comedi_map(comedi_t *d, unsigned int subdevice, void *ptr) comedi_device *dev = (comedi_device *) d; comedi_subdevice *s; - if (subdevice >= dev->n_subdevices) { + if (subdevice >= dev->n_subdevices) return -EINVAL; - } + s = dev->subdevices + subdevice; if (!s->async) return -EINVAL; - if (ptr) { + if (ptr) *((void **)ptr) = s->async->prealloc_buf; - } /* XXX no reference counting */ @@ -556,9 +555,9 @@ int comedi_unmap(comedi_t *d, unsigned int subdevice) comedi_device *dev = (comedi_device *) d; comedi_subdevice *s; - if (subdevice >= dev->n_subdevices) { + if (subdevice >= dev->n_subdevices) return -EINVAL; - } + s = dev->subdevices + subdevice; if (!s->async) |