Re: [PATCH] drm/bridge: nwl-dsi: Avoid potential multiplication overflow on 32-bit

2021-01-12 Thread Geert Uytterhoeven
Hi Laurent, On Tue, Jan 12, 2021 at 5:38 AM Laurent Pinchart wrote: > On Mon, Jan 11, 2021 at 01:57:02PM +0100, Geert Uytterhoeven wrote: > > As nwl_dsi.lanes is u32, and NSEC_PER_SEC is 10L, the second > > multiplication in > > > > dsi->lanes * 8 * NSEC_PER_SEC > > > > will overflow

Re: [PATCH] drm/bridge: nwl-dsi: Avoid potential multiplication overflow on 32-bit

2021-01-11 Thread Laurent Pinchart
Hi Geert, Thank you for the patch. On Mon, Jan 11, 2021 at 01:57:02PM +0100, Geert Uytterhoeven wrote: > As nwl_dsi.lanes is u32, and NSEC_PER_SEC is 10L, the second > multiplication in > > dsi->lanes * 8 * NSEC_PER_SEC > > will overflow on a 32-bit platform. Fix this by making

Re: [PATCH] drm/bridge: nwl-dsi: Avoid potential multiplication overflow on 32-bit

2021-01-11 Thread Fabio Estevam
Hi Geert, On Mon, Jan 11, 2021 at 10:02 AM Geert Uytterhoeven wrote: > > As nwl_dsi.lanes is u32, and NSEC_PER_SEC is 10L, the second > multiplication in > > dsi->lanes * 8 * NSEC_PER_SEC > > will overflow on a 32-bit platform. Fix this by making the constant > unsigned long long,

[PATCH] drm/bridge: nwl-dsi: Avoid potential multiplication overflow on 32-bit

2021-01-11 Thread Geert Uytterhoeven
As nwl_dsi.lanes is u32, and NSEC_PER_SEC is 10L, the second multiplication in dsi->lanes * 8 * NSEC_PER_SEC will overflow on a 32-bit platform. Fix this by making the constant unsigned long long, forcing 64-bit arithmetic. While iMX8 is arm64, this driver is currently used on