Re: [U-Boot] [PATCH v2 06/13] net: ravb: Fix signed shift overflow

2018-08-27 Thread Marek Vasut
On 08/27/2018 10:24 PM, Eugeniu Rosca wrote: > Hi Marek, Hi, > On Mon, Aug 27, 2018 at 01:22:54AM +0200, Marek Vasut wrote: >> On 08/27/2018 01:13 AM, Eugeniu Rosca wrote: > [...] >>> >>> #define RAVB_DESC_DT(n)((n) << 28) >> >> What about changing this instead, ((u32)(n) <

Re: [U-Boot] [PATCH v2 06/13] net: ravb: Fix signed shift overflow

2018-08-27 Thread Eugeniu Rosca
Hi Marek, On Mon, Aug 27, 2018 at 01:22:54AM +0200, Marek Vasut wrote: > On 08/27/2018 01:13 AM, Eugeniu Rosca wrote: [...] > > > > #define RAVB_DESC_DT(n)((n) << 28) > > What about changing this instead, ((u32)(n) << 28) ? This works too. [...] > > > > - writel((mac

Re: [U-Boot] [PATCH v2 06/13] net: ravb: Fix signed shift overflow

2018-08-26 Thread Marek Vasut
On 08/27/2018 01:13 AM, Eugeniu Rosca wrote: > Running "tftp" on R-Car H3 Salvator-X with CONFIG_UBSAN=y results in: > > => tftp > = > UBSAN: Undefined behaviour in drivers/net/ravb.c:237:28 > left shift of 10 by 28 places cann

[U-Boot] [PATCH v2 06/13] net: ravb: Fix signed shift overflow

2018-08-26 Thread Eugeniu Rosca
Running "tftp" on R-Car H3 Salvator-X with CONFIG_UBSAN=y results in: => tftp = UBSAN: Undefined behaviour in drivers/net/ravb.c:237:28 left shift of 10 by 28 places cannot be represented in type 'int'