lkml.org 
[lkml]   [2014]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] HID: logitech-hidpp: fix negated returns
On Mon, 3 Nov 2014, Benjamin Tissoires wrote:

> Reported by Dan Carpenter:
>
> drivers/hid/hid-logitech-hidpp.c:359 hidpp_root_get_protocol_version() warn: should this return really be negated?
> drivers/hid/hid-logitech-hidpp.c:398 hidpp_devicenametype_get_count() warn: should this return really be negated?
> drivers/hid/hid-logitech-hidpp.c:417 hidpp_devicenametype_get_device_name() warn: should this return really be negated?
> drivers/hid/hid-logitech-hidpp.c:524 hidpp_touchpad_get_raw_info() warn: should this return really be negated?
>
> The problem lies in hidpp_send_message_sync() which can return 2 types of
> errors depending of their sign. Adding a comment there to clarify what is
> happening.
>
> To solve that, print an error in case of a protocol problem, and raise
> -EPROTO instead.
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
> ---
>
> Changes in v2:
> - also return if the ret code is negative

Applied.

--
Jiri Kosina
SUSE Labs


\
 
 \ /
  Last update: 2014-11-04 11:21    [W:0.068 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site