From 162b3a084904a1d6ef1553782b8573885d5f900b Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Wed, 6 Feb 2008 01:39:11 -0800 Subject: atmel_lcdfb: validate display timings Setting a display timing parameter too high or too low may cause it to wrap around and thus become completely wrong. Validate the timings in atmel_lcdfb_check_var() and saturate to the highest or lowest possible value if necessary. Signed-off-by: Haavard Skinnemoen Cc: "Antonino A. Daplas" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/video/atmel_lcdc.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/video') diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h index 4eea63761a3..76095e70935 100644 --- a/include/video/atmel_lcdc.h +++ b/include/video/atmel_lcdc.h @@ -115,20 +115,20 @@ struct atmel_lcdfb_info { #define ATMEL_LCDC_MEMOR_LITTLE (1 << 31) #define ATMEL_LCDC_TIM1 0x0808 -#define ATMEL_LCDC_VFP (0xff << 0) +#define ATMEL_LCDC_VFP (0xffU << 0) #define ATMEL_LCDC_VBP_OFFSET 8 -#define ATMEL_LCDC_VBP (0xff << ATMEL_LCDC_VBP_OFFSET) +#define ATMEL_LCDC_VBP (0xffU << ATMEL_LCDC_VBP_OFFSET) #define ATMEL_LCDC_VPW_OFFSET 16 -#define ATMEL_LCDC_VPW (0x3f << ATMEL_LCDC_VPW_OFFSET) +#define ATMEL_LCDC_VPW (0x3fU << ATMEL_LCDC_VPW_OFFSET) #define ATMEL_LCDC_VHDLY_OFFSET 24 -#define ATMEL_LCDC_VHDLY (0xf << ATMEL_LCDC_VHDLY_OFFSET) +#define ATMEL_LCDC_VHDLY (0xfU << ATMEL_LCDC_VHDLY_OFFSET) #define ATMEL_LCDC_TIM2 0x080c -#define ATMEL_LCDC_HBP (0xff << 0) +#define ATMEL_LCDC_HBP (0xffU << 0) #define ATMEL_LCDC_HPW_OFFSET 8 -#define ATMEL_LCDC_HPW (0x3f << ATMEL_LCDC_HPW_OFFSET) +#define ATMEL_LCDC_HPW (0x3fU << ATMEL_LCDC_HPW_OFFSET) #define ATMEL_LCDC_HFP_OFFSET 21 -#define ATMEL_LCDC_HFP (0x7ff << ATMEL_LCDC_HFP_OFFSET) +#define ATMEL_LCDC_HFP (0x7ffU << ATMEL_LCDC_HFP_OFFSET) #define ATMEL_LCDC_LCDFRMCFG 0x0810 #define ATMEL_LCDC_LINEVAL (0x7ff << 0) -- cgit v1.2.3