lkml.org 
[lkml]   [2007]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 03/33] HID: zeroing of bytes in output fields is bogus
    -stable review patch.  If anyone has any objections, please let us know.

    ------------------
    From: Jiri Kosina <jkosina@suse.cz>

    HID: zeroing of bytes in output fields is bogus

    This patch removes bogus zeroing of unused bits in output reports,
    introduced in Simon's patch in commit d4ae650a.
    According to the specification, any sane device should not care
    about values of unused bits.

    What is worse, the zeroing is done in a way which is broken and
    might clear certain bits in output reports which are actually
    _used_ - a device that has multiple fields with one value of
    the size 1 bit each might serve as an example of why this is
    bogus - the second call of hid_output_report() would clear the
    first bit of report, which has already been set up previously.

    This patch will break LEDs on SpaceNavigator, because this device
    is broken and takes into account the bits which it shouldn't touch.
    The quirk for this particular device will be provided in a separate
    patch.

    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    drivers/hid/hid-core.c | 4 ----
    1 file changed, 4 deletions(-)

    --- a/drivers/hid/hid-core.c
    +++ b/drivers/hid/hid-core.c
    @@ -876,10 +876,6 @@ static void hid_output_field(struct hid_
    unsigned size = field->report_size;
    unsigned n;

    - /* make sure the unused bits in the last byte are zeros */
    - if (count > 0 && size > 0)
    - data[(count*size-1)/8] = 0;
    -
    for (n = 0; n < count; n++) {
    if (field->logical_minimum < 0) /* signed values */
    implement(data, offset + n * size, size, s32ton(field->value[n], size));
    --
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-04-26 19:17    [W:5.929 / U:0.264 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site