commit a1f277bcc44c6757577ac2e12eb1025a727ea5d7 Date: Sun May 29 09:20:55 2016 -0700 Enable compilation with gcc-arm-linux-gnueabihf 5.3 diff --git a/drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_gsu.c b/drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_gsu.c index ee477fc..31d7df5 100755 --- a/drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_gsu.c +++ b/drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_gsu.c @@ -217,7 +217,7 @@ int de_gsu_set_para(unsigned int sel, unsigned int chno, unsigned int enable, //fir coefficient pt_coef = de_gsu_calc_fir_coef(para->vstep); - memcpy(&gsu_dev[sel][chno_t]->hcoeff, lan2coefftab16 + pt_coef, sizeof(unsigned int)*GSU_PHASE_NUM); + memcpy((void*)&gsu_dev[sel][chno_t]->hcoeff, lan2coefftab16 + pt_coef, sizeof(unsigned int)*GSU_PHASE_NUM); gsu_dev[sel][chno_t]->ctrl.bits.coef_switch_rdy = 1; gsu_glb_block[sel][chno_t].dirty = 1; gsu_out_block[sel][chno_t].dirty = 1; diff --git a/drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_vsu.c b/drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_vsu.c index 081656a..0f5ab44 100755 --- a/drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_vsu.c +++ b/drivers/video/sunxi/disp2/disp/de/lowlevel_sun50iw1/de_vsu.c @@ -274,30 +274,30 @@ int de_vsu_set_para(unsigned int sel, unsigned int chno, unsigned int enable, un //fir coefficient //ch0 pt_coef = de_vsu_calc_fir_coef(ypara->hstep); - memcpy(&vsu_dev[sel][chno]->yhcoeff0, lan3coefftab32_left+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); - memcpy(&vsu_dev[sel][chno]->yhcoeff1, lan3coefftab32_right+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); + memcpy((void*)&vsu_dev[sel][chno]->yhcoeff0, lan3coefftab32_left+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); + memcpy((void*)&vsu_dev[sel][chno]->yhcoeff1, lan3coefftab32_right+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); pt_coef = de_vsu_calc_fir_coef(ypara->vstep); - memcpy(&vsu_dev[sel][chno]->yvcoeff, lan2coefftab32+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); + memcpy((void*)&vsu_dev[sel][chno]->yvcoeff, lan2coefftab32+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); //ch1/2 if (VSU_FORMAT_RGB == format) { pt_coef = de_vsu_calc_fir_coef(cpara->hstep); - memcpy(&vsu_dev[sel][chno]->chcoeff0, lan3coefftab32_left+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); - memcpy(&vsu_dev[sel][chno]->chcoeff1, lan3coefftab32_right+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); + memcpy((void*)&vsu_dev[sel][chno]->chcoeff0, lan3coefftab32_left+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); + memcpy((void*)&vsu_dev[sel][chno]->chcoeff1, lan3coefftab32_right+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); pt_coef = de_vsu_calc_fir_coef(cpara->vstep); - memcpy(&vsu_dev[sel][chno]->cvcoeff, lan2coefftab32+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); + memcpy((void*)&vsu_dev[sel][chno]->cvcoeff, lan2coefftab32+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); } else { pt_coef = de_vsu_calc_fir_coef(cpara->hstep); - memcpy(&vsu_dev[sel][chno]->chcoeff0, bicubic8coefftab32_left+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); - memcpy(&vsu_dev[sel][chno]->chcoeff1, bicubic8coefftab32_right+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); + memcpy((void*)&vsu_dev[sel][chno]->chcoeff0, bicubic8coefftab32_left+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); + memcpy((void*)&vsu_dev[sel][chno]->chcoeff1, bicubic8coefftab32_right+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); pt_coef = de_vsu_calc_fir_coef(cpara->vstep); - memcpy(&vsu_dev[sel][chno]->cvcoeff, bicubic4coefftab32+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); + memcpy((void*)&vsu_dev[sel][chno]->cvcoeff, bicubic4coefftab32+pt_coef, sizeof(unsigned int)*VSU_PHASE_NUM); } vsu_dev[sel][chno]->ctrl.bits.coef_switch_rdy = 1; vsu_glb_block[sel][chno].dirty = 1; diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 9896e54..64bb571 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h @@ -44,9 +44,15 @@ */ #if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) +/* XXX: check __GNUC_STDC_INLINE__, fix line length */ +#define inline inline __attribute__((always_inline)) __attribute__((__gnu_inline__)) +#define __inline__ __inline__ __attribute__((always_inline)) __attribute__((__gnu_inline__)) +#define __inline __inline __attribute__((always_inline)) __attribute__((__gnu_inline__)) +/* # define inline inline __attribute__((always_inline)) # define __inline__ __inline__ __attribute__((always_inline)) # define __inline __inline __attribute__((always_inline)) +*/ #endif #define __deprecated __attribute__((deprecated)) diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h new file mode 100644 index 0000000..27d11ca --- /dev/null +++ b/include/linux/compiler-gcc5.h @@ -0,0 +1,63 @@ +#ifndef __LINUX_COMPILER_H +#error "Please don't include directly, include instead." +#endif + +/* GCC 4.1.[01] miscompiles __weak */ +#ifdef __KERNEL__ +# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1 +# error Your version of gcc miscompiles the __weak directive +# endif +#endif + +#define __used __attribute__((__used__)) +#define __must_check __attribute__((warn_unused_result)) +#define __compiler_offsetof(a,b) __builtin_offsetof(a,b) +#ifndef __always_inline +# define __always_inline inline __attribute__((always_inline)) +#endif + +/* + * A trick to suppress uninitialized variable warning without generating any + * code + */ +#define uninitialized_var(x) x = x + +#if __GNUC_MINOR__ >= 3 +/* Mark functions as cold. gcc will assume any path leading to a call + to them will be unlikely. This means a lot of manual unlikely()s + are unnecessary now for any paths leading to the usual suspects + like BUG(), printk(), panic() etc. [but let's keep them for now for + older compilers] + + Early snapshots of gcc 4.3 don't support this and we can't detect this + in the preprocessor, but we can live with this because they're unreleased. + Maketime probing would be overkill here. + + gcc also has a __attribute__((__hot__)) to move hot functions into + a special section, but I don't see any sense in this right now in + the kernel context */ +#define __cold __attribute__((__cold__)) + + +#if __GNUC_MINOR__ >= 5 +/* + * Mark a position in code as unreachable. This can be used to + * suppress control flow warnings after asm blocks that transfer + * control elsewhere. + * + * Early snapshots of gcc 4.5 don't support this and we can't detect + * this in the preprocessor, but we can live with this because they're + * unreleased. Really, we need to have autoconf for the kernel. + */ +#define unreachable() __builtin_unreachable() +#endif + +#endif + +#if __GNUC_MINOR__ > 0 +#define __compiletime_object_size(obj) __builtin_object_size(obj, 0) +#endif +#if __GNUC_MINOR__ >= 4 +#define __compiletime_warning(message) __attribute__((warning(message))) +#define __compiletime_error(message) __attribute__((error(message))) +#endif