diff options
author | Ian Abbott <abbotti@mev.co.uk> | 2013-08-23 13:45:03 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-26 13:41:56 (GMT) |
commit | 10b799d2fe7c004f204b833818486544080441d2 (patch) | |
tree | b7d52eb307af16fa66ceb1d42960a55fbf392fe7 /virt | |
parent | f59ebeda209306f10e33016b510996f54cc5248e (diff) | |
download | linux-fsl-qoriq-10b799d2fe7c004f204b833818486544080441d2.tar.xz |
staging: comedi: comedi_bond: don't map channels individually
The private data structure (`struct comedi_bond_private`) for the
overall "comedi_bond" device maps each channel individually to a pointer
to the `struct bonded_device` it belongs to via array member
`chan_id_dev_map[MAX_CHANS]`. This speeds up look-ups from channel
number to bonded device a bit, but the length of the array used to look
this up is currently fixed at `MAX_CHANS` (256) and there are no
overflow checks when filling the array.
In practice, there will only be a few bonded devices (actually bonded
subdevices) and it is practical to just skip through the list until we
reach the one containing the desired channel.
The only place where the bonded device is looked up from the channel
number is in `bonding_dio_insn_config()`. Change it to do the look-up
by skipping through the list of bonded devices and remove the
`chan_id_dev_map[]` member. The `chanid_offset` member of `struct
bonded_device` is also no longer needed as the value can be derived
while skipping through the list of bonded devices, so remove that member
as well.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions