Commit ae24601b authored by Eric Sesterhenn's avatar Eric Sesterhenn Committed by Linus Torvalds

V4L/DVB (3485): BUG_ON() Conversion in drivers/video/media

Signed-off-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 9d9d6bae
...@@ -116,8 +116,7 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages) ...@@ -116,8 +116,7 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages)
pg = vmalloc_to_page(virt); pg = vmalloc_to_page(virt);
if (NULL == pg) if (NULL == pg)
goto err; goto err;
if (PageHighMem(pg)) BUG_ON(PageHighMem(pg));
BUG();
sglist[i].page = pg; sglist[i].page = pg;
sglist[i].length = PAGE_SIZE; sglist[i].length = PAGE_SIZE;
} }
......
...@@ -37,8 +37,7 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits) ...@@ -37,8 +37,7 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits)
struct saa7146_dev *dev = fh->dev; struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data; struct saa7146_vv *vv = dev->vv_data;
if ((fh->resources & bits) != bits) BUG_ON((fh->resources & bits) != bits);
BUG();
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
fh->resources &= ~bits; fh->resources &= ~bits;
...@@ -55,8 +54,7 @@ void saa7146_dma_free(struct saa7146_dev *dev,struct saa7146_buf *buf) ...@@ -55,8 +54,7 @@ void saa7146_dma_free(struct saa7146_dev *dev,struct saa7146_buf *buf)
{ {
DEB_EE(("dev:%p, buf:%p\n",dev,buf)); DEB_EE(("dev:%p, buf:%p\n",dev,buf));
if (in_interrupt()) BUG_ON(in_interrupt());
BUG();
videobuf_waiton(&buf->vb,0,0); videobuf_waiton(&buf->vb,0,0);
videobuf_dma_pci_unmap(dev->pci, &buf->vb.dma); videobuf_dma_pci_unmap(dev->pci, &buf->vb.dma);
......
...@@ -1090,11 +1090,9 @@ static int dvb_get_stc(struct dmx_demux *demux, unsigned int num, ...@@ -1090,11 +1090,9 @@ static int dvb_get_stc(struct dmx_demux *demux, unsigned int num,
struct av7110 *av7110; struct av7110 *av7110;
/* pointer casting paranoia... */ /* pointer casting paranoia... */
if (!demux) BUG_ON(!demux);
BUG();
dvbdemux = (struct dvb_demux *) demux->priv; dvbdemux = (struct dvb_demux *) demux->priv;
if (!dvbdemux) BUG_ON(!dvbdemux);
BUG();
av7110 = (struct av7110 *) dvbdemux->priv; av7110 = (struct av7110 *) dvbdemux->priv;
dprintk(4, "%p\n", av7110); dprintk(4, "%p\n", av7110);
......
...@@ -688,8 +688,7 @@ static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len) ...@@ -688,8 +688,7 @@ static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len)
memcpy(ttusb->muxpack + ttusb->muxpack_ptr, memcpy(ttusb->muxpack + ttusb->muxpack_ptr,
data, avail); data, avail);
ttusb->muxpack_ptr += avail; ttusb->muxpack_ptr += avail;
if (ttusb->muxpack_ptr > 264) BUG_ON(ttusb->muxpack_ptr > 264);
BUG();
data += avail; data += avail;
len -= avail; len -= avail;
/* determine length */ /* determine length */
......
...@@ -511,8 +511,7 @@ bttv_risc_hook(struct bttv *btv, int slot, struct btcx_riscmem *risc, ...@@ -511,8 +511,7 @@ bttv_risc_hook(struct bttv *btv, int slot, struct btcx_riscmem *risc,
void void
bttv_dma_free(struct bttv *btv, struct bttv_buffer *buf) bttv_dma_free(struct bttv *btv, struct bttv_buffer *buf)
{ {
if (in_interrupt()) BUG_ON(in_interrupt());
BUG();
videobuf_waiton(&buf->vb,0,0); videobuf_waiton(&buf->vb,0,0);
videobuf_dma_pci_unmap(btv->c.pci, &buf->vb.dma); videobuf_dma_pci_unmap(btv->c.pci, &buf->vb.dma);
videobuf_dma_free(&buf->vb.dma); videobuf_dma_free(&buf->vb.dma);
......
...@@ -215,8 +215,7 @@ int cx88_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc, ...@@ -215,8 +215,7 @@ int cx88_risc_stopper(struct pci_dev *pci, struct btcx_riscmem *risc,
void void
cx88_free_buffer(struct pci_dev *pci, struct cx88_buffer *buf) cx88_free_buffer(struct pci_dev *pci, struct cx88_buffer *buf)
{ {
if (in_interrupt()) BUG_ON(in_interrupt());
BUG();
videobuf_waiton(&buf->vb,0,0); videobuf_waiton(&buf->vb,0,0);
videobuf_dma_pci_unmap(pci, &buf->vb.dma); videobuf_dma_pci_unmap(pci, &buf->vb.dma);
videobuf_dma_free(&buf->vb.dma); videobuf_dma_free(&buf->vb.dma);
......
...@@ -366,8 +366,7 @@ static ...@@ -366,8 +366,7 @@ static
void res_free(struct cx8800_dev *dev, struct cx8800_fh *fh, unsigned int bits) void res_free(struct cx8800_dev *dev, struct cx8800_fh *fh, unsigned int bits)
{ {
struct cx88_core *core = dev->core; struct cx88_core *core = dev->core;
if ((fh->resources & bits) != bits) BUG_ON((fh->resources & bits) != bits);
BUG();
mutex_lock(&core->lock); mutex_lock(&core->lock);
fh->resources &= ~bits; fh->resources &= ~bits;
......
...@@ -308,8 +308,7 @@ static int dsp_buffer_init(struct saa7134_dev *dev) ...@@ -308,8 +308,7 @@ static int dsp_buffer_init(struct saa7134_dev *dev)
static int dsp_buffer_free(struct saa7134_dev *dev) static int dsp_buffer_free(struct saa7134_dev *dev)
{ {
if (!dev->dmasound.blksize) BUG_ON(!dev->dmasound.blksize);
BUG();
videobuf_dma_free(&dev->dmasound.dma); videobuf_dma_free(&dev->dmasound.dma);
......
...@@ -256,8 +256,7 @@ void saa7134_pgtable_free(struct pci_dev *pci, struct saa7134_pgtable *pt) ...@@ -256,8 +256,7 @@ void saa7134_pgtable_free(struct pci_dev *pci, struct saa7134_pgtable *pt)
void saa7134_dma_free(struct saa7134_dev *dev,struct saa7134_buf *buf) void saa7134_dma_free(struct saa7134_dev *dev,struct saa7134_buf *buf)
{ {
if (in_interrupt()) BUG_ON(in_interrupt());
BUG();
videobuf_waiton(&buf->vb,0,0); videobuf_waiton(&buf->vb,0,0);
videobuf_dma_pci_unmap(dev->pci, &buf->vb.dma); videobuf_dma_pci_unmap(dev->pci, &buf->vb.dma);
......
...@@ -84,8 +84,7 @@ static int dsp_buffer_init(struct saa7134_dev *dev) ...@@ -84,8 +84,7 @@ static int dsp_buffer_init(struct saa7134_dev *dev)
{ {
int err; int err;
if (!dev->dmasound.bufsize) BUG_ON(!dev->dmasound.bufsize);
BUG();
videobuf_dma_init(&dev->dmasound.dma); videobuf_dma_init(&dev->dmasound.dma);
err = videobuf_dma_init_kernel(&dev->dmasound.dma, PCI_DMA_FROMDEVICE, err = videobuf_dma_init_kernel(&dev->dmasound.dma, PCI_DMA_FROMDEVICE,
(dev->dmasound.bufsize + PAGE_SIZE) >> PAGE_SHIFT); (dev->dmasound.bufsize + PAGE_SIZE) >> PAGE_SHIFT);
...@@ -96,8 +95,7 @@ static int dsp_buffer_init(struct saa7134_dev *dev) ...@@ -96,8 +95,7 @@ static int dsp_buffer_init(struct saa7134_dev *dev)
static int dsp_buffer_free(struct saa7134_dev *dev) static int dsp_buffer_free(struct saa7134_dev *dev)
{ {
if (!dev->dmasound.blksize) BUG_ON(!dev->dmasound.blksize);
BUG();
videobuf_dma_free(&dev->dmasound.dma); videobuf_dma_free(&dev->dmasound.dma);
dev->dmasound.blocks = 0; dev->dmasound.blocks = 0;
dev->dmasound.blksize = 0; dev->dmasound.blksize = 0;
......
...@@ -489,8 +489,7 @@ int res_locked(struct saa7134_dev *dev, unsigned int bit) ...@@ -489,8 +489,7 @@ int res_locked(struct saa7134_dev *dev, unsigned int bit)
static static
void res_free(struct saa7134_dev *dev, struct saa7134_fh *fh, unsigned int bits) void res_free(struct saa7134_dev *dev, struct saa7134_fh *fh, unsigned int bits)
{ {
if ((fh->resources & bits) != bits) BUG_ON((fh->resources & bits) != bits);
BUG();
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
fh->resources &= ~bits; fh->resources &= ~bits;
......
...@@ -59,8 +59,7 @@ videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages) ...@@ -59,8 +59,7 @@ videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages)
pg = vmalloc_to_page(virt); pg = vmalloc_to_page(virt);
if (NULL == pg) if (NULL == pg)
goto err; goto err;
if (PageHighMem(pg)) BUG_ON(PageHighMem(pg));
BUG();
sglist[i].page = pg; sglist[i].page = pg;
sglist[i].length = PAGE_SIZE; sglist[i].length = PAGE_SIZE;
} }
......
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