Skip to content

Commit

Permalink
staging: comedi: s626: add FIXME comment
Browse files Browse the repository at this point in the history
`s626_enc_insn_config()` is the `insn_config()` handler for a counter
subdevice.  The `data[0]` value is supposed to be one of the
`INSN_CONFIG_...` constants defined in "comedi.h" indicating the type of
configuration instruction, but this function seems to be using it as a
variable value to preload the counter with.  Various values of `data[0]`
are going to cause `check_insn_config_length()` in the comedi core
("comedi_fops.c") to return an error, and this function won't be called
in those cases.  Most other values will log a warning to the kernel log.

It's not entirely clear what constant should be checked for in
`data[0]`, so add a "FIXME" comment for now.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Sep 26, 2012
1 parent b655c2c commit affdc23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/staging/comedi/drivers/s626.c
Original file line number Diff line number Diff line change
Expand Up @@ -1804,6 +1804,9 @@ static int s626_dio_insn_config(struct comedi_device *dev,
/* Now this function initializes the value of the counter (data[0])
and set the subdevice. To complete with trigger and interrupt
configuration */
/* FIXME: data[0] is supposed to be an INSN_CONFIG_xxx constant indicating
* what is being configured, but this function appears to be using data[0]
* as a variable. */
static int s626_enc_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data)
Expand Down

0 comments on commit affdc23

Please sign in to comment.