Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <mhiramat@kernel.org>
Cc: Emilio López <emilio.lopez@collabora.co.uk>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Masami Hiramatsu and committed by
Shuah Khan
ed2d8fa7 670cd684

+3 -3
+3 -3
tools/testing/selftests/sync/sync.c
··· 109 109 return NULL; 110 110 } 111 111 112 - info->sync_fence_info = (uint64_t)fence_info; 112 + info->sync_fence_info = (uint64_t)(unsigned long)fence_info; 113 113 114 114 err = ioctl(fd, SYNC_IOC_FILE_INFO, info); 115 115 if (err < 0) { ··· 124 124 125 125 static void sync_file_info_free(struct sync_file_info *info) 126 126 { 127 - free((void *)info->sync_fence_info); 127 + free((void *)(unsigned long)info->sync_fence_info); 128 128 free(info); 129 129 } 130 130 ··· 152 152 if (!info) 153 153 return -1; 154 154 155 - fence_info = (struct sync_fence_info *)info->sync_fence_info; 155 + fence_info = (struct sync_fence_info *)(unsigned long)info->sync_fence_info; 156 156 for (i = 0 ; i < info->num_fences ; i++) { 157 157 if (fence_info[i].status == status) 158 158 count++;