Re: [PATCH 1/1] HID: clamp input to logical range if no null state

2017-03-13 Thread Benjamin Tissoires
On Mar 12 2017 or thereabouts, Tomasz Kramkowski wrote: > On Thu, Mar 09, 2017 at 09:16:06AM +0100, Benjamin Tissoires wrote: > > We have a "clamp()" function in the kernel that does the job directly > > and which is more readable. Also, this makes testing the out of range > > values twice. > > >

Re: [PATCH 1/1] HID: clamp input to logical range if no null state

2017-03-13 Thread Benjamin Tissoires
On Mar 12 2017 or thereabouts, Tomasz Kramkowski wrote: > On Thu, Mar 09, 2017 at 09:16:06AM +0100, Benjamin Tissoires wrote: > > We have a "clamp()" function in the kernel that does the job directly > > and which is more readable. Also, this makes testing the out of range > > values twice. > > >

Re: [PATCH 1/1] HID: clamp input to logical range if no null state

2017-03-12 Thread Tomasz Kramkowski
On Thu, Mar 09, 2017 at 09:16:06AM +0100, Benjamin Tissoires wrote: > We have a "clamp()" function in the kernel that does the job directly > and which is more readable. Also, this makes testing the out of range > values twice. > > How about: > > diff --git a/drivers/hid/hid-input.c

Re: [PATCH 1/1] HID: clamp input to logical range if no null state

2017-03-12 Thread Tomasz Kramkowski
On Thu, Mar 09, 2017 at 09:16:06AM +0100, Benjamin Tissoires wrote: > We have a "clamp()" function in the kernel that does the job directly > and which is more readable. Also, this makes testing the out of range > values twice. > > How about: > > diff --git a/drivers/hid/hid-input.c

Re: [PATCH 1/1] HID: clamp input to logical range if no null state

2017-03-09 Thread Benjamin Tissoires
On Mar 08 2017 or thereabouts, Tomasz Kramkowski wrote: > This patch fixes an issue in drivers/hid/hid-input.c where values > outside of the logical range are not clamped when "null state" bit of > the input control is not set. > > This was discussed on the lists [1] and this change stems from

Re: [PATCH 1/1] HID: clamp input to logical range if no null state

2017-03-09 Thread Benjamin Tissoires
On Mar 08 2017 or thereabouts, Tomasz Kramkowski wrote: > This patch fixes an issue in drivers/hid/hid-input.c where values > outside of the logical range are not clamped when "null state" bit of > the input control is not set. > > This was discussed on the lists [1] and this change stems from

[PATCH 1/1] HID: clamp input to logical range if no null state

2017-03-08 Thread Tomasz Kramkowski
This patch fixes an issue in drivers/hid/hid-input.c where values outside of the logical range are not clamped when "null state" bit of the input control is not set. This was discussed on the lists [1] and this change stems from the fact due to the ambiguity of the HID specification it might be

[PATCH 1/1] HID: clamp input to logical range if no null state

2017-03-08 Thread Tomasz Kramkowski
This patch fixes an issue in drivers/hid/hid-input.c where values outside of the logical range are not clamped when "null state" bit of the input control is not set. This was discussed on the lists [1] and this change stems from the fact due to the ambiguity of the HID specification it might be