diff --git a/libdmabufheap/include/dmabuf_alloc.h b/libdmabufheap/include/dmabuf_alloc.h index abec18f59d6c56f8330e91033ba40670a17aa049..19fbb50fd151d9548f1ba4fd338809e9f9ea0d4c 100644 --- a/libdmabufheap/include/dmabuf_alloc.h +++ b/libdmabufheap/include/dmabuf_alloc.h @@ -16,7 +16,6 @@ #ifndef LIB_DMA_BUF_HEAP_H #define LIB_DMA_BUF_HEAP_H -#include #include #include diff --git a/libdmabufheap/src/dmabuf_alloc.c b/libdmabufheap/src/dmabuf_alloc.c index 02dec9d783b5d5e7c35d05b29d442b94e79afdc5..de0d0abc6220342c3a2cf56a925a934377dfc00b 100644 --- a/libdmabufheap/src/dmabuf_alloc.c +++ b/libdmabufheap/src/dmabuf_alloc.c @@ -120,7 +120,7 @@ int DmabufHeapBufferFree(DmabufHeapBuffer *buffer) return close(buffer->fd); } -int DmabufHeapBufferSyncStart(unsigned int fd, DmabufHeapBufferSyncType syncType) +int DmabufHeapBufferSyncStart(unsigned int bufferFd, DmabufHeapBufferSyncType syncType) { if (!IsSyncTypeValid(syncType)) { HILOG_ERROR(LOG_CORE, "buffer start syncType is wrong, syncType = %u.", syncType); @@ -129,10 +129,10 @@ int DmabufHeapBufferSyncStart(unsigned int fd, DmabufHeapBufferSyncType syncType struct dma_buf_sync sync = {0}; sync.flags = DMA_BUF_SYNC_START | syncType; - return ioctl(fd, DMA_BUF_IOCTL_SYNC, &sync); + return ioctl(bufferFd, DMA_BUF_IOCTL_SYNC, &sync); } -int DmabufHeapBufferSyncEnd(unsigned int fd, DmabufHeapBufferSyncType syncType) +int DmabufHeapBufferSyncEnd(unsigned int bufferFd, DmabufHeapBufferSyncType syncType) { if (!IsSyncTypeValid(syncType)) { HILOG_ERROR(LOG_CORE, "buffer end syncType is wrong, syncType = %u.", syncType); @@ -141,5 +141,5 @@ int DmabufHeapBufferSyncEnd(unsigned int fd, DmabufHeapBufferSyncType syncType) struct dma_buf_sync sync = {0}; sync.flags = DMA_BUF_SYNC_END | syncType; - return ioctl(fd, DMA_BUF_IOCTL_SYNC, &sync); + return ioctl(bufferFd, DMA_BUF_IOCTL_SYNC, &sync); } \ No newline at end of file diff --git a/libdmabufheap/test/unittest/libdmabufheap/dmabuf_alloc_test.cpp b/libdmabufheap/test/unittest/libdmabufheap/dmabuf_alloc_test.cpp index 1ad1e5680387294c4cfc1ffc6c00822349208a9a..4a9f001d3573e40a9e506293c27da975d03b8ffd 100644 --- a/libdmabufheap/test/unittest/libdmabufheap/dmabuf_alloc_test.cpp +++ b/libdmabufheap/test/unittest/libdmabufheap/dmabuf_alloc_test.cpp @@ -234,9 +234,9 @@ HWTEST_F(DmabufAllocTest, BufferSyncWithWrongSyncType, Function|MediumTest|Level void *ptr = mmap(NULL, BUFFER_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, buffer.fd, 0); ASSERT_TRUE(ptr != NULL); - ASSERT_NE(0, DmabufHeapBufferSyncEnd(buffer.fd, (DmabufHeapBufferSyncType)WRONG_SYNC_TYPE)); + ASSERT_NE(0, DmabufHeapBufferSyncEnd(buffer.fd, static_cast(WRONG_SYNC_TYPE))); - ASSERT_NE(0, DmabufHeapBufferSyncStart(buffer.fd, (DmabufHeapBufferSyncType)WRONG_SYNC_TYPE)); + ASSERT_NE(0, DmabufHeapBufferSyncStart(buffer.fd, static_cast(WRONG_SYNC_TYPE))); ASSERT_EQ(0, munmap(ptr, BUFFER_SIZE));