Commit 83034782 authored by Antonino Daplas's avatar Antonino Daplas Committed by Linus Torvalds

[PATCH] fbdev: Add iomem annotations to fbmem.c

Add iomem annotations to fbmem.c
Signed-off-by: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1e9a3372
...@@ -507,7 +507,8 @@ fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) ...@@ -507,7 +507,8 @@ fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_dentry->d_inode;
int fbidx = iminor(inode); int fbidx = iminor(inode);
struct fb_info *info = registered_fb[fbidx]; struct fb_info *info = registered_fb[fbidx];
u32 *buffer, *dst, *src; u32 *buffer, *dst;
u32 __iomem *src;
int c, i, cnt = 0, err = 0; int c, i, cnt = 0, err = 0;
unsigned long total_size; unsigned long total_size;
...@@ -537,7 +538,7 @@ fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) ...@@ -537,7 +538,7 @@ fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
src = (u32 *) (info->screen_base + p); src = (u32 __iomem *) (info->screen_base + p);
if (info->fbops->fb_sync) if (info->fbops->fb_sync)
info->fbops->fb_sync(info); info->fbops->fb_sync(info);
...@@ -549,12 +550,12 @@ fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) ...@@ -549,12 +550,12 @@ fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
*dst++ = fb_readl(src++); *dst++ = fb_readl(src++);
if (c & 3) { if (c & 3) {
u8 *dst8 = (u8 *) dst; u8 *dst8 = (u8 *) dst;
u8 *src8 = (u8 *) src; u8 __iomem *src8 = (u8 __iomem *) src;
for (i = c & 3; i--;) for (i = c & 3; i--;)
*dst8++ = fb_readb(src8++); *dst8++ = fb_readb(src8++);
src = (u32 *) src8; src = (u32 __iomem *) src8;
} }
if (copy_to_user(buf, buffer, c)) { if (copy_to_user(buf, buffer, c)) {
...@@ -578,7 +579,8 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) ...@@ -578,7 +579,8 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
struct inode *inode = file->f_dentry->d_inode; struct inode *inode = file->f_dentry->d_inode;
int fbidx = iminor(inode); int fbidx = iminor(inode);
struct fb_info *info = registered_fb[fbidx]; struct fb_info *info = registered_fb[fbidx];
u32 *buffer, *dst, *src; u32 *buffer, *src;
u32 __iomem *dst;
int c, i, cnt = 0, err; int c, i, cnt = 0, err;
unsigned long total_size; unsigned long total_size;
...@@ -610,7 +612,7 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) ...@@ -610,7 +612,7 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
if (!buffer) if (!buffer)
return -ENOMEM; return -ENOMEM;
dst = (u32 *) (info->screen_base + p); dst = (u32 __iomem *) (info->screen_base + p);
if (info->fbops->fb_sync) if (info->fbops->fb_sync)
info->fbops->fb_sync(info); info->fbops->fb_sync(info);
...@@ -626,12 +628,12 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) ...@@ -626,12 +628,12 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
fb_writel(*src++, dst++); fb_writel(*src++, dst++);
if (c & 3) { if (c & 3) {
u8 *src8 = (u8 *) src; u8 *src8 = (u8 *) src;
u8 *dst8 = (u8 *) dst; u8 __iomem *dst8 = (u8 __iomem *) dst;
for (i = c & 3; i--; ) for (i = c & 3; i--; )
fb_writeb(*src8++, dst8++); fb_writeb(*src8++, dst8++);
dst = (u32 *) dst8; dst = (u32 __iomem *) dst8;
} }
*ppos += c; *ppos += c;
buf += c; buf += c;
...@@ -657,7 +659,8 @@ fb_load_cursor_image(struct fb_info *info) ...@@ -657,7 +659,8 @@ fb_load_cursor_image(struct fb_info *info)
u8 *data = (u8 *) info->cursor.image.data; u8 *data = (u8 *) info->cursor.image.data;
if (info->sprite.outbuf) if (info->sprite.outbuf)
info->sprite.outbuf(info, info->sprite.addr, data, width); info->sprite.outbuf(info, info->sprite.addr, data,
width);
else else
memcpy(info->sprite.addr, data, width); memcpy(info->sprite.addr, data, width);
} }
...@@ -851,20 +854,28 @@ int ...@@ -851,20 +854,28 @@ int
fb_blank(struct fb_info *info, int blank) fb_blank(struct fb_info *info, int blank)
{ {
/* ??? Variable sized stack allocation. */ /* ??? Variable sized stack allocation. */
u16 black[info->cmap.len];
struct fb_cmap cmap; struct fb_cmap cmap;
u16 *black = NULL;
int err = 0;
if (info->fbops->fb_blank && !info->fbops->fb_blank(blank, info)) if (info->fbops->fb_blank && !info->fbops->fb_blank(blank, info))
return 0; return 0;
if (blank) { if (blank) {
memset(black, 0, info->cmap.len * sizeof(u16)); black = kmalloc(sizeof(u16) * info->cmap.len, GFP_KERNEL);
cmap.red = cmap.green = cmap.blue = black; if (!black) {
cmap.transp = info->cmap.transp ? black : NULL; memset(black, 0, info->cmap.len * sizeof(u16));
cmap.start = info->cmap.start; cmap.red = cmap.green = cmap.blue = black;
cmap.len = info->cmap.len; cmap.transp = info->cmap.transp ? black : NULL;
cmap.start = info->cmap.start;
cmap.len = info->cmap.len;
}
} else } else
cmap = info->cmap; cmap = info->cmap;
return fb_set_cmap(&cmap, info);
err = fb_set_cmap(&cmap, info);
kfree(black);
return err;
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment