Re: [PATCH] PNP: fix unintended sign extension on left shifts

2019-10-18 Thread Rafael J. Wysocki
On Monday, October 14, 2019 3:16:08 PM CEST Colin King wrote: > From: Colin Ian King > > Shifting a u8 left will cause the value to be promoted to an integer. If > the top bit of the u8 is set then the following conversion to a 64 bit > resource_size_t will sign extend the value causing the

Re: [PATCH] PNP: fix unintended sign extension on left shifts

2019-10-16 Thread walter harms
Am 15.10.2019 18:29, schrieb Rafael J. Wysocki: > On 10/14/2019 3:16 PM, Colin King wrote: >> From: Colin Ian King >> >> Shifting a u8 left will cause the value to be promoted to an integer. If >> the top bit of the u8 is set then the following conversion to a 64 bit >> resource_size_t will

Re: [PATCH] PNP: fix unintended sign extension on left shifts

2019-10-15 Thread Rafael J. Wysocki
On 10/14/2019 3:16 PM, Colin King wrote: From: Colin Ian King Shifting a u8 left will cause the value to be promoted to an integer. If the top bit of the u8 is set then the following conversion to a 64 bit resource_size_t will sign extend the value causing the upper 32 bits to be set in the

[PATCH] PNP: fix unintended sign extension on left shifts

2019-10-14 Thread Colin King
From: Colin Ian King Shifting a u8 left will cause the value to be promoted to an integer. If the top bit of the u8 is set then the following conversion to a 64 bit resource_size_t will sign extend the value causing the upper 32 bits to be set in the result. Fix this by casting the u8 value to