selftest mm/mseal compile warning
Subsystems (3)
v2 cover selftest mm/mseal compile warning
From: Jeff Xu <[email protected]>
fix compile warning reported by test robot [1]
Please apply on top of patch titled:
"selftest mm/mseal: style change"
(which already in mm-unstable)
[1] https://lore.kernel.org/all/[email protected]/
History:
V2: fix as suggested by Pedro Falcato
v1:
https://lore.kernel.org/linux-mm/[email protected]/T/
Thanks!
-Jeff
Jeff Xu (1):
selftest mm/mseal: fix compile warning
tools/testing/selftests/mm/mseal_test.c | 3 +-- tools/testing/selftests/mm/seal_elf.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
Signature · 1 line
2.44.0.769.g3c40516874-goog
PATCH v2 1/1 selftest mm/mseal: fix compile warning
From: Jeff Xu <[email protected]>
fix compile warning reported by test robot
Signed-off-by Jeff Xu <[email protected]>
Reported-by kernel test robot <[email protected]>
Suggested-by Pedro Falcato <[email protected]>
--- tools/testing/selftests/mm/mseal_test.c | 3 +-- tools/testing/selftests/mm/seal_elf.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
tools/testing/selftests/mm/mseal_test.c +1 -2
@@ -79,7 +79,7 @@ static unsigned long get_vma_size(void *addr, int *prot)return 0 ;while (fgets (line,sizeof (line), maps)) { -if (sscanf (line,"%lx-%lx %4s" , &addr_start, &addr_end, &protstr) ==3 ) { +if (sscanf (line,"%lx-%lx %4s" , &addr_start, &addr_end, protstr) ==3 ) {if (addr_start == (uintptr_t ) addr) { size = addr_end - addr_start;if (protstr[0 ] =='r' )
@@ -208,7 +208,6 @@ static u64 set_pkey_bits(u64 reg, int pkey, u64 flags)static void set_pkey (int pkey,unsigned long pkey_value) { -unsigned long mask = (PKEY_DISABLE_ACCESS |PKEY_DISABLE_WRITE );u64 new_pkey_reg; new_pkey_reg =set_pkey_bits (__read_pkey_reg (), pkey, pkey_value);
tools/testing/selftests/mm/seal_elf.c +1 -2
@@ -105,7 +105,6 @@ static void test_seal_elf(void)int ret;FILE *maps;char line[512 ]; -int size =0 ;uintptr_t addr_start, addr_end;char prot[5 ];char filename[256 ];
@@ -136,7 +135,7 @@ static void test_seal_elf(void)*/ while (fgets (line,sizeof (line), maps)) {if (sscanf (line,"%lx-%lx %4s %*x %*x:%*x %*u %255[^\n]" , - &addr_start, &addr_end, &prot, &filename) ==4 ) { + &addr_start, &addr_end, prot, filename) ==4 ) {if (strlen (filename)) {/* * seal the mapping if read only.
Signature · 1 line
2.44.0.769.g3c40516874-goog
Re: [PATCH v2 1/1] selftest mm/mseal: fix compile warning
Quoted 8 lines · On 4/20/24 5:35 AM, [email protected] wrote:
From: Jeff Xu <[email protected]>
fix compile warning reported by test robot
Signed-off-by Jeff Xu <[email protected]>Reported-by kernel test robot <[email protected]>Suggested-by Pedro Falcato <[email protected]>
Reviewed-by Muhammad Usama Anjum <[email protected]>
Quoted 47 lines
--- tools/testing/selftests/mm/mseal_test.c | 3 +-- tools/testing/selftests/mm/seal_elf.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)tools/testing/selftests/mm/mseal_test.c +1
-2@@ -79,7 +79,7 @@ static unsigned long get_vma_size(void *addr, int *prot)return 0 ;while (fgets (line,sizeof (line), maps)) { -if (sscanf (line,"%lx-%lx %4s" , &addr_start, &addr_end, &protstr) ==3 ) { +if (sscanf (line,"%lx-%lx %4s" , &addr_start, &addr_end, protstr) ==3 ) {if (addr_start == (uintptr_t ) addr) { size = addr_end - addr_start;if (protstr[0 ] =='r' )@@ -208,7 +208,6 @@ static u64 set_pkey_bits(u64 reg, int pkey, u64 flags)static void set_pkey (int pkey,unsigned long pkey_value) { -unsigned long mask = (PKEY_DISABLE_ACCESS |PKEY_DISABLE_WRITE );u64 new_pkey_reg; new_pkey_reg =set_pkey_bits (__read_pkey_reg (), pkey, pkey_value);tools/testing/selftests/mm/seal_elf.c +1
-2@@ -105,7 +105,6 @@ static void test_seal_elf(void)int ret;FILE *maps;char line[512 ]; -int size =0 ;uintptr_t addr_start, addr_end;char prot[5 ];char filename[256 ];@@ -136,7 +135,7 @@ static void test_seal_elf(void)*/ while (fgets (line,sizeof (line), maps)) {if (sscanf (line,"%lx-%lx %4s %*x %*x:%*x %*u %255[^\n]" , - &addr_start, &addr_end, &prot, &filename) ==4 ) { + &addr_start, &addr_end, prot, filename) ==4 ) {if (strlen (filename)) {/* * seal the mapping if read only.
Signature · 2 lines
BR, Muhammad Usama Anjum