* [PATCH] gbefb: unsigned var->pixclock cannot be less than 0
@ 2008-11-26 22:18 roel kluin
0 siblings, 0 replies; 2+ messages in thread
From: roel kluin @ 2008-11-26 22:18 UTC (permalink / raw)
To: adaplas; +Cc: linux-fbdev-devel, linux-kernel
unsigned var->pixclock cannot be less than 0
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
var->pixclock has type __u32, see
vi include/linux/fb.h +231
compute_gbe_timing() returns int, see
vi drivers/video/gbefb.c +466
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index f89c3cc..fe5b519 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -912,6 +912,7 @@ static int gbefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
unsigned int line_length;
struct gbe_timing_info timing;
+ int ret;
/* Limit bpp to 8, 16, and 32 */
if (var->bits_per_pixel <= 8)
@@ -930,8 +931,10 @@ static int gbefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
var->grayscale = 0; /* No grayscale for now */
- if ((var->pixclock = compute_gbe_timing(var, &timing)) < 0)
- return(-EINVAL);
+ ret = compute_gbe_timing(var, &timing);
+ var->pixclock = ret;
+ if (ret < 0)
+ return -EINVAL;
/* Adjust virtual resolution, if necessary */
if (var->xres > var->xres_virtual || (!ywrap && !ypan))
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH] gbefb: unsigned var->pixclock cannot be less than 0
@ 2008-10-29 21:29 roel kluin
0 siblings, 0 replies; 2+ messages in thread
From: roel kluin @ 2008-10-29 21:29 UTC (permalink / raw)
To: adaplas, linux-fbdev-devel
unsigned var->pixclock cannot be less than 0
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/video/gbefb.c b/drivers/video/gbefb.c
index f89c3cc..a386443 100644
--- a/drivers/video/gbefb.c
+++ b/drivers/video/gbefb.c
@@ -912,6 +912,7 @@ static int gbefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{
unsigned int line_length;
struct gbe_timing_info timing;
+ int ret;
/* Limit bpp to 8, 16, and 32 */
if (var->bits_per_pixel <= 8)
@@ -930,8 +931,10 @@ static int gbefb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
var->grayscale = 0; /* No grayscale for now */
- if ((var->pixclock = compute_gbe_timing(var, &timing)) < 0)
+ ret = compute_gbe_timing(var, &timing);
+ if (ret < 0)
return(-EINVAL);
+ var->pixclock = ret;
/* Adjust virtual resolution, if necessary */
if (var->xres > var->xres_virtual || (!ywrap && !ypan))
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-26 22:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-26 22:18 [PATCH] gbefb: unsigned var->pixclock cannot be less than 0 roel kluin
-- strict thread matches above, loose matches on Subject: below --
2008-10-29 21:29 roel kluin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).