summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux/drivers/media/common/saa7146_fops.c8
-rw-r--r--linux/drivers/media/common/saa7146_vbi.c2
-rw-r--r--linux/drivers/media/common/saa7146_video.c2
-rw-r--r--linux/drivers/media/dvb/b2c2/skystar2.c12
-rw-r--r--linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c2
-rw-r--r--linux/drivers/media/dvb/dvb-core/dmxdev.c46
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c8
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_demux.c26
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_functions.c12
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_i2c.c8
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_net.c25
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c21
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h7
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvbdev.c2
-rw-r--r--linux/drivers/media/dvb/frontends/stv0299.c6
-rw-r--r--linux/drivers/media/dvb/frontends/tda1004x.c6
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c8
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_av.c71
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_ca.c42
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_hw.c10
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_ir.c2
-rw-r--r--linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c4
-rw-r--r--linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c8
-rw-r--r--linux/include/linux/dvb/osd.h2
-rw-r--r--linux/include/linux/dvb/video.h2
-rw-r--r--linux/include/media/saa7146_vv.h2
26 files changed, 188 insertions, 156 deletions
diff --git a/linux/drivers/media/common/saa7146_fops.c b/linux/drivers/media/common/saa7146_fops.c
index 5c6714dcc..cd3e5c6d0 100644
--- a/linux/drivers/media/common/saa7146_fops.c
+++ b/linux/drivers/media/common/saa7146_fops.c
@@ -83,7 +83,7 @@ int saa7146_buffer_queue(struct saa7146_dev *dev,
struct saa7146_dmaqueue *q,
struct saa7146_buf *buf)
{
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
BUG_ON(!spin_is_locked(&dev->slock));
#endif
DEB_EE(("dev:%p, dmaq:%p, buf:%p\n", dev, q, buf));
@@ -106,7 +106,7 @@ void saa7146_buffer_finish(struct saa7146_dev *dev,
struct saa7146_dmaqueue *q,
int state)
{
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
BUG_ON(!spin_is_locked(&dev->slock));
#endif
DEB_EE(("dev:%p, dmaq:%p, state:%d\n", dev, q, state));
@@ -136,7 +136,7 @@ void saa7146_buffer_next(struct saa7146_dev *dev,
DEB_INT(("dev:%p, dmaq:%p, vbi:%d\n", dev, q, vbi));
-#if DEBUG_SPINLOCKS
+#ifdef DEBUG_SPINLOCKS
BUG_ON(!spin_is_locked(&dev->slock));
#endif
if (!list_empty(&q->queue)) {
@@ -387,7 +387,7 @@ static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait)
return 0;
}
-static ssize_t fops_read(struct file *file, char *data, size_t count, loff_t *ppos)
+static ssize_t fops_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
{
struct saa7146_fh *fh = file->private_data;
diff --git a/linux/drivers/media/common/saa7146_vbi.c b/linux/drivers/media/common/saa7146_vbi.c
index 01ed438a9..e4cdfc421 100644
--- a/linux/drivers/media/common/saa7146_vbi.c
+++ b/linux/drivers/media/common/saa7146_vbi.c
@@ -460,7 +460,7 @@ static void vbi_irq_done(struct saa7146_dev *dev, unsigned long status)
spin_unlock(&dev->slock);
}
-static ssize_t vbi_read(struct file *file, char *data, size_t count, loff_t *ppos)
+static ssize_t vbi_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
{
struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev;
diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c
index daec274e5..05632374b 100644
--- a/linux/drivers/media/common/saa7146_video.c
+++ b/linux/drivers/media/common/saa7146_video.c
@@ -1457,7 +1457,7 @@ static void video_irq_done(struct saa7146_dev *dev, unsigned long st)
spin_unlock(&dev->slock);
}
-static ssize_t video_read(struct file *file, char *data, size_t count, loff_t *ppos)
+static ssize_t video_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
{
struct saa7146_fh *fh = file->private_data;
struct saa7146_dev *dev = fh->dev;
diff --git a/linux/drivers/media/dvb/b2c2/skystar2.c b/linux/drivers/media/dvb/b2c2/skystar2.c
index af5c296e1..e81e0d663 100644
--- a/linux/drivers/media/dvb/b2c2/skystar2.c
+++ b/linux/drivers/media/dvb/b2c2/skystar2.c
@@ -217,7 +217,7 @@ static int flex_i2c_write4(struct adapter *adapter, u32 device, u32 chip_addr, u
i2c_main_setup(device, chip_addr, 0, addr, buf[0], len, &command);
- return i2c_main_write_for_flex2(adapter, command, 0, 100000);
+ return i2c_main_write_for_flex2(adapter, command, NULL, 100000);
}
static void fixchipaddr(u32 device, u32 bus, u32 addr, u32 *ret)
@@ -1689,7 +1689,7 @@ static void init_dma_queue(struct adapter *adapter)
adapter->dmaq1.head = 0;
adapter->dmaq1.tail = 0;
- adapter->dmaq1.buffer = 0;
+ adapter->dmaq1.buffer = NULL;
adapter->dmaq1.buffer = pci_alloc_consistent(adapter->pdev, SIZE_OF_BUF_DMA1 + 0x80, &dma_addr);
@@ -1715,7 +1715,7 @@ static void init_dma_queue(struct adapter *adapter)
adapter->dmaq2.head = 0;
adapter->dmaq2.tail = 0;
- adapter->dmaq2.buffer = 0;
+ adapter->dmaq2.buffer = NULL;
adapter->dmaq2.buffer = pci_alloc_consistent(adapter->pdev, SIZE_OF_BUF_DMA2 + 0x80, &dma_addr);
@@ -1746,7 +1746,7 @@ static void free_dma_queue(struct adapter *adapter)
adapter->dmaq1.head = 0;
adapter->dmaq1.tail = 0;
adapter->dmaq1.buffer_size = 0;
- adapter->dmaq1.buffer = 0;
+ adapter->dmaq1.buffer = NULL;
}
if (adapter->dmaq2.buffer != 0) {
@@ -1756,7 +1756,7 @@ static void free_dma_queue(struct adapter *adapter)
adapter->dmaq2.head = 0;
adapter->dmaq2.tail = 0;
adapter->dmaq2.buffer_size = 0;
- adapter->dmaq2.buffer = 0;
+ adapter->dmaq2.buffer = NULL;
}
}
@@ -2360,7 +2360,7 @@ static int skystar2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dvbdemux->feednum = N_PID_SLOTS;
dvbdemux->start_feed = dvb_start_feed;
dvbdemux->stop_feed = dvb_stop_feed;
- dvbdemux->write_to_decoder = 0;
+ dvbdemux->write_to_decoder = NULL;
dvbdemux->dmx.capabilities = (DMX_TS_FILTERING | DMX_SECTION_FILTERING | DMX_MEMORY_BASED_FILTERING);
dvb_dmx_init(&adapter->demux);
diff --git a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
index 74a767a37..b61988a7a 100644
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -208,7 +208,7 @@ static struct dvb_bt8xx_card *dvb_bt8xx_find_by_pci(struct i2c_adapter *adap)
if (NULL == dev) {
/* shoudn't happen with 2.6.0-test7 + newer */
printk("attach: Huh? i2c adapter not in sysfs tree?\n");
- return 0;
+ return NULL;
}
pci = to_pci_dev(dev);
list_for_each(item, &card_list) {
diff --git a/linux/drivers/media/dvb/dvb-core/dmxdev.c b/linux/drivers/media/dvb/dvb-core/dmxdev.c
index 876cb1be8..741af182b 100644
--- a/linux/drivers/media/dvb/dvb-core/dmxdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dmxdev.c
@@ -56,7 +56,7 @@ dvb_dmxdev_file_to_dvr(struct dmxdev *dmxdev, struct file *file)
static inline void dvb_dmxdev_buffer_init(struct dmxdev_buffer *buffer)
{
- buffer->data=0;
+ buffer->data=NULL;
buffer->size=8192;
buffer->pread=0;
buffer->pwrite=0;
@@ -99,7 +99,7 @@ static inline int dvb_dmxdev_buffer_write(struct dmxdev_buffer *buf, const u8 *s
}
static ssize_t dvb_dmxdev_buffer_read(struct dmxdev_buffer *src,
- int non_blocking, char *buf, size_t count, loff_t *ppos)
+ int non_blocking, char __user *buf, size_t count, loff_t *ppos)
{
unsigned long todo=count;
int split, avail, error;
@@ -164,12 +164,12 @@ static struct dmx_frontend * get_fe(struct dmx_demux *demux, int type)
head=demux->get_frontends(demux);
if (!head)
- return 0;
+ return NULL;
list_for_each(pos, head)
if (DMX_FE_ENTRY(pos)->source==type)
return DMX_FE_ENTRY(pos);
- return 0;
+ return NULL;
}
static inline void dvb_dmxdev_dvr_state_set(struct dmxdev_dvr *dmxdevdvr, int state)
@@ -246,7 +246,7 @@ static int dvb_dvr_release(struct inode *inode, struct file *file)
void *mem=dmxdev->dvr_buffer.data;
mb();
spin_lock_irq(&dmxdev->lock);
- dmxdev->dvr_buffer.data=0;
+ dmxdev->dvr_buffer.data=NULL;
spin_unlock_irq(&dmxdev->lock);
vfree(mem);
}
@@ -255,7 +255,7 @@ static int dvb_dvr_release(struct inode *inode, struct file *file)
return 0;
}
-static ssize_t dvb_dvr_write(struct file *file, const char *buf,
+static ssize_t dvb_dvr_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
@@ -273,7 +273,7 @@ static ssize_t dvb_dvr_write(struct file *file, const char *buf,
return ret;
}
-static ssize_t dvb_dvr_read(struct file *file, char *buf, size_t count,
+static ssize_t dvb_dvr_read(struct file *file, char __user *buf, size_t count,
loff_t *ppos)
{
struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
@@ -306,7 +306,7 @@ static int dvb_dmxdev_set_buffer_size(struct dmxdev_filter *dmxdevfilter, unsign
return -EBUSY;
spin_lock_irq(&dmxdevfilter->dev->lock);
mem=buf->data;
- buf->data=0;
+ buf->data=NULL;
buf->size=size;
buf->pwrite=buf->pread=0;
spin_unlock_irq(&dmxdevfilter->dev->lock);
@@ -499,7 +499,7 @@ static int dvb_dmxdev_filter_stop(struct dmxdev_filter *dmxdevfilter)
release_filter(dmxdevfilter->feed.sec,
dmxdevfilter->filter.sec);
dvb_dmxdev_feed_restart(dmxdevfilter);
- dmxdevfilter->feed.sec=0;
+ dmxdevfilter->feed.sec=NULL;
break;
case DMXDEV_TYPE_PES:
if (!dmxdevfilter->feed.ts)
@@ -508,7 +508,7 @@ static int dvb_dmxdev_filter_stop(struct dmxdev_filter *dmxdevfilter)
dmxdevfilter->dev->demux->
release_ts_feed(dmxdevfilter->dev->demux,
dmxdevfilter->feed.ts);
- dmxdevfilter->feed.ts=0;
+ dmxdevfilter->feed.ts=NULL;
break;
default:
if (dmxdevfilter->state==DMXDEV_STATE_ALLOCATED)
@@ -560,8 +560,8 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter)
struct dmx_section_filter **secfilter=&filter->filter.sec;
struct dmx_section_feed **secfeed=&filter->feed.sec;
- *secfilter=0;
- *secfeed=0;
+ *secfilter=NULL;
+ *secfeed=NULL;
/* find active filter/feed with same PID */
for (i=0; i<dmxdev->filternum; i++) {
@@ -642,7 +642,7 @@ static int dvb_dmxdev_filter_start(struct dmxdev_filter *filter)
enum dmx_ts_pes ts_pes;
struct dmx_ts_feed **tsfeed = &filter->feed.ts;
- filter->feed.ts = 0;
+ filter->feed.ts = NULL;
otype=para->output;
ts_pes=(enum dmx_ts_pes) para->pes_type;
@@ -719,7 +719,7 @@ static int dvb_demux_open(struct inode *inode, struct file *file)
dvb_dmxdev_buffer_init(&dmxdevfilter->buffer);
dmxdevfilter->type=DMXDEV_TYPE_NONE;
dvb_dmxdev_filter_state_set(dmxdevfilter, DMXDEV_STATE_ALLOCATED);
- dmxdevfilter->feed.ts=0;
+ dmxdevfilter->feed.ts=NULL;
init_timer(&dmxdevfilter->timer);
up(&dmxdev->mutex);
@@ -744,7 +744,7 @@ static int dvb_dmxdev_filter_free(struct dmxdev *dmxdev, struct dmxdev_filter *d
void *mem=dmxdevfilter->buffer.data;
spin_lock_irq(&dmxdev->lock);
- dmxdevfilter->buffer.data=0;
+ dmxdevfilter->buffer.data=NULL;
spin_unlock_irq(&dmxdev->lock);
vfree(mem);
}
@@ -808,7 +808,7 @@ static int dvb_dmxdev_pes_filter_set(struct dmxdev *dmxdev,
}
static ssize_t dvb_dmxdev_read_sec(struct dmxdev_filter *dfil,
- struct file *file, char *buf, size_t count, loff_t *ppos)
+ struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
int result, hcount;
int done=0;
@@ -847,7 +847,7 @@ static ssize_t dvb_dmxdev_read_sec(struct dmxdev_filter *dfil,
ssize_t
-dvb_demux_read(struct file *file, char *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);
int ret=0;
@@ -1010,7 +1010,7 @@ static struct file_operations dvb_demux_fops = {
static struct dvb_device dvbdev_demux = {
- .priv = 0,
+ .priv = NULL,
.users = 1,
.writers = 1,
.fops = &dvb_demux_fops
@@ -1083,7 +1083,7 @@ static struct file_operations dvb_dvr_fops = {
};
static struct dvb_device dvbdev_dvr = {
- .priv = 0,
+ .priv = NULL,
.users = 1,
.writers = 1,
.fops = &dvb_dvr_fops
@@ -1112,10 +1112,10 @@ dvb_dmxdev_init(struct dmxdev *dmxdev, struct dvb_adapter *dvb_adapter)
spin_lock_init(&dmxdev->lock);
for (i=0; i<dmxdev->filternum; i++) {
dmxdev->filter[i].dev=dmxdev;
- dmxdev->filter[i].buffer.data=0;
+ dmxdev->filter[i].buffer.data=NULL;
dvb_dmxdev_filter_state_set(&dmxdev->filter[i], DMXDEV_STATE_FREE);
dmxdev->dvr[i].dev=dmxdev;
- dmxdev->dvr[i].buffer.data=0;
+ 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);
}
@@ -1136,12 +1136,12 @@ dvb_dmxdev_release(struct dmxdev *dmxdev)
if (dmxdev->filter) {
vfree(dmxdev->filter);
- dmxdev->filter=0;
+ dmxdev->filter=NULL;
}
if (dmxdev->dvr) {
vfree(dmxdev->dvr);
- dmxdev->dvr=0;
+ dmxdev->dvr=NULL;
}
dmxdev->demux->close(dmxdev->demux);
}
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
index 346138f3b..f93be91a9 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
@@ -621,7 +621,7 @@ static int dvb_ca_en50221_read_data(struct dvb_ca_private* ca, int slot, u8* ebu
/* OK, add it to the receive buffer, or copy into external buffer if supplied */
if (ebuf == NULL) {
down_read(&ca->slot_info[slot].sem);
- dvb_ringbuffer_pkt_write(&ca->slot_info[slot].rx_buffer, buf, bytes_read, 0);
+ dvb_ringbuffer_pkt_write(&ca->slot_info[slot].rx_buffer, buf, bytes_read);
up_read(&ca->slot_info[slot].sem);
} else {
memcpy(ebuf, buf, bytes_read);
@@ -1180,7 +1180,7 @@ static int dvb_ca_en50221_io_ioctl(struct inode *inode, struct file *file, unsig
*
* @return Number of bytes read, or <0 on error.
*/
-static ssize_t dvb_ca_en50221_io_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+static ssize_t dvb_ca_en50221_io_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
struct dvb_ca_private *ca=(struct dvb_ca_private*) dvbdev->priv;
@@ -1295,7 +1295,7 @@ nextslot:
*
* @return Number of bytes read, or <0 on error.
*/
-static ssize_t dvb_ca_en50221_io_read(struct file *file, char *buf, size_t count, loff_t *ppos)
+static ssize_t dvb_ca_en50221_io_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
struct dvb_device *dvbdev=(struct dvb_device *) file->private_data;
struct dvb_ca_private *ca=(struct dvb_ca_private*) dvbdev->priv;
@@ -1488,7 +1488,7 @@ static struct file_operations dvb_ca_fops = {
};
static struct dvb_device dvbdev_ca = {
- priv: 0,
+ priv: NULL,
users: 1,
readers: 1,
writers: 1,
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.c b/linux/drivers/media/dvb/dvb-core/dvb_demux.c
index ccf8a5b66..3e965f01e 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_demux.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.c
@@ -162,7 +162,7 @@ static inline int dvb_dmx_swfilter_payload (struct dvb_demux_feed *feed, const u
feed->peslen += count;
- return feed->cb.ts (&buf[p], count, 0, 0, &feed->feed.ts, DMX_OK);
+ return feed->cb.ts (&buf[p], count, NULL, 0, &feed->feed.ts, DMX_OK);
}
@@ -185,7 +185,7 @@ static int dvb_dmx_swfilter_sectionfilter (struct dvb_demux_feed *feed,
return 0;
return feed->cb.sec (feed->feed.sec.secbuf, feed->feed.sec.seclen,
- 0, 0, &f->filter, DMX_OK);
+ NULL, 0, &f->filter, DMX_OK);
}
@@ -375,7 +375,7 @@ static inline void dvb_dmx_swfilter_packet_type(struct dvb_demux_feed *feed, con
if (feed->ts_type & TS_PAYLOAD_ONLY)
dvb_dmx_swfilter_payload(feed, buf);
else
- feed->cb.ts(buf, 188, 0, 0, &feed->feed.ts, DMX_OK);
+ feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK);
}
if (feed->ts_type & TS_DECODER)
if (feed->demux->write_to_decoder)
@@ -424,7 +424,7 @@ void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
}
if (feed->pid == 0x2000)
- feed->cb.ts(buf, 188, 0, 0, &feed->feed.ts, DMX_OK);
+ feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK);
}
}
@@ -644,7 +644,7 @@ static int dmx_ts_feed_set (struct dmx_ts_feed* ts_feed, u16 pid, int ts_type,
if (feed->buffer_size) {
#ifdef NOBUFS
- feed->buffer=0;
+ feed->buffer=NULL;
#else
feed->buffer = vmalloc(feed->buffer_size);
if (!feed->buffer) {
@@ -743,11 +743,11 @@ static int dvbdmx_allocate_ts_feed (struct dmx_demux *dmx, struct dmx_ts_feed **
feed->demux = demux;
feed->pid = 0xffff;
feed->peslen = 0xfffa;
- feed->buffer = 0;
+ feed->buffer = NULL;
(*ts_feed) = &feed->feed.ts;
(*ts_feed)->parent = dmx;
- (*ts_feed)->priv = 0;
+ (*ts_feed)->priv = NULL;
(*ts_feed)->is_filtering = 0;
(*ts_feed)->start_filtering = dmx_ts_feed_start_filtering;
(*ts_feed)->stop_filtering = dmx_ts_feed_stop_filtering;
@@ -827,7 +827,7 @@ static int dmx_section_feed_allocate_filter(struct dmx_section_feed* feed,
spin_lock_irq(&dvbdemux->lock);
*filter = &dvbdmxfilter->filter;
(*filter)->parent = feed;
- (*filter)->priv = 0;
+ (*filter)->priv = NULL;
dvbdmxfilter->feed = dvbdmxfeed;
dvbdmxfilter->type = DMX_TYPE_SEC;
dvbdmxfilter->state = DMX_STATE_READY;
@@ -866,7 +866,7 @@ static int dmx_section_feed_set(struct dmx_section_feed* feed,
dvbdmxfeed->feed.sec.check_crc = check_crc;
#ifdef NOBUFS
- dvbdmxfeed->buffer = 0;
+ dvbdmxfeed->buffer = NULL;
#else
dvbdmxfeed->buffer=vmalloc(dvbdmxfeed->buffer_size);
if (!dvbdmxfeed->buffer) {
@@ -1033,13 +1033,13 @@ static int dvbdmx_allocate_section_feed(struct dmx_demux *demux,
dvbdmxfeed->feed.sec.secbuf = dvbdmxfeed->feed.sec.secbuf_base;
dvbdmxfeed->feed.sec.secbufp = dvbdmxfeed->feed.sec.seclen = 0;
dvbdmxfeed->feed.sec.tsfeedp = 0;
- dvbdmxfeed->filter = 0;
- dvbdmxfeed->buffer = 0;
+ dvbdmxfeed->filter = NULL;
+ dvbdmxfeed->buffer = NULL;
(*feed)=&dvbdmxfeed->feed.sec;
(*feed)->is_filtering = 0;
(*feed)->parent = demux;
- (*feed)->priv = 0;
+ (*feed)->priv = NULL;
(*feed)->set = dmx_section_feed_set;
(*feed)->allocate_filter = dmx_section_feed_allocate_filter;
@@ -1251,7 +1251,7 @@ int dvb_dmx_init(struct dvb_demux *dvbdemux)
if (!dvbdemux->memcopy)
dvbdemux->memcopy = dvb_dmx_memcopy;
- dmx->frontend = 0;
+ dmx->frontend = NULL;
dmx->reg_list.prev = dmx->reg_list.next = &dmx->reg_list;
dmx->priv = (void *) dvbdemux;
dmx->open = dvbdmx_open;
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_functions.c b/linux/drivers/media/dvb/dvb-core/dvb_functions.c
index fb53bf492..7530287f4 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_functions.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_functions.c
@@ -35,8 +35,12 @@ int dvb_usercopy(struct inode *inode, struct file *file,
/* Copy arguments into temp kernel buffer */
switch (_IOC_DIR(cmd)) {
case _IOC_NONE:
- parg = (void *)arg;
- break;
+ /*
+ * For this command, the pointer is actually an integer
+ * argument.
+ */
+ parg = (void *) arg;
+ break;
case _IOC_READ: /* some v4l ioctls are marked wrong ... */
case _IOC_WRITE:
case (_IOC_WRITE | _IOC_READ):
@@ -51,7 +55,7 @@ int dvb_usercopy(struct inode *inode, struct file *file,
}
err = -EFAULT;
- if (copy_from_user(parg, (void *)arg, _IOC_SIZE(cmd)))
+ if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd)))
goto out;
break;
}
@@ -68,7 +72,7 @@ int dvb_usercopy(struct inode *inode, struct file *file,
{
case _IOC_READ:
case (_IOC_WRITE | _IOC_READ):
- if (copy_to_user((void *)arg, parg, _IOC_SIZE(cmd)))
+ if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd)))
err = -EFAULT;
break;
}
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_i2c.c b/linux/drivers/media/dvb/dvb-core/dvb_i2c.c
index fd4989f4f..8bc8b5e7b 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_i2c.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_i2c.c
@@ -191,8 +191,10 @@ dvb_register_i2c_bus (int (*xfer) (struct dvb_i2c_bus *i2c,
if (down_interruptible (&dvb_i2c_mutex))
return NULL;
- if (!(i2c = kmalloc (sizeof (struct dvb_i2c_bus), GFP_KERNEL)))
+ if (!(i2c = kmalloc (sizeof (struct dvb_i2c_bus), GFP_KERNEL))) {
+ up (&dvb_i2c_mutex);
return NULL;
+ }
INIT_LIST_HEAD(&i2c->list_head);
INIT_LIST_HEAD(&i2c->client_list);
@@ -239,8 +241,10 @@ int dvb_register_i2c_device (struct module *owner,
if (down_interruptible (&dvb_i2c_mutex))
return -ERESTARTSYS;
- if (!(entry = kmalloc (sizeof (struct dvb_i2c_device), GFP_KERNEL)))
+ if (!(entry = kmalloc (sizeof (struct dvb_i2c_device), GFP_KERNEL))) {
+ up(&dvb_i2c_mutex);
return -ENOMEM;
+ }
entry->owner = owner;
entry->attach = attach;
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_net.c b/linux/drivers/media/dvb/dvb-core/dvb_net.c
index cbaf4155c..780a02fb6 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_net.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_net.c
@@ -677,7 +677,7 @@ static int dvb_net_filter_sec_set(struct net_device *dev,
struct dvb_net_priv *priv = (struct dvb_net_priv*) dev->priv;
int ret;
- *secfilter=0;
+ *secfilter=NULL;
ret = priv->secfeed->allocate_filter(priv->secfeed, secfilter);
if (ret<0) {
printk("%s: could not get filter\n", dev->name);
@@ -726,9 +726,9 @@ static int dvb_net_feed_start(struct net_device *dev)
if (priv->secfeed || priv->secfilter || priv->multi_secfilter[0])
printk("%s: BUG %d\n", __FUNCTION__, __LINE__);
- priv->secfeed=0;
- priv->secfilter=0;
- priv->tsfeed = 0;
+ priv->secfeed=NULL;
+ priv->secfilter=NULL;
+ priv->tsfeed = NULL;
if (priv->feedtype == DVB_NET_FEEDTYPE_MPE) {
dprintk("%s: alloc secfeed\n", __FUNCTION__);
@@ -744,7 +744,7 @@ static int dvb_net_feed_start(struct net_device *dev)
if (ret<0) {
printk("%s: could not set section feed\n", dev->name);
priv->demux->release_section_feed(priv->demux, priv->secfeed);
- priv->secfeed=0;
+ priv->secfeed=NULL;
return ret;
}
@@ -799,7 +799,7 @@ static int dvb_net_feed_start(struct net_device *dev)
if (ret < 0) {
printk("%s: could not set ts feed\n", dev->name);
priv->demux->release_ts_feed(priv->demux, priv->tsfeed);
- priv->tsfeed = 0;
+ priv->tsfeed = NULL;
return ret;
}
@@ -828,7 +828,7 @@ static int dvb_net_feed_stop(struct net_device *dev)
dprintk("%s: release secfilter\n", __FUNCTION__);
priv->secfeed->release_filter(priv->secfeed,
priv->secfilter);
- priv->secfilter=0;
+ priv->secfilter=NULL;
}
for (i=0; i<priv->multi_num; i++) {
@@ -837,12 +837,12 @@ static int dvb_net_feed_stop(struct net_device *dev)
__FUNCTION__, i);
priv->secfeed->release_filter(priv->secfeed,
priv->multi_secfilter[i]);
- priv->multi_secfilter[i] = 0;
+ priv->multi_secfilter[i] = NULL;
}
}
priv->demux->release_section_feed(priv->demux, priv->secfeed);
- priv->secfeed = 0;
+ priv->secfeed = NULL;
} else
printk("%s: no feed to stop\n", dev->name);
} else if (priv->feedtype == DVB_NET_FEEDTYPE_ULE) {
@@ -852,7 +852,7 @@ static int dvb_net_feed_stop(struct net_device *dev)
priv->tsfeed->stop_filtering(priv->tsfeed);
}
priv->demux->release_ts_feed(priv->demux, priv->tsfeed);
- priv->tsfeed = 0;
+ priv->tsfeed = NULL;
}
else
printk("%s: no ts feed to stop\n", dev->name);
@@ -1176,16 +1176,13 @@ static int dvb_net_ioctl(struct inode *inode, struct file *file,
static struct file_operations dvb_net_fops = {
.owner = THIS_MODULE,
- .read = 0,
- .write = 0,
.ioctl = dvb_net_ioctl,
.open = dvb_generic_open,
.release = dvb_generic_release,
- .poll = 0,
};
static struct dvb_device dvbdev_net = {
- .priv = 0,
+ .priv = NULL,
.users = 1,
.writers = 1,
.fops = &dvb_net_fops,
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
index d761c3fe3..fb6d94a69 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
@@ -133,8 +133,7 @@ ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, size_t len, in
-ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
- size_t len, int usermem)
+ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf, size_t len)
{
size_t todo = len;
size_t split;
@@ -142,28 +141,18 @@ ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
split = (rbuf->pwrite + len > rbuf->size) ? rbuf->size - rbuf->pwrite : 0;
if (split > 0) {
- if (!usermem)
- memcpy(rbuf->data+rbuf->pwrite, buf, split);
- else
- if (copy_from_user(rbuf->data+rbuf->pwrite,
- buf, split))
- return -EFAULT;
+ memcpy(rbuf->data+rbuf->pwrite, buf, split);
buf += split;
todo -= split;
rbuf->pwrite = 0;
}
- if (!usermem)
- memcpy(rbuf->data+rbuf->pwrite, buf, todo);
- else
- if (copy_from_user(rbuf->data+rbuf->pwrite, buf, todo))
- return -EFAULT;
-
+ memcpy(rbuf->data+rbuf->pwrite, buf, todo);
rbuf->pwrite = (rbuf->pwrite + todo) % rbuf->size;
return len;
}
-ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t len, int usermem)
+ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t len)
{
int status;
ssize_t oldpwrite = rbuf->pwrite;
@@ -171,7 +160,7 @@ ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t le
DVB_RINGBUFFER_WRITE_BYTE(rbuf, len >> 8);
DVB_RINGBUFFER_WRITE_BYTE(rbuf, len & 0xff);
DVB_RINGBUFFER_WRITE_BYTE(rbuf, PKT_READY);
- status = dvb_ringbuffer_write(rbuf, buf, len, usermem);
+ status = dvb_ringbuffer_write(rbuf, buf, len);
if (status < 0) rbuf->pwrite = oldpwrite;
return status;
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
index c72f6cb82..d18e9c4ba 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
+++ b/linux/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
@@ -53,7 +53,7 @@ struct dvb_ringbuffer {
** *** write <buflen> bytes ***
** free = dvb_ringbuffer_free(rbuf);
** if (free >= buflen)
-** count = dvb_ringbuffer_write(rbuf, buffer, buflen, 0);
+** count = dvb_ringbuffer_write(rbuf, buffer, buflen);
** else
** ...
**
@@ -121,7 +121,7 @@ extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf,
** returns number of bytes transferred or -EFAULT
*/
extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
- size_t len, int usermem);
+ size_t len);
/**
@@ -130,11 +130,10 @@ extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
* <rbuf> Ringbuffer to write to.
* <buf> Buffer to write.
* <len> Length of buffer (currently limited to 65535 bytes max).
- * <usermem> Set to 1 if <buf> is in userspace.
* returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL.
*/
extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,
- size_t len, int usermem);
+ size_t len);
/**
* Read from a packet in the ringbuffer. Note: unlike dvb_ringbuffer_read(), this
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c
index 5066ff0aa..a41bd09f5 100644
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c
@@ -194,7 +194,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
if ((id = dvbdev_get_free_id (adap, type)) < 0) {
up (&dvbdev_register_lock);
- *pdvbdev = 0;
+ *pdvbdev = NULL;
printk ("%s: could get find free device id...\n", __FUNCTION__);
return -ENFILE;
}
diff --git a/linux/drivers/media/dvb/frontends/stv0299.c b/linux/drivers/media/dvb/frontends/stv0299.c
index af1429a35..9e730039d 100644
--- a/linux/drivers/media/dvb/frontends/stv0299.c
+++ b/linux/drivers/media/dvb/frontends/stv0299.c
@@ -430,8 +430,6 @@ static int tsa5059_set_tv_freq (struct i2c_adapter *i2c, u32 freq, int ftype, in
}
-
-#define ABS(x) ((x) < 0 ? -(x) : (x))
#define MIN2(a,b) ((a) < (b) ? (a) : (b))
#define MIN3(a,b,c) MIN2(MIN2(a,b),c)
@@ -448,8 +446,8 @@ static int tua6100_set_tv_freq (struct i2c_adapter *i2c, u32 freq,
first_ZF = (freq) / 1000;
- if (ABS(MIN2(ABS(first_ZF-1190),ABS(first_ZF-1790))) <
- ABS(MIN3(ABS(first_ZF-1202),ABS(first_ZF-1542),ABS(first_ZF-1890))))
+ if (abs(MIN2(abs(first_ZF-1190),abs(first_ZF-1790))) <
+ abs(MIN3(abs(first_ZF-1202),abs(first_ZF-1542),abs(first_ZF-1890))))
_fband = 2;
else
_fband = 3;
diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c
index 69c7bfd82..7ea4dff61 100644
--- a/linux/drivers/media/dvb/frontends/tda1004x.c
+++ b/linux/drivers/media/dvb/frontends/tda1004x.c
@@ -521,7 +521,7 @@ static int tda10046_fwupload(struct i2c_adapter *i2c, struct tda1004x_state *sta
static int tda10045h_init(struct i2c_adapter *i2c, struct tda1004x_state *tda_state)
{
- struct i2c_msg tuner_msg = {.addr = 0,.flags = 0,.buf = 0,.len = 0 };
+ struct i2c_msg tuner_msg = {.addr = 0,.flags = 0,.buf = NULL,.len = 0 };
static u8 disable_mc44BC374c[] = { 0x1d, 0x74, 0xa0, 0x68 };
dprintk("%s\n", __FUNCTION__);
@@ -556,7 +556,7 @@ static int tda10045h_init(struct i2c_adapter *i2c, struct tda1004x_state *tda_st
static int tda10046h_init(struct i2c_adapter *i2c, struct tda1004x_state *tda_state)
{
- struct i2c_msg tuner_msg = {.addr = 0,.flags = 0,.buf = 0,.len = 0 };
+ struct i2c_msg tuner_msg = {.addr = 0,.flags = 0,.buf = NULL,.len = 0 };
static u8 disable_mc44BC374c[] = { 0x1d, 0x74, 0xa0, 0x68 };
dprintk("%s\n", __FUNCTION__);
@@ -1353,7 +1353,7 @@ static int tda1004x_attach(struct i2c_adapter *i2c, struct tda1004x_state* state
int tuner_address = -1;
int fe_type = -1;
int tuner_type = -1;
- struct i2c_msg tuner_msg = {.addr=0, .flags=0, .buf=0, .len=0 };
+ struct i2c_msg tuner_msg = {.addr=0, .flags=0, .buf=NULL, .len=0 };
static u8 td1344_init[] = { 0x0b, 0xf5, 0x88, 0xab };
static u8 td1316_init[] = { 0x0b, 0xf5, 0x85, 0xab };
static u8 td1316_init_tda10046h[] = { 0x0b, 0xf5, 0x80, 0xab };
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index f8a34b67c..e3e7105b7 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -389,7 +389,7 @@ static void debiirq (unsigned long data)
case DATA_PIPING:
if (av7110->handle2filter[handle])
DvbDmxFilterCallback((u8 *)av7110->debi_virt,
- av7110->debilen, 0, 0,
+ av7110->debilen, NULL, 0,
av7110->handle2filter[handle],
DMX_OK, av7110);
spin_lock(&av7110->debilock);
@@ -722,7 +722,7 @@ static struct file_operations dvb_osd_fops = {
};
static struct dvb_device dvbdev_osd = {
- .priv = 0,
+ .priv = NULL,
.users = 1,
.writers = 1,
.fops = &dvb_osd_fops,
@@ -999,7 +999,7 @@ static int av7110_stop_feed(struct dvb_demux_feed *feed)
!demux->pesfilter[feed->pes_type])
return -EINVAL;
demux->pids[feed->pes_type] |= 0x8000;
- demux->pesfilter[feed->pes_type] = 0;
+ demux->pesfilter[feed->pes_type] = NULL;
}
if (feed->ts_type & TS_DECODER &&
feed->pes_type < DMX_TS_PES_OTHER) {
@@ -1526,7 +1526,7 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d
/* ARM "watchdog" */
init_waitqueue_head(&av7110->arm_wait);
- av7110->arm_thread = 0;
+ av7110->arm_thread = NULL;
/* allocate and init buffers */
av7110->debi_virt = pci_alloc_consistent(dev->pci, 8192,
diff --git a/linux/drivers/media/dvb/ttpci/av7110_av.c b/linux/drivers/media/dvb/ttpci/av7110_av.c
index 05d6e57d3..ec3fe823f 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_av.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_av.c
@@ -105,7 +105,7 @@ int av7110_record_cb(struct dvb_filter_pes2ts *p2t, u8 *buf, size_t len)
if (buf[3] == 0xe0) // video PES do not have a length in TS
buf[4] = buf[5] = 0;
if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY)
- return dvbdmxfeed->cb.ts(buf, len, 0, 0,
+ return dvbdmxfeed->cb.ts(buf, len, NULL, 0,
&dvbdmxfeed->feed.ts, DMX_OK);
else
return dvb_filter_pes2ts(p2t, buf, len, 1);
@@ -117,7 +117,7 @@ static int dvb_filter_pes2ts_cb(void *priv, unsigned char *data)
// DEB_EE(("dvb_demux_feed:%p\n", dvbdmxfeed));
- dvbdmxfeed->cb.ts(data, 188, 0, 0,
+ dvbdmxfeed->cb.ts(data, 188, NULL, 0,
&dvbdmxfeed->feed.ts, DMX_OK);
return 0;
}
@@ -391,7 +391,7 @@ static inline long aux_ring_buffer_write(struct dvb_ringbuffer *rbuf,
free = dvb_ringbuffer_free(rbuf);
if (free > todo)
free = todo;
- dvb_ringbuffer_write(rbuf, buf, free, 0);
+ dvb_ringbuffer_write(rbuf, buf, free);
todo -= free;
buf += free;
}
@@ -422,8 +422,8 @@ static void play_audio_cb(u8 *buf, int count, void *priv)
#define FREE_COND (dvb_ringbuffer_free(&av7110->avout) >= 20 * 1024 && \
dvb_ringbuffer_free(&av7110->aout) >= 20 * 1024)
-static ssize_t dvb_play(struct av7110 *av7110, const u8 *buf,
- unsigned long count, int nonblock, int type, int umem)
+static ssize_t dvb_play(struct av7110 *av7110, const u8 __user *buf,
+ unsigned long count, int nonblock, int type)
{
unsigned long todo = count, n;
DEB_EE(("av7110: %p\n", av7110));
@@ -445,22 +445,47 @@ static ssize_t dvb_play(struct av7110 *av7110, const u8 *buf,
n = todo;
if (n > IPACKS * 2)
n = IPACKS * 2;
- if (umem) {
- if (copy_from_user(av7110->kbuf[type], buf, n))
- return -EFAULT;
- av7110_ipack_instant_repack(av7110->kbuf[type], n,
- &av7110->ipack[type]);
- } else {
- av7110_ipack_instant_repack(buf, n,
- &av7110->ipack[type]);
+ if (copy_from_user(av7110->kbuf[type], buf, n))
+ return -EFAULT;
+ av7110_ipack_instant_repack(av7110->kbuf[type], n,
+ &av7110->ipack[type]);
+ todo -= n;
+ buf += n;
+ }
+ return count - todo;
+}
+
+static ssize_t dvb_play_kernel(struct av7110 *av7110, const u8 *buf,
+ unsigned long count, int nonblock, int type)
+{
+ unsigned long todo = count, n;
+ DEB_EE(("av7110: %p\n", av7110));
+
+ if (!av7110->kbuf[type])
+ return -ENOBUFS;
+
+ if (nonblock && !FREE_COND)
+ return -EWOULDBLOCK;
+
+ while (todo > 0) {
+ if (!FREE_COND) {
+ if (nonblock)
+ return count - todo;
+ if (wait_event_interruptible(av7110->avout.queue,
+ FREE_COND))
+ return count - todo;
}
+ n = todo;
+ if (n > IPACKS * 2)
+ n = IPACKS * 2;
+ av7110_ipack_instant_repack(buf, n, &av7110->ipack[type]);
todo -= n;
buf += n;
}
return count - todo;
}
-static ssize_t dvb_aplay(struct av7110 *av7110, const u8 *buf,
+static ssize_t dvb_aplay(struct av7110 *av7110, const u8 __user *buf,
unsigned long count, int nonblock, int type)
{
unsigned long todo = count, n;
@@ -731,7 +756,7 @@ static void p_to_t(u8 const *buf, long int length, u16 pid, u8 *counter,
memcpy(obuf + l, buf + c, TS_SIZE - l);
c = length;
}
- feed->cb.ts(obuf, 188, 0, 0, &feed->feed.ts, DMX_OK);
+ feed->cb.ts(obuf, 188, NULL, 0, &feed->feed.ts, DMX_OK);
pes_start = 0;
}
}
@@ -869,7 +894,7 @@ static unsigned int dvb_video_poll(struct file *file, poll_table *wait)
return mask;
}
-static ssize_t dvb_video_write(struct file *file, const char *buf,
+static ssize_t dvb_video_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
@@ -883,7 +908,7 @@ static ssize_t dvb_video_write(struct file *file, const char *buf,
if (av7110->videostate.stream_source != VIDEO_SOURCE_MEMORY)
return -EPERM;
- return dvb_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 1, 1);
+ return dvb_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 1);
}
static unsigned int dvb_audio_poll(struct file *file, poll_table *wait)
@@ -905,7 +930,7 @@ static unsigned int dvb_audio_poll(struct file *file, poll_table *wait)
return mask;
}
-static ssize_t dvb_audio_write(struct file *file, const char *buf,
+static ssize_t dvb_audio_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
@@ -924,7 +949,7 @@ u8 iframe_header[] = { 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x80, 0x00, 0x00 };
#define MIN_IFRAME 400000
-static int play_iframe(struct av7110 *av7110, u8 *buf, unsigned int len, int nonblock)
+static int play_iframe(struct av7110 *av7110, u8 __user *buf, unsigned int len, int nonblock)
{
int i, n;
@@ -940,10 +965,10 @@ static int play_iframe(struct av7110 *av7110, u8 *buf, unsigned int len, int non
n = MIN_IFRAME / len + 1;
/* FIXME: nonblock? */
- dvb_play(av7110, iframe_header, sizeof(iframe_header), 0, 1, 0);
+ dvb_play_kernel(av7110, iframe_header, sizeof(iframe_header), 0, 1);
for (i = 0; i < n; i++)
- dvb_play(av7110, buf, len, 0, 1, 1);
+ dvb_play(av7110, buf, len, 0, 1);
av7110_ipack_flush(&av7110->ipack[1]);
return 0;
@@ -1345,7 +1370,7 @@ static struct file_operations dvb_video_fops = {
};
static struct dvb_device dvbdev_video = {
- .priv = 0,
+ .priv = NULL,
.users = 6,
.readers = 5, /* arbitrary */
.writers = 1,
@@ -1363,7 +1388,7 @@ static struct file_operations dvb_audio_fops = {
};
static struct dvb_device dvbdev_audio = {
- .priv = 0,
+ .priv = NULL,
.users = 1,
.writers = 1,
.fops = &dvb_audio_fops,
diff --git a/linux/drivers/media/dvb/ttpci/av7110_ca.c b/linux/drivers/media/dvb/ttpci/av7110_ca.c
index cf91bb318..7e31d3236 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_ca.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_ca.c
@@ -81,7 +81,7 @@ void ci_get_data(struct dvb_ringbuffer *cibuf, u8 *data, int len)
DVB_RINGBUFFER_WRITE_BYTE(cibuf, len >> 8);
DVB_RINGBUFFER_WRITE_BYTE(cibuf, len & 0xff);
- dvb_ringbuffer_write(cibuf, data, len, 0);
+ dvb_ringbuffer_write(cibuf, data, len);
wake_up_interruptible(&cibuf->queue);
}
@@ -106,9 +106,9 @@ void ci_ll_flush(struct dvb_ringbuffer *cirbuf, struct dvb_ringbuffer *ciwbuf)
void ci_ll_release(struct dvb_ringbuffer *cirbuf, struct dvb_ringbuffer *ciwbuf)
{
vfree(cirbuf->data);
- cirbuf->data = 0;
+ cirbuf->data = NULL;
vfree(ciwbuf->data);
- ciwbuf->data = 0;
+ ciwbuf->data = NULL;
}
int ci_ll_reset(struct dvb_ringbuffer *cibuf, struct file *file,
@@ -129,7 +129,7 @@ int ci_ll_reset(struct dvb_ringbuffer *cibuf, struct file *file,
for (i = 0; i < 2; i++) {
if (slots & (1 << i)) {
msg[2] = i;
- dvb_ringbuffer_write(cibuf, msg, 8, 0);
+ dvb_ringbuffer_write(cibuf, msg, 8);
slot[i].flags = 0;
}
}
@@ -138,30 +138,46 @@ int ci_ll_reset(struct dvb_ringbuffer *cibuf, struct file *file,
}
static ssize_t ci_ll_write(struct dvb_ringbuffer *cibuf, struct file *file,
- const char *buf, size_t count, loff_t *ppos)
+ const char __user *buf, size_t count, loff_t *ppos)
{
int free;
int non_blocking = file->f_flags & O_NONBLOCK;
+ char *page = (char *)__get_free_page(GFP_USER);
+ int res;
+ if (!page)
+ return -ENOMEM;
+
+ res = -EINVAL;
if (count > 2048)
- return -EINVAL;
+ goto out;
+
+ res = -EFAULT;
+ if (copy_from_user(page, buf, count))
+ goto out;
+
free = dvb_ringbuffer_free(cibuf);
if (count + 2 > free) {
+ res = -EWOULDBLOCK;
if (non_blocking)
- return -EWOULDBLOCK;
+ goto out;
+ res = -ERESTARTSYS;
if (wait_event_interruptible(cibuf->queue,
(dvb_ringbuffer_free(cibuf) >= count + 2)))
- return -ERESTARTSYS;
+ goto out;
}
DVB_RINGBUFFER_WRITE_BYTE(cibuf, count >> 8);
DVB_RINGBUFFER_WRITE_BYTE(cibuf, count & 0xff);
- return dvb_ringbuffer_write(cibuf, buf, count, 1);
+ res = dvb_ringbuffer_write(cibuf, page, count);
+out:
+ free_page((unsigned long)page);
+ return res;
}
static ssize_t ci_ll_read(struct dvb_ringbuffer *cibuf, struct file *file,
- char *buf, size_t count, loff_t *ppos)
+ char __user *buf, size_t count, loff_t *ppos)
{
int avail;
int non_blocking = file->f_flags & O_NONBLOCK;
@@ -297,7 +313,7 @@ static int dvb_ca_ioctl(struct inode *inode, struct file *file,
return 0;
}
-static ssize_t dvb_ca_write(struct file *file, const char *buf,
+static ssize_t dvb_ca_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
@@ -307,7 +323,7 @@ static ssize_t dvb_ca_write(struct file *file, const char *buf,
return ci_ll_write(&av7110->ci_wbuffer, file, buf, count, ppos);
}
-static ssize_t dvb_ca_read(struct file *file, char *buf,
+static ssize_t dvb_ca_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
struct dvb_device *dvbdev = (struct dvb_device *) file->private_data;
@@ -330,7 +346,7 @@ static struct file_operations dvb_ca_fops = {
};
static struct dvb_device dvbdev_ca = {
- .priv = 0,
+ .priv = NULL,
.users = 1,
.writers = 1,
.fops = &dvb_ca_fops,
diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.c b/linux/drivers/media/dvb/ttpci/av7110_hw.c
index 8b4388a61..71cfa7f05 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_hw.c
@@ -733,7 +733,7 @@ static osd_raw_window_t bpp2bit[8] = {
};
static inline int LoadBitmap(struct av7110 *av7110, u16 format,
- u16 dx, u16 dy, int inc, u8* data)
+ u16 dx, u16 dy, int inc, u8 __user * data)
{
int bpp;
int i;
@@ -848,7 +848,7 @@ static void OSDSetColor(struct av7110 *av7110, u8 color, u8 r, u8 g, u8 b, u8 bl
color, ((blend >> 4) & 0x0f));
}
-static int OSDSetPalette(struct av7110 *av7110, u32 *colors, u8 first, u8 last)
+static int OSDSetPalette(struct av7110 *av7110, u32 __user * colors, u8 first, u8 last)
{
int i;
int length = last - first + 1;
@@ -860,10 +860,10 @@ static int OSDSetPalette(struct av7110 *av7110, u32 *colors, u8 first, u8 last)
u32 color, blend, yuv;
if (get_user(color, colors + i))
- return -EFAULT;
+ return -EFAULT;
blend = (color & 0xF0000000) >> 4;
yuv = blend ? RGB2YUV(color & 0xFF, (color >> 8) & 0xFF,
- (color >> 16) & 0xFF) | blend : 0;
+ (color >> 16) & 0xFF) | blend : 0;
yuv = ((yuv & 0xFFFF0000) >> 16) | ((yuv & 0x0000FFFF) << 16);
wdebi(av7110, DEBINOSWAP, DATA_BUFF3_BASE + i * 4, yuv, 4);
}
@@ -874,7 +874,7 @@ static int OSDSetPalette(struct av7110 *av7110, u32 *colors, u8 first, u8 last)
}
static int OSDSetBlock(struct av7110 *av7110, int x0, int y0,
- int x1, int y1, int inc, u8 *data)
+ int x1, int y1, int inc, u8 __user * data)
{
uint w, h, bpp, bpl, size, lpb, bnum, brest;
int i;
diff --git a/linux/drivers/media/dvb/ttpci/av7110_ir.c b/linux/drivers/media/dvb/ttpci/av7110_ir.c
index 8691df9b5..9847c0b97 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_ir.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_ir.c
@@ -136,7 +136,7 @@ static void input_repeat_key(unsigned long data)
}
-static int av7110_ir_write_proc(struct file *file, const char *buffer,
+static int av7110_ir_write_proc(struct file *file, const char __user *buffer,
unsigned long count, void *data)
{
char *page;
diff --git a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index ef68eed62..47fff9082 100644
--- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -1117,7 +1117,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
ttusb->dvb_demux.dmx.capabilities =
DMX_TS_FILTERING | DMX_SECTION_FILTERING;
- ttusb->dvb_demux.priv = 0;
+ ttusb->dvb_demux.priv = NULL;
#ifdef TTUSB_HWSECTIONS
ttusb->dvb_demux.filternum = TTUSB_MAXFILTER;
#else
@@ -1126,7 +1126,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
ttusb->dvb_demux.feednum = TTUSB_MAXCHANNEL;
ttusb->dvb_demux.start_feed = ttusb_start_feed;
ttusb->dvb_demux.stop_feed = ttusb_stop_feed;
- ttusb->dvb_demux.write_to_decoder = 0;
+ ttusb->dvb_demux.write_to_decoder = NULL;
if ((result = dvb_dmx_init(&ttusb->dvb_demux)) < 0) {
printk("ttusb_dvb: dvb_dmx_init failed (errno = %d)\n",
diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index 59b047865..963926071 100644
--- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -320,7 +320,7 @@ static int ttusb_dec_audio_pes2ts_cb(void *priv, unsigned char *data)
{
struct ttusb_dec *dec = (struct ttusb_dec *)priv;
- dec->audio_filter->feed->cb.ts(data, 188, 0, 0,
+ dec->audio_filter->feed->cb.ts(data, 188, NULL, 0,
&dec->audio_filter->feed->feed.ts,
DMX_OK);
@@ -331,7 +331,7 @@ static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data)
{
struct ttusb_dec *dec = (struct ttusb_dec *)priv;
- dec->video_filter->feed->cb.ts(data, 188, 0, 0,
+ dec->video_filter->feed->cb.ts(data, 188, NULL, 0,
&dec->video_filter->feed->feed.ts,
DMX_OK);
@@ -384,7 +384,7 @@ static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
u16 v_pes_payload_length;
if (output_pva) {
- dec->video_filter->feed->cb.ts(pva, length, 0, 0,
+ dec->video_filter->feed->cb.ts(pva, length, NULL, 0,
&dec->video_filter->feed->feed.ts, DMX_OK);
return;
}
@@ -445,7 +445,7 @@ static void ttusb_dec_process_pva(struct ttusb_dec *dec, u8 *pva, int length)
case 0x02: /* MainAudioStream */
if (output_pva) {
- dec->audio_filter->feed->cb.ts(pva, length, 0, 0,
+ dec->audio_filter->feed->cb.ts(pva, length, NULL, 0,
&dec->audio_filter->feed->feed.ts, DMX_OK);
return;
}
diff --git a/linux/include/linux/dvb/osd.h b/linux/include/linux/dvb/osd.h
index d12d7e83e..bd7559c76 100644
--- a/linux/include/linux/dvb/osd.h
+++ b/linux/include/linux/dvb/osd.h
@@ -102,7 +102,7 @@ typedef struct osd_cmd_s {
int x1;
int y1;
int color;
- void *data;
+ void __user *data;
} osd_cmd_t;
/* OSD_OpenRaw: set 'color' to desired window type */
diff --git a/linux/include/linux/dvb/video.h b/linux/include/linux/dvb/video.h
index c7d456813..9782fd29a 100644
--- a/linux/include/linux/dvb/video.h
+++ b/linux/include/linux/dvb/video.h
@@ -100,7 +100,7 @@ struct video_status {
struct video_still_picture {
- char *iFrame; /* pointer to a single iframe in memory */
+ char __user *iFrame; /* pointer to a single iframe in memory */
int32_t size;
};
diff --git a/linux/include/media/saa7146_vv.h b/linux/include/media/saa7146_vv.h
index c77eb8915..58fa58b4c 100644
--- a/linux/include/media/saa7146_vv.h
+++ b/linux/include/media/saa7146_vv.h
@@ -185,7 +185,7 @@ struct saa7146_use_ops {
int(*open)(struct saa7146_dev *, struct file *);
void (*release)(struct saa7146_dev *, struct file *);
void (*irq_done)(struct saa7146_dev *, unsigned long status);
- ssize_t (*read)(struct file *, char *, size_t, loff_t *);
+ ssize_t (*read)(struct file *, char __user *, size_t, loff_t *);
};
/* from saa7146_fops.c */