From: Ville Syrjala <syrjala@sci.fi>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: akpm@linux-foundation.org, Ville Syrjala <syrjala@sci.fi>,
adaplas@gmail.com
Subject: [PATCH] fbdev: xoffset, yoffset and yres are unsigned
Date: Wed, 4 Jun 2008 12:14:20 +0300 [thread overview]
Message-ID: <1212570865-31419-2-git-send-email-syrjala@sci.fi> (raw)
In-Reply-To: <1212570865-31419-1-git-send-email-syrjala@sci.fi>
The xoffset, yoffset and yres members of fb_var_screeninfo are __u32.
Make them unsigned in the code as well.
Signed-off-by: Ville Syrjala <syrjala@sci.fi>
---
drivers/video/fbmem.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 776f7fc..5554670 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -848,9 +848,8 @@ int
fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
{
struct fb_fix_screeninfo *fix = &info->fix;
- int xoffset = var->xoffset;
- int yoffset = var->yoffset;
- int err = 0, yres = info->var.yres;
+ unsigned int yres = info->var.yres;
+ int err = 0;
if (var->yoffset > 0) {
if (var->vmode & FB_VMODE_YWRAP) {
@@ -866,8 +865,8 @@ fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
(var->xoffset % fix->xpanstep)))
err = -EINVAL;
- if (err || !info->fbops->fb_pan_display || xoffset < 0 ||
- yoffset < 0 || var->yoffset + yres > info->var.yres_virtual ||
+ if (err || !info->fbops->fb_pan_display ||
+ var->yoffset + yres > info->var.yres_virtual ||
var->xoffset + info->var.xres > info->var.xres_virtual)
return -EINVAL;
--
1.5.3.7
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
next prev parent reply other threads:[~2008-06-04 9:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-04 9:14 [PATCH] fbdev: width and height are unsigned Ville Syrjala
2008-06-04 9:14 ` Ville Syrjala [this message]
2008-06-04 9:14 ` [PATCH] atyfb: Remove dead code Ville Syrjala
2008-06-04 9:14 ` [PATCH] atyfb: correct_chipset() can fail Ville Syrjala
2008-06-04 9:14 ` [PATCH] atyfb: Use a PCI device ID table Ville Syrjala
2008-06-04 9:14 ` [PATCH] atyfb: Report probe errors Ville Syrjala
2008-06-04 9:14 ` [PATCH] atyfb: Fix a cast Ville Syrjala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1212570865-31419-2-git-send-email-syrjala@sci.fi \
--to=syrjala@sci.fi \
--cc=adaplas@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).