libhsakmt: Improve the confusing code
The code tends to confuse readers. Improve it.
Change-Id: I5c6cbf7a114b6e7d26ce3b9f54350a153032267d
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
[ROCm/ROCR-Runtime commit: dbe9af7777]
This commit is contained in:
@@ -126,14 +126,14 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtOpenKFD(void)
|
|||||||
|
|
||||||
fd = open(kfd_device_name, O_RDWR | O_CLOEXEC);
|
fd = open(kfd_device_name, O_RDWR | O_CLOEXEC);
|
||||||
|
|
||||||
if (fd != -1) {
|
if (fd == -1) {
|
||||||
kfd_fd = fd;
|
|
||||||
kfd_open_count = 1;
|
|
||||||
} else {
|
|
||||||
result = HSAKMT_STATUS_KERNEL_IO_CHANNEL_NOT_OPENED;
|
result = HSAKMT_STATUS_KERNEL_IO_CHANNEL_NOT_OPENED;
|
||||||
goto open_failed;
|
goto open_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kfd_fd = fd;
|
||||||
|
kfd_open_count = 1;
|
||||||
|
|
||||||
init_page_size();
|
init_page_size();
|
||||||
|
|
||||||
result = topology_sysfs_get_system_props(&sys_props);
|
result = topology_sysfs_get_system_props(&sys_props);
|
||||||
|
|||||||
Reference in New Issue
Block a user