Skip to content
Snippets Groups Projects
Commit fc5d4813 authored by Guangliu Ding's avatar Guangliu Ding Committed by Gianfranco Mariotti
Browse files

MGS-6622 [#imx-2974] Fix build error using lower version toolchain


Fix following build error using 5.10, 5.4 or lower version toolchain.
5.15 toolchain is OK.

drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_gfp.c: In function ‘_GFPAlloc’:
drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_gfp.c:568:9: error: a label can only be part of a statement and a declaration is not a statement
568 | void *addr = NULL;

Signed-off-by: default avatarGuangliu Ding <guangliu.ding@nxp.com>
parent 2fee4474
No related branches found
No related tags found
1 merge request!156Draft: [i.MX] mxc: gpu-viv: apply patches
...@@ -554,6 +554,7 @@ _GFPAlloc( ...@@ -554,6 +554,7 @@ _GFPAlloc(
if (contiguous) if (contiguous)
{ {
size_t bytes = NumPages << PAGE_SHIFT; size_t bytes = NumPages << PAGE_SHIFT;
void *addr = NULL;
#if defined(CONFIG_ZONE_DMA32) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) #if defined(CONFIG_ZONE_DMA32) && LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)
gfp &= ~__GFP_HIGHMEM; gfp &= ~__GFP_HIGHMEM;
...@@ -565,8 +566,6 @@ _GFPAlloc( ...@@ -565,8 +566,6 @@ _GFPAlloc(
Alloc: Alloc:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
void *addr = NULL;
addr = alloc_pages_exact(bytes, (gfp & ~__GFP_HIGHMEM) | __GFP_NORETRY); addr = alloc_pages_exact(bytes, (gfp & ~__GFP_HIGHMEM) | __GFP_NORETRY);
mdlPriv->contiguousPages = addr ? virt_to_page(addr) : gcvNULL; mdlPriv->contiguousPages = addr ? virt_to_page(addr) : gcvNULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment