]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: comedi: sparse warning in insn_rw_emulate_bits()
authorIan Abbott <abbotti@mev.co.uk>
Tue, 18 Sep 2012 18:46:59 +0000 (19:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Sep 2012 10:26:12 +0000 (11:26 +0100)
`insn_rw_emulate_bits()` is used to emulate the `INSN_READ` and
`INSN_WRITE` comedi instructions for subdevices that don't have an
`insn_read()` or `insn_write()` handler but do have an `insn_bits()`
handler.

The function fills in a temporary `struct comedi_insn` called `new_insn`
to pass to the subdevice's `insn_bits()` handler.  In doing so, it sets
the `new_insn.data` pointer to point to a temporary data array.  This
results in a warning from "sparse" because the `data` pointer in `struct
comedi_insn` has the `__user` tag.  The subdevice's `insn_bits()`
handler ignores it anyway as it gets passed a pointer to the temporary
data array in a separate parameter.  Don't bother setting
`new_insn.data`; just leave it set to `NULL` (done by an earlier
`memset()`).

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers.c

index 2c21dbd89455361debf6979755921bb9fbef0df9..1db6bfdbf13bd70695492f3cabea51ca7a325e43 100644 (file)
@@ -415,7 +415,6 @@ static int insn_rw_emulate_bits(struct comedi_device *dev,
        new_insn.insn = INSN_BITS;
        new_insn.chanspec = base_bitfield_channel;
        new_insn.n = 2;
-       new_insn.data = new_data;
        new_insn.subdev = insn->subdev;
 
        if (insn->insn == INSN_WRITE) {