Re: [PATCH][next] net: dsa: fix unintended sign extension on a u16 left shift

2020-11-10 Thread Jakub Kicinski
On Mon, 09 Nov 2020 14:27:52 +0100 Kurt Kanzenbach wrote: > On Mon Nov 09 2020, Colin King wrote: > > From: Colin Ian King > > > > The left shift of u16 variable high is promoted to the type int and > > then sign extended to a 64 bit u64 value. If the top bit of high is > > set then the upper 32

Re: [PATCH][next] net: dsa: fix unintended sign extension on a u16 left shift

2020-11-09 Thread Kurt Kanzenbach
On Mon Nov 09 2020, Colin King wrote: > From: Colin Ian King > > The left shift of u16 variable high is promoted to the type int and > then sign extended to a 64 bit u64 value. If the top bit of high is > set then the upper 32 bits of the result end up being set by the > sign extension. Fix this

Re: [PATCH][next] net: dsa: fix unintended sign extension on a u16 left shift

2020-11-09 Thread Kurt Kanzenbach
On Mon Nov 09 2020, Colin King wrote: > From: Colin Ian King > > The left shift of u16 variable high is promoted to the type int and > then sign extended to a 64 bit u64 value. If the top bit of high is > set then the upper 32 bits of the result end up being set by the > sign extension. Fix this