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: <04b9c37a-d39f-49eb-b7d9-fced64eb12e8@gmail.com>
Date: Sat, 2 Nov 2024 19:55:22 +0100
From: Mirsad Todorovac <mtodorovac69@...il.com>
To: Muhammad Usama Anjum <Usama.Anjum@...labora.com>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Suren Baghdasaryan <surenb@...gle.com>, linux-mm@...ck.org,
 linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Shuah Khan <shuah@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
 Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
 Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
 "H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH v1 1/2] selftests/x86/syscall: fix coccinelle WARNING
 recommending the use of ARRAY_SIZE()



On 11/1/24 13:04, Muhammad Usama Anjum wrote:
> On 11/1/24 4:15 PM, Mirsad Todorovac wrote:
>> Coccinelle gives WARNING recommending the use of ARRAY_SIZE() macro definition
>> to improve the code readability:
>>
>> ./tools/testing/selftests/x86/syscall_numbering.c:316:35-36: WARNING: Use ARRAY_SIZE
>>
>> Fixes: 15c82d98a0f78 ("selftests/x86/syscall: Update and extend syscall_numbering_64")
>> Cc: Thomas Gleixner <tglx@...utronix.de>
>> Cc: Ingo Molnar <mingo@...hat.com>
>> Cc: Borislav Petkov <bp@...en8.de>
>> Cc: Dave Hansen <dave.hansen@...ux.intel.com>
>> Cc: x86@...nel.org
>> Cc: "H. Peter Anvin" <hpa@...or.com>
>> Cc: Shuah Khan <shuah@...nel.org>
>> Cc: linux-kernel@...r.kernel.org
>> Cc: linux-kselftest@...r.kernel.org
>> Signed-off-by: Mirsad Todorovac <mtodorovac69@...il.com>

> Reviewed-by: Muhammad Usama Anjum <usama.anjum@...labora.com>

Dear Sir,

Thank you for your positive review of the patch.

There are much more suggestions by the coccinelle check, but that's a substantial work to do.

It would help to set some priorities in this by some more experienced developer.

Thank you.

Best regards,
Mirsad Todorovac
 
>> ---
>>  v1: initial version.
>>
>>  tools/testing/selftests/x86/syscall_numbering.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/x86/syscall_numbering.c b/tools/testing/selftests/x86/syscall_numbering.c
>> index 991591718bb0..41c42b7b54a6 100644
>> --- a/tools/testing/selftests/x86/syscall_numbering.c
>> +++ b/tools/testing/selftests/x86/syscall_numbering.c
>> @@ -25,6 +25,7 @@
>>  #include <sys/mman.h>
>>  
>>  #include <linux/ptrace.h>
>> +#include "../kselftest.h"
>>  
>>  /* Common system call numbers */
>>  #define SYS_READ	  0
>> @@ -313,7 +314,7 @@ static void test_syscall_numbering(void)
>>  	 * The MSB is supposed to be ignored, so we loop over a few
>>  	 * to test that out.
>>  	 */
>> -	for (size_t i = 0; i < sizeof(msbs)/sizeof(msbs[0]); i++) {
>> +	for (size_t i = 0; i < ARRAY_SIZE(msbs); i++) {
>>  		int msb = msbs[i];
>>  		run("Checking system calls with msb = %d (0x%x)\n",
>>  		    msb, msb);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ