These patches are originally from meta-freescale, commit 075681e8 , and
were modified slightly to apply to kernel 4.14.
This fixes errors while building other modules, especially
kernel-module-imx-gpu-viv, which otherwise produces compile errors like:
| [...]tmp/work-shared/nitrogen8m/kernel-source/include/linux/module.h:131:6: error: 'init_module' specifies less restrictive attribute than its target 'gpu_init': 'cold' [-Werror=missing-attributes]
| 131 | int init_module(void) __attribute__((alias(#initfn)));
| | ^~~~~~~~~~~
| [...]tmp/work/nitrogen8m-poky-linux/kernel-module-imx-gpu-viv/6.4.0.p1.0-r0/git/src/hal/os/linux/kernel/gc_hal_kernel_driver.c:1445:1: note: in expansion of macro 'module_init'
| 1445 | module_init(gpu_init);
| | ^~~~~~~~~~~
| [...]tmp/work/nitrogen8m-poky-linux/kernel-module-imx-gpu-viv/6.4.0.p1.0-r0/git/src/hal/os/linux/kernel/gc_hal_kernel_driver.c:1411:19: note: 'init_module' target declared here
| 1411 | static int __init gpu_init(void)
| | ^~~~~~~~
| In file included from [...]tmp/work/nitrogen8m-poky-linux/kernel-module-imx-gpu-viv/6.4.0.p1.0-r0/git/src/hal/os/linux/kernel/gc_hal_kernel_linux.h:61,
| from [...]tmp/work/nitrogen8m-poky-linux/kernel-module-imx-gpu-viv/6.4.0.p1.0-r0/git/src/hal/os/linux/kernel/gc_hal_kernel_driver.c:61:
| [...]tmp/work-shared/nitrogen8m/kernel-source/include/linux/module.h:137:7: error: 'cleanup_module' specifies less restrictive attribute than its target 'gpu_exit': 'cold' [-Werror=missing-attributes]
| 137 | void cleanup_module(void) __attribute__((alias(#exitfn)));
| | ^~~~~~~~~~~~~~
| [...]tmp/work/nitrogen8m-poky-linux/kernel-module-imx-gpu-viv/6.4.0.p1.0-r0/git/src/hal/os/linux/kernel/gc_hal_kernel_driver.c:1446:1: note: in expansion of macro 'module_exit'
| 1446 | module_exit(gpu_exit);
| | ^~~~~~~~~~~
| [...]tmp/work/nitrogen8m-poky-linux/kernel-module-imx-gpu-viv/6.4.0.p1.0-r0/git/src/hal/os/linux/kernel/gc_hal_kernel_driver.c:1437:20: note: 'cleanup_module' target declared here
| 1437 | static void __exit gpu_exit(void)
| | ^~~~~~~~
Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>