On 4/9/24 14:22, John Stultz wrote:
So, the struct adjtimex freq field takes a signed value who's units are in shifted (<<16) parts-per-million.
Unfortunately for negative adjustments, the straightforward use of: freq = ppm<<16 will trip undefined behavior warnings with clang:
valid-adjtimex.c:66:6: warning: shifting a negative signed value is undefined [-Wshift-negative-value] -499<<16, ~~~~^ valid-adjtimex.c:67:6: warning: shifting a negative signed value is undefined [-Wshift-negative-value] -450<<16, ~~~~^ ...
So fix our use of shifting negative values in the valid-adjtimex test case to use multiply by (1<<16) to avoid this.
The patch also aligns the values a bit to make it look nicer.
Cc: Thomas Gleixner tglx@linutronix.de Cc: Stephen Boyd sboyd@kernel.org Cc: Anna-Maria Behnsen anna-maria@linutronix.de Cc: Frederic Weisbecker frederic@kernel.org Cc: Shuah Khan shuah@kernel.org Cc: Nathan Chancellor nathan@kernel.org Cc: Nick Desaulniers ndesaulniers@google.com Cc: Lee Jones joneslee@google.com Cc: Muhammad Usama Anjum usama.anjum@collabora.com Cc: linux-kselftest@vger.kernel.org Reported-by: Lee Jones joneslee@google.com Reported-by: Muhammad Usama Anjum usama.anjum@collabora.com Link: https://lore.kernel.org/lkml/0c6d4f0d-2064-4444-986b-1d1ed782135f@collabora.... Signed-off-by: John Stultz jstultz@google.com
Applied to linux-kselftest next for Linux6.10-rc1.
thanks, -- Shuah