From: Benjamin Tissoires Date: Mon, 3 Nov 2014 21:09:58 +0000 (-0500) Subject: HID: logitech-hidpp: fix negated returns X-Git-Tag: omap-for-v3.19/fixes-rc1~112^2^5~5 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c9952b26b2be25311706082598e5e176eb92748;p=pandora-kernel.git HID: logitech-hidpp: fix negated returns 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 Signed-off-by: Benjamin Tissoires Signed-off-by: Jiri Kosina --- Reading git-diff-tree failed