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)
struct inode *inode = file->f_dentry->d_inode;
int fbidx = iminor(inode);
struct fb_info *info = registered_fb[fbidx];
u32 *buffer, *dst, *src;
u32 *buffer, *dst;
u32 __iomem *src;
int c, i, cnt = 0, err = 0;
unsigned long total_size;
......@@ -537,7 +538,7 @@ fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
if (!buffer)
return -ENOMEM;
src = (u32 *) (info->screen_base + p);
src = (u32 __iomem *) (info->screen_base + p);
if (info->fbops->fb_sync)
info->fbops->fb_sync(info);
......@@ -549,12 +550,12 @@ fb_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
*dst++ = fb_readl(src++);
if (c & 3) {
u8 *dst8 = (u8 *) dst;
u8 *src8 = (u8 *) src;
u8 __iomem *src8 = (u8 __iomem *) src;
for (i = c & 3; i--;)
*dst8++ = fb_readb(src8++);
src = (u32 *) src8;
src = (u32 __iomem *) src8;
}
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)
struct inode *inode = file->f_dentry->d_inode;
int fbidx = iminor(inode);
struct fb_info *info = registered_fb[fbidx];
u32 *buffer, *dst, *src;
u32 *buffer, *src;
u32 __iomem *dst;
int c, i, cnt = 0, err;
unsigned long total_size;
......@@ -610,7 +612,7 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
if (!buffer)
return -ENOMEM;
dst = (u32 *) (info->screen_base + p);
dst = (u32 __iomem *) (info->screen_base + p);
if (info->fbops->fb_sync)
info->fbops->fb_sync(info);
......@@ -626,12 +628,12 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
fb_writel(*src++, dst++);
if (c & 3) {
u8 *src8 = (u8 *) src;
u8 *dst8 = (u8 *) dst;
u8 __iomem *dst8 = (u8 __iomem *) dst;
for (i = c & 3; i--; )
fb_writeb(*src8++, dst8++);
dst = (u32 *) dst8;
dst = (u32 __iomem *) dst8;
}
*ppos += c;
buf += c;
......@@ -657,7 +659,8 @@ fb_load_cursor_image(struct fb_info *info)
u8 *data = (u8 *) info->cursor.image.data;
if (info->sprite.outbuf)
info->sprite.outbuf(info, info->sprite.addr, data, width);
info->sprite.outbuf(info, info->sprite.addr, data,
width);
else
memcpy(info->sprite.addr, data, width);
}
......@@ -851,20 +854,28 @@ int
fb_blank(struct fb_info *info, int blank)
{
/* ??? Variable sized stack allocation. */
u16 black[info->cmap.len];
struct fb_cmap cmap;
u16 *black = NULL;
int err = 0;
if (info->fbops->fb_blank && !info->fbops->fb_blank(blank, info))
return 0;
if (blank) {
black = kmalloc(sizeof(u16) * info->cmap.len, GFP_KERNEL);
if (!black) {
memset(black, 0, info->cmap.len * sizeof(u16));
cmap.red = cmap.green = cmap.blue = black;
cmap.transp = info->cmap.transp ? black : NULL;
cmap.start = info->cmap.start;
cmap.len = info->cmap.len;
}
} else
cmap = info->cmap;
return fb_set_cmap(&cmap, info);
err = fb_set_cmap(&cmap, info);
kfree(black);
return err;
}
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