diff options
author | Holger Waechtler <devnull@localhost> | 2003-01-08 16:51:07 +0000 |
---|---|---|
committer | Holger Waechtler <devnull@localhost> | 2003-01-08 16:51:07 +0000 |
commit | c968f1b52110e481ca9e183729b3a6ad6a2d3aeb (patch) | |
tree | 4c6754f4ce3a7c7017192971cce4a47892bbb6bc /linux/drivers/media/dvb/ttpci/av7110.c | |
parent | 9b3d3cf6fad7c32c45bf4eb501daee377fcd3529 (diff) | |
download | mediapointer-dvb-s2-c968f1b52110e481ca9e183729b3a6ad6a2d3aeb.tar.gz mediapointer-dvb-s2-c968f1b52110e481ca9e183729b3a6ad6a2d3aeb.tar.bz2 |
apply optimisation patches suggested by Dr. Werner Fink <werner@suse.de>
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/av7110.c')
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110.c | 71 |
1 files changed, 29 insertions, 42 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c index 369542f6d..4c09c2eba 100644 --- a/linux/drivers/media/dvb/ttpci/av7110.c +++ b/linux/drivers/media/dvb/ttpci/av7110.c @@ -2747,24 +2747,21 @@ int av7110_ioctl(struct saa7146_dev *dev, unsigned int cmd, void *arg) static unsigned int dvb_audio_poll(struct file *file, poll_table *wait) { - struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; - av7110_t *av7110=(av7110_t *) dvbdev->priv; - unsigned int mask=0; + struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; + av7110_t *av7110 = (av7110_t *) dvbdev->priv; + unsigned int mask = 0; DEB_EE(("av7110: %p\n",av7110)); if (av7110->playing) { - if (ring_buffer_free(&av7110->aout)>20*1024) - return (POLLOUT | POLLWRNORM); - poll_wait(file, &av7110->aout.queue, wait); - + if (ring_buffer_free(&av7110->aout)>20*1024) mask |= (POLLOUT | POLLWRNORM); } else /* if not playing: may play if asked for */ - mask = (POLLOUT | POLLWRNORM); - - return mask; + mask = (POLLOUT | POLLWRNORM); + + return mask; } @@ -3284,39 +3281,32 @@ dvb_ca_open(struct inode *inode, struct file *file) return 0; } -static unsigned -int dvb_ca_poll(struct file *file, poll_table *wait) +static +unsigned int dvb_ca_poll (struct file *file, poll_table *wait) { - struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; - av7110_t *av7110=(av7110_t *) dvbdev->priv; - - unsigned int mask=0; + struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; + av7110_t *av7110 = (av7110_t *) dvbdev->priv; + unsigned int mask = 0; - ring_buffer_t *rbuf=&av7110->ci_rbuffer; - ring_buffer_t *wbuf=&av7110->ci_wbuffer; + ring_buffer_t *rbuf = &av7110->ci_rbuffer; + ring_buffer_t *wbuf = &av7110->ci_wbuffer; DEB_EE(("av7110: %p\n",av7110)); - if (!ring_buffer_empty(rbuf)) - mask|=POLLIN; - if (ring_buffer_avail(wbuf)>1024) - mask|=POLLOUT; - if (mask) - return mask; - - poll_wait(file, &rbuf->queue, wait); + poll_wait (file, &rbuf->queue, wait); if (!ring_buffer_empty(rbuf)) - mask|=POLLIN; - if (ring_buffer_avail(wbuf)>1024) - mask|=POLLOUT; - + mask |= POLLIN; + + if (ring_buffer_avail(wbuf)>1024) + mask |= POLLOUT; + return mask; } -static int -dvb_ca_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, void *parg) +static +int dvb_ca_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, void *parg) { struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; av7110_t *av7110=(av7110_t *) dvbdev->priv; @@ -3429,25 +3419,22 @@ dvb_ca_read(struct file *file, char *buf, size_t count, loff_t *ppos) * DVB device file operations ******************************************************************************/ -static unsigned int dvb_video_poll(struct file *file, poll_table *wait) +static +unsigned int dvb_video_poll(struct file *file, poll_table *wait) { - struct dvb_device *dvbdev=(struct dvb_device *) file->private_data; - av7110_t *av7110=(av7110_t *) dvbdev->priv; - unsigned int mask=0; + struct dvb_device *dvbdev = (struct dvb_device *) file->private_data; + av7110_t *av7110 = (av7110_t *) dvbdev->priv; + unsigned int mask = 0; DEB_EE(("av7110: %p\n",av7110)); if (av7110->playing) { - if (FREE_COND) - return (POLLOUT | POLLWRNORM); - poll_wait(file, &av7110->avout.queue, wait); - if (FREE_COND) mask |= (POLLOUT | POLLWRNORM); } else /* if not playing: may play if asked for */ mask = (POLLOUT | POLLWRNORM); - + return mask; } |