Re: [PATCH][next] nvmem: core: Fix unintentional sign extension issue

2021-03-11 Thread Srinivas Kandagatla
On 11/03/2021 09:53, Colin King wrote: From: Colin Ian King The shifting of the u8 integer buf[3] by 24 bits to the left will be promoted to a 32 bit signed int and then sign-extended to a u64. In the event that the top bit of buf[3] is set then all then all the upper 32 bits of the u64 end

Re: [PATCH][next] nvmem: core: Fix unintentional sign extension issue

2021-03-11 Thread Colin Ian King
On 11/03/2021 17:12, Doug Anderson wrote: > Hi, > > On Thu, Mar 11, 2021 at 1:53 AM Colin King wrote: >> >> From: Colin Ian King >> >> The shifting of the u8 integer buf[3] by 24 bits to the left will >> be promoted to a 32 bit signed int and then sign-extended to a >> u64. In the event that

Re: [PATCH][next] nvmem: core: Fix unintentional sign extension issue

2021-03-11 Thread Doug Anderson
Hi, On Thu, Mar 11, 2021 at 1:53 AM Colin King wrote: > > From: Colin Ian King > > The shifting of the u8 integer buf[3] by 24 bits to the left will > be promoted to a 32 bit signed int and then sign-extended to a > u64. In the event that the top bit of buf[3] is set then all > then all the

[PATCH][next] nvmem: core: Fix unintentional sign extension issue

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