mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-07 01:49:42 +01:00
Shifting a negative signed number is undefined behavior. Looking at the macros MAKE_PROCESS_CPUCLOCK and FD_TO_CLOCKID, it seems that the subexpression: (~(clockid_t) (pid) << 3) where clockid_t resolves to a signed int, which once negated, is undefined behavior to shift the value of if the results thus far are negative. It was further suggested to make these macros into inline functions. Suggested-by: Thomas Gleixner <[email protected]> Signed-off-by: Nick Desaulniers <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: Dimitri Sivanich <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Al Viro <[email protected]> Cc: [email protected] Cc: Shuah Khan <[email protected]> Cc: Deepa Dinamani <[email protected]> Link: https://lkml.kernel.org/r/[email protected]