@@ -23,7 +23,7 @@ static int verify_mte_pointer_validity(char *ptr, int mode)
23
23
{
24
24
mte_initialize_current_context (mode , (uintptr_t )ptr , BUFFER_SIZE );
25
25
/* Check the validity of the tagged pointer */
26
- memset (( void * ) ptr , '1' , BUFFER_SIZE );
26
+ memset (ptr , '1' , BUFFER_SIZE );
27
27
mte_wait_after_trig ();
28
28
if (cur_mte_cxt .fault_valid ) {
29
29
ksft_print_msg ("Unexpected fault recorded for %p-%p in mode %x\n" ,
@@ -51,7 +51,7 @@ static int check_single_included_tags(int mem_type, int mode)
51
51
char * ptr ;
52
52
int tag , run , ret , result = KSFT_PASS ;
53
53
54
- ptr = ( char * ) mte_allocate_memory (BUFFER_SIZE + MT_GRANULE_SIZE , mem_type , 0 , false);
54
+ ptr = mte_allocate_memory (BUFFER_SIZE + MT_GRANULE_SIZE , mem_type , 0 , false);
55
55
if (check_allocated_memory (ptr , BUFFER_SIZE + MT_GRANULE_SIZE ,
56
56
mem_type , false) != KSFT_PASS )
57
57
return KSFT_FAIL ;
@@ -62,7 +62,7 @@ static int check_single_included_tags(int mem_type, int mode)
62
62
result = KSFT_FAIL ;
63
63
/* Try to catch a excluded tag by a number of tries. */
64
64
for (run = 0 ; (run < RUNS ) && (result == KSFT_PASS ); run ++ ) {
65
- ptr = ( char * ) mte_insert_tags (ptr , BUFFER_SIZE );
65
+ ptr = mte_insert_tags (ptr , BUFFER_SIZE );
66
66
/* Check tag value */
67
67
if (MT_FETCH_TAG ((uintptr_t )ptr ) == tag ) {
68
68
ksft_print_msg ("FAIL: wrong tag = 0x%x with include mask=0x%x\n" ,
@@ -74,7 +74,7 @@ static int check_single_included_tags(int mem_type, int mode)
74
74
result = verify_mte_pointer_validity (ptr , mode );
75
75
}
76
76
}
77
- mte_free_memory_tag_range (( void * ) ptr , BUFFER_SIZE , mem_type , 0 , MT_GRANULE_SIZE );
77
+ mte_free_memory_tag_range (ptr , BUFFER_SIZE , mem_type , 0 , MT_GRANULE_SIZE );
78
78
return result ;
79
79
}
80
80
@@ -84,7 +84,7 @@ static int check_multiple_included_tags(int mem_type, int mode)
84
84
int tag , run , result = KSFT_PASS ;
85
85
unsigned long excl_mask = 0 ;
86
86
87
- ptr = ( char * ) mte_allocate_memory (BUFFER_SIZE + MT_GRANULE_SIZE , mem_type , 0 , false);
87
+ ptr = mte_allocate_memory (BUFFER_SIZE + MT_GRANULE_SIZE , mem_type , 0 , false);
88
88
if (check_allocated_memory (ptr , BUFFER_SIZE + MT_GRANULE_SIZE ,
89
89
mem_type , false) != KSFT_PASS )
90
90
return KSFT_FAIL ;
@@ -94,7 +94,7 @@ static int check_multiple_included_tags(int mem_type, int mode)
94
94
mte_switch_mode (mode , MT_INCLUDE_VALID_TAGS (excl_mask ));
95
95
/* Try to catch a excluded tag by a number of tries. */
96
96
for (run = 0 ; (run < RUNS ) && (result == KSFT_PASS ); run ++ ) {
97
- ptr = ( char * ) mte_insert_tags (ptr , BUFFER_SIZE );
97
+ ptr = mte_insert_tags (ptr , BUFFER_SIZE );
98
98
/* Check tag value */
99
99
if (MT_FETCH_TAG ((uintptr_t )ptr ) < tag ) {
100
100
ksft_print_msg ("FAIL: wrong tag = 0x%x with include mask=0x%x\n" ,
@@ -106,7 +106,7 @@ static int check_multiple_included_tags(int mem_type, int mode)
106
106
result = verify_mte_pointer_validity (ptr , mode );
107
107
}
108
108
}
109
- mte_free_memory_tag_range (( void * ) ptr , BUFFER_SIZE , mem_type , 0 , MT_GRANULE_SIZE );
109
+ mte_free_memory_tag_range (ptr , BUFFER_SIZE , mem_type , 0 , MT_GRANULE_SIZE );
110
110
return result ;
111
111
}
112
112
@@ -115,7 +115,7 @@ static int check_all_included_tags(int mem_type, int mode)
115
115
char * ptr ;
116
116
int run , ret , result = KSFT_PASS ;
117
117
118
- ptr = ( char * ) mte_allocate_memory (BUFFER_SIZE + MT_GRANULE_SIZE , mem_type , 0 , false);
118
+ ptr = mte_allocate_memory (BUFFER_SIZE + MT_GRANULE_SIZE , mem_type , 0 , false);
119
119
if (check_allocated_memory (ptr , BUFFER_SIZE + MT_GRANULE_SIZE ,
120
120
mem_type , false) != KSFT_PASS )
121
121
return KSFT_FAIL ;
@@ -132,7 +132,7 @@ static int check_all_included_tags(int mem_type, int mode)
132
132
*/
133
133
result = verify_mte_pointer_validity (ptr , mode );
134
134
}
135
- mte_free_memory_tag_range (( void * ) ptr , BUFFER_SIZE , mem_type , 0 , MT_GRANULE_SIZE );
135
+ mte_free_memory_tag_range (ptr , BUFFER_SIZE , mem_type , 0 , MT_GRANULE_SIZE );
136
136
return result ;
137
137
}
138
138
@@ -141,7 +141,7 @@ static int check_none_included_tags(int mem_type, int mode)
141
141
char * ptr ;
142
142
int run , ret ;
143
143
144
- ptr = ( char * ) mte_allocate_memory (BUFFER_SIZE , mem_type , 0 , false);
144
+ ptr = mte_allocate_memory (BUFFER_SIZE , mem_type , 0 , false);
145
145
if (check_allocated_memory (ptr , BUFFER_SIZE , mem_type , false) != KSFT_PASS )
146
146
return KSFT_FAIL ;
147
147
@@ -159,12 +159,12 @@ static int check_none_included_tags(int mem_type, int mode)
159
159
}
160
160
mte_initialize_current_context (mode , (uintptr_t )ptr , BUFFER_SIZE );
161
161
/* Check the write validity of the untagged pointer */
162
- memset (( void * ) ptr , '1' , BUFFER_SIZE );
162
+ memset (ptr , '1' , BUFFER_SIZE );
163
163
mte_wait_after_trig ();
164
164
if (cur_mte_cxt .fault_valid )
165
165
break ;
166
166
}
167
- mte_free_memory (( void * ) ptr , BUFFER_SIZE , mem_type , false);
167
+ mte_free_memory (ptr , BUFFER_SIZE , mem_type , false);
168
168
if (cur_mte_cxt .fault_valid )
169
169
return KSFT_FAIL ;
170
170
else
0 commit comments