Skip to content

Commit ed2d8fa

Browse files
mhiramatshuahkh
authored andcommitted
selftests: sync: Fix cast warnings on arm
Fix warnings on __u64 and pointer translation on arm and other 32bit architectures. Since the pointer is 32bits on those archs, we should not directly cast those types. Signed-off-by: Masami Hiramatsu <[email protected]> Cc: Emilio López <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 670cd68 commit ed2d8fa

File tree

1 file changed

+3
-3
lines changed
  • tools/testing/selftests/sync

1 file changed

+3
-3
lines changed

tools/testing/selftests/sync/sync.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static struct sync_file_info *sync_file_info(int fd)
109109
return NULL;
110110
}
111111

112-
info->sync_fence_info = (uint64_t)fence_info;
112+
info->sync_fence_info = (uint64_t)(unsigned long)fence_info;
113113

114114
err = ioctl(fd, SYNC_IOC_FILE_INFO, info);
115115
if (err < 0) {
@@ -124,7 +124,7 @@ static struct sync_file_info *sync_file_info(int fd)
124124

125125
static void sync_file_info_free(struct sync_file_info *info)
126126
{
127-
free((void *)info->sync_fence_info);
127+
free((void *)(unsigned long)info->sync_fence_info);
128128
free(info);
129129
}
130130

@@ -152,7 +152,7 @@ int sync_fence_count_with_status(int fd, int status)
152152
if (!info)
153153
return -1;
154154

155-
fence_info = (struct sync_fence_info *)info->sync_fence_info;
155+
fence_info = (struct sync_fence_info *)(unsigned long)info->sync_fence_info;
156156
for (i = 0 ; i < info->num_fences ; i++) {
157157
if (fence_info[i].status == status)
158158
count++;

0 commit comments

Comments
 (0)