lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e366b4d3-1cf3-48cf-8445-cdbc1156d32b@nvidia.com>
Date: Fri, 10 May 2024 11:01:09 -0700
From: John Hubbard <jhubbard@...dia.com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: Shuah Khan <shuah@...nel.org>, Nathan Chancellor <nathan@...nel.org>,
 Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling
 <morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
 Fenghua Yu <fenghua.yu@...el.com>,
 Reinette Chatre <reinette.chatre@...el.com>,
 Valentin Obst <kernel@...entinobst.de>, linux-kselftest@...r.kernel.org,
 LKML <linux-kernel@...r.kernel.org>, llvm@...ts.linux.dev
Subject: Re: [PATCH] selftests/resctrl: fix clang build warnings related to
 abs(), labs() calls

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@...el.com>
>> Cc: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
>> Signed-off-by: John Hubbard <jhubbard@...dia.com>
> 
> Thank you.
> 
> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
> 

Thanks for the review!


thanks,
-- 
John Hubbard
NVIDIA


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ