Re: [PATCH] NTB: Fix UB/bug in ntb_mw_get_align()

2017-11-30 Thread Logan Gunthorpe
On 30/11/17 02:39 PM, Serge Semin wrote: Simple (1 << pidx) operation causes undefined behaviour when pidx >= 32. It must be casted to u64 to match the actual return value of ntb_link_is_up() method, so to have all the possible peer indexes covered and to get rid of undefined behaviour. Additio

[PATCH] NTB: Fix UB/bug in ntb_mw_get_align()

2017-11-30 Thread Serge Semin
Simple (1 << pidx) operation causes undefined behaviour when pidx >= 32. It must be casted to u64 to match the actual return value of ntb_link_is_up() method, so to have all the possible peer indexes covered and to get rid of undefined behaviour. Additionally there are special macros in "linux/bito