Skip to content

Commit

Permalink
zoran: don't bother with struct file * in zoran_map
Browse files Browse the repository at this point in the history
all we need it for is file->private_data, which is assign-once, already
assigned by that point and, incidentally, its value is already in use
by zoran ->mmap() anyway.  So just store that pointer instead...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jul 22, 2012
1 parent 3b8b487 commit 3b6456d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion drivers/media/video/zoran/zoran.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,10 @@ struct zoran_jpg_settings {
struct v4l2_jpegcompression jpg_comp; /* JPEG-specific capture settings */
};

struct zoran_fh;

struct zoran_mapping {
struct file *file;
struct zoran_fh *fh;
int count;
};

Expand Down
4 changes: 2 additions & 2 deletions drivers/media/video/zoran/zoran_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2811,7 +2811,7 @@ static void
zoran_vm_close (struct vm_area_struct *vma)
{
struct zoran_mapping *map = vma->vm_private_data;
struct zoran_fh *fh = map->file->private_data;
struct zoran_fh *fh = map->fh;
struct zoran *zr = fh->zr;
int i;

Expand Down Expand Up @@ -2938,7 +2938,7 @@ zoran_mmap (struct file *file,
res = -ENOMEM;
goto mmap_unlock_and_return;
}
map->file = file;
map->fh = fh;
map->count = 1;

vma->vm_ops = &zoran_vm_ops;
Expand Down

0 comments on commit 3b6456d

Please sign in to comment.