Commit 3ec4a307 authored by Peter Beutner's avatar Peter Beutner Committed by Linus Torvalds

[PATCH] dvb: core: dmxdev cleanups

- remove void casts
- not necessary to set filter state twice to STATE_FREE during
  dvb_dmxdev_init()
Signed-off-by: default avatarPeter Beutner <p.beutner@gmx.net>
Signed-off-by: default avatarJohannes Stezenbach <js@linuxtv.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 76197924
...@@ -42,12 +42,6 @@ MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off)."); ...@@ -42,12 +42,6 @@ MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
#define dprintk if (debug) printk #define dprintk if (debug) printk
static inline struct dmxdev_filter *
dvb_dmxdev_file_to_filter(struct file *file)
{
return (struct dmxdev_filter *) file->private_data;
}
static inline void dvb_dmxdev_buffer_init(struct dmxdev_buffer *buffer) static inline void dvb_dmxdev_buffer_init(struct dmxdev_buffer *buffer)
{ {
buffer->data=NULL; buffer->data=NULL;
...@@ -844,7 +838,7 @@ static ssize_t dvb_dmxdev_read_sec(struct dmxdev_filter *dfil, ...@@ -844,7 +838,7 @@ static ssize_t dvb_dmxdev_read_sec(struct dmxdev_filter *dfil,
static ssize_t static ssize_t
dvb_demux_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) dvb_demux_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{ {
struct dmxdev_filter *dmxdevfilter=dvb_dmxdev_file_to_filter(file); struct dmxdev_filter *dmxdevfilter= file->private_data;
int ret=0; int ret=0;
if (down_interruptible(&dmxdevfilter->mutex)) if (down_interruptible(&dmxdevfilter->mutex))
...@@ -865,7 +859,7 @@ dvb_demux_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) ...@@ -865,7 +859,7 @@ dvb_demux_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
static int dvb_demux_do_ioctl(struct inode *inode, struct file *file, static int dvb_demux_do_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *parg) unsigned int cmd, void *parg)
{ {
struct dmxdev_filter *dmxdevfilter=dvb_dmxdev_file_to_filter(file); struct dmxdev_filter *dmxdevfilter = file->private_data;
struct dmxdev *dmxdev=dmxdevfilter->dev; struct dmxdev *dmxdev=dmxdevfilter->dev;
unsigned long arg=(unsigned long) parg; unsigned long arg=(unsigned long) parg;
int ret=0; int ret=0;
...@@ -962,7 +956,7 @@ static int dvb_demux_ioctl(struct inode *inode, struct file *file, ...@@ -962,7 +956,7 @@ static int dvb_demux_ioctl(struct inode *inode, struct file *file,
static unsigned int dvb_demux_poll (struct file *file, poll_table *wait) static unsigned int dvb_demux_poll (struct file *file, poll_table *wait)
{ {
struct dmxdev_filter *dmxdevfilter = dvb_dmxdev_file_to_filter(file); struct dmxdev_filter *dmxdevfilter = file->private_data;
unsigned int mask = 0; unsigned int mask = 0;
if (!dmxdevfilter) if (!dmxdevfilter)
...@@ -987,7 +981,7 @@ static unsigned int dvb_demux_poll (struct file *file, poll_table *wait) ...@@ -987,7 +981,7 @@ static unsigned int dvb_demux_poll (struct file *file, poll_table *wait)
static int dvb_demux_release(struct inode *inode, struct file *file) static int dvb_demux_release(struct inode *inode, struct file *file)
{ {
struct dmxdev_filter *dmxdevfilter = dvb_dmxdev_file_to_filter(file); struct dmxdev_filter *dmxdevfilter = file->private_data;
struct dmxdev *dmxdev = dmxdevfilter->dev; struct dmxdev *dmxdev = dmxdevfilter->dev;
return dvb_dmxdev_filter_free(dmxdev, dmxdevfilter); return dvb_dmxdev_filter_free(dmxdev, dmxdevfilter);
...@@ -1111,7 +1105,6 @@ dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *dvb_adapter) ...@@ -1111,7 +1105,6 @@ dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *dvb_adapter)
dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE); dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE);
dmxdev->dvr[i].dev=dmxdev; dmxdev->dvr[i].dev=dmxdev;
dmxdev->dvr[i].buffer.data=NULL; dmxdev->dvr[i].buffer.data=NULL;
dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE);
dvb_dmxdev_dvr_state_set(&dmxdev->dvr[i], DMXDEV_STATE_FREE); dvb_dmxdev_dvr_state_set(&dmxdev->dvr[i], DMXDEV_STATE_FREE);
} }
......
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