On 5/10/24 2:06 AM, Ilpo Järvinen wrote:
On Wed, 8 May 2024, John Hubbard wrote:
When building with clang, via:
make LLVM=1 -C tools/testing/selftests
...two types of warnings occur:
warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value warning: taking the absolute value of unsigned type 'unsigned long' has no effect
Fix these by:
a) using labs() in place of abs(), when long integers are involved, and
b) Change to use signed integer data types, in places where subtraction is used (and could end up with negative values).
c) Remove a duplicate abs() call in cmt_test.c.
In general, instead of filename, it's better to refer to the actual function in this kind of description. And in this particular case, cmt_test.c could be replaced with "the CMT selftest" which is more descriptive and still unambiguous.
Sure, I'll change that.
Cc: Reinette Chatre reinette.chatre@intel.com Cc: Ilpo Järvinen ilpo.jarvinen@linux.intel.com Signed-off-by: John Hubbard jhubbard@nvidia.com
Thank you.
Reviewed-by: Ilpo Järvinen ilpo.jarvinen@linux.intel.com
Thanks for the review!
thanks,