lkml.org 
[lkml]   [2017]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 10/58] staging: comedi: ni_mio_common: fix M Series ni_ai_insn_read() data mask
    Date
    4.4-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Ian Abbott <abbotti@mev.co.uk>

    commit 655c4d442d1213b617926cc6d54e2a9a793fb46b upstream.

    For NI M Series cards, the Comedi `insn_read` handler for the AI
    subdevice is broken due to ANDing the value read from the AI FIFO data
    register with an incorrect mask. The incorrect mask clears all but the
    most significant bit of the sample data. It should preserve all the
    sample data bits. Correct it.

    Fixes: 817144ae7fda ("staging: comedi: ni_mio_common: remove unnecessary use of 'board->adbits'")
    Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/staging/comedi/drivers/ni_mio_common.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/staging/comedi/drivers/ni_mio_common.c
    +++ b/drivers/staging/comedi/drivers/ni_mio_common.c
    @@ -1929,7 +1929,7 @@ static int ni_ai_insn_read(struct comedi
    unsigned int *data)
    {
    struct ni_private *devpriv = dev->private;
    - unsigned int mask = (s->maxdata + 1) >> 1;
    + unsigned int mask = s->maxdata;
    int i, n;
    unsigned signbits;
    unsigned int d;

    \
     
     \ /
      Last update: 2017-01-06 23:14    [W:6.178 / U:0.016 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site