Re: [PATCH][next] hwmon: corsair-psu: fix unintentional sign extension issue

2020-11-07 Thread Guenter Roeck
On Thu, Nov 05, 2020 at 11:50:19AM +, Colin King wrote: > From: Colin Ian King > > The shifting of the u8 integer data[3] by 24 bits to the left will > be promoted to a 32 bit signed int and then sign-extended to a > long. In the event that the top bit of data[3] is set then all > then all

Re: [PATCH][next] hwmon: corsair-psu: fix unintentional sign extension issue

2020-11-05 Thread Wilken Gottwalt
On Thu, 5 Nov 2020 06:15:49 -0800 Guenter Roeck wrote: > On Thu, Nov 05, 2020 at 01:32:33PM +0100, Wilken Gottwalt wrote: > > On Thu, 5 Nov 2020 11:50:19 + > > Colin King wrote: > > > > > From: Colin Ian King > > > > > > The shifting of the u8 integer data[3] by 24 bits to the left will

Re: [PATCH][next] hwmon: corsair-psu: fix unintentional sign extension issue

2020-11-05 Thread Guenter Roeck
On Thu, Nov 05, 2020 at 01:32:33PM +0100, Wilken Gottwalt wrote: > On Thu, 5 Nov 2020 11:50:19 + > Colin King wrote: > > > From: Colin Ian King > > > > The shifting of the u8 integer data[3] by 24 bits to the left will > > be promoted to a 32 bit signed int and then sign-extended to a > >

Re: [PATCH][next] hwmon: corsair-psu: fix unintentional sign extension issue

2020-11-05 Thread Colin Ian King
On 05/11/2020 12:32, Wilken Gottwalt wrote: > On Thu, 5 Nov 2020 11:50:19 + > Colin King wrote: > >> From: Colin Ian King >> >> The shifting of the u8 integer data[3] by 24 bits to the left will >> be promoted to a 32 bit signed int and then sign-extended to a >> long. In the event that

Re: [PATCH][next] hwmon: corsair-psu: fix unintentional sign extension issue

2020-11-05 Thread Wilken Gottwalt
On Thu, 5 Nov 2020 11:50:19 + Colin King wrote: > From: Colin Ian King > > The shifting of the u8 integer data[3] by 24 bits to the left will > be promoted to a 32 bit signed int and then sign-extended to a > long. In the event that the top bit of data[3] is set then all > then all the

[PATCH][next] hwmon: corsair-psu: fix unintentional sign extension issue

2020-11-05 Thread Colin King
From: Colin Ian King The shifting of the u8 integer data[3] by 24 bits to the left will be promoted to a 32 bit signed int and then sign-extended to a long. In the event that the top bit of data[3] is set then all then all the upper 32 bits of a 64 bit long end up as also being set because of