summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2022-06-25 22:46:47 +0800
committersakumisu <[email protected]>2022-06-25 22:46:57 +0800
commitb47fe8d958bc5bb8432cb9c0aaca0f7962d02a64 (patch)
treef35f413c05a6933ded7ec7cfc0ced8315182f966 /common
parent2bb5d6c13768933b4cdeaf9d43862806f6b993a3 (diff)
fix warning in 64bit cpu
Diffstat (limited to 'common')
-rw-r--r--common/usb_mem.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/common/usb_mem.h b/common/usb_mem.h
index 3806696c..6f8b2422 100644
--- a/common/usb_mem.h
+++ b/common/usb_mem.h
@@ -36,7 +36,7 @@
#endif
#define usb_malloc(size) malloc(size)
-#define usb_free(ptr) free(ptr)
+#define usb_free(ptr) free(ptr)
#ifdef CONFIG_USB_DCACHE_ENABLE
static inline void *usb_iomalloc(size_t size)
@@ -60,14 +60,14 @@ static inline void *usb_iomalloc(size_t size)
ptr = usb_malloc(align_size);
if (ptr != NULL) {
/* the allocated memory block is aligned */
- if (((uint32_t)ptr & (align - 1)) == 0) {
- align_ptr = (void *)((uint32_t)ptr + align);
+ if (((unsigned long)ptr & (align - 1)) == 0) {
+ align_ptr = (void *)((unsigned long)ptr + align);
} else {
- align_ptr = (void *)(((uint32_t)ptr + (align - 1)) & ~(align - 1));
+ align_ptr = (void *)(((unsigned long)ptr + (align - 1)) & ~(align - 1));
}
/* set the pointer before alignment pointer to the real pointer */
- *((uint32_t *)((uint32_t)align_ptr - sizeof(void *))) = (uint32_t)ptr;
+ *((unsigned long *)((unsigned long)align_ptr - sizeof(void *))) = (unsigned long)ptr;
ptr = align_ptr;
}
@@ -79,12 +79,12 @@ static inline void usb_iofree(void *ptr)
{
void *real_ptr;
- real_ptr = (void *)*(uint32_t *)((uint32_t)ptr - sizeof(void *));
+ real_ptr = (void *)*(unsigned long *)((unsigned long)ptr - sizeof(void *));
usb_free(real_ptr);
}
#else
#define usb_iomalloc(size) usb_malloc(size)
-#define usb_iofree(ptr) usb_free(ptr)
+#define usb_iofree(ptr) usb_free(ptr)
#endif
#endif