Re: [PATCH] rtc: rtc-ds1672: fix unintended sign extension

2019-02-05 Thread Alexandre Belloni
On 05/02/2019 18:04:49+, Colin King wrote: > From: Colin Ian King > > Shifting a u8 by 24 will cause the value to be promoted to an integer. If > the top bit of the u8 is set then the following conversion to an unsigned > long will sign extend the value causing the upper 32 bits to be set in

[PATCH] rtc: rtc-ds1672: fix unintended sign extension

2019-02-05 Thread Colin King
From: Colin Ian King Shifting a u8 by 24 will cause the value to be promoted to an integer. If the top bit of the u8 is set then the following conversion to an unsigned long will sign extend the value causing the upper 32 bits to be set in the result. Fix this by casting the u8 value to an unsig