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)
pg = vmalloc_to_page(virt);
if (NULL == pg)
goto err;
if (PageHighMem(pg))
BUG();
BUG_ON(PageHighMem(pg));
sglist[i].page = pg;
sglist[i].length = PAGE_SIZE;
}
......
......@@ -37,8 +37,7 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits)
struct saa7146_dev *dev = fh->dev;
struct saa7146_vv *vv = dev->vv_data;
if ((fh->resources & bits) != bits)
BUG();
BUG_ON((fh->resources & bits) != bits);
mutex_lock(&dev->lock);
fh->resources &= ~bits;
......@@ -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));
if (in_interrupt())
BUG();
BUG_ON(in_interrupt());
videobuf_waiton(&buf->vb,0,0);
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,
struct av7110 *av7110;
/* pointer casting paranoia... */
if (!demux)
BUG();
BUG_ON(!demux);
dvbdemux = (struct dvb_demux *) demux->priv;
if (!dvbdemux)
BUG();
BUG_ON(!dvbdemux);
av7110 = (struct av7110 *) dvbdemux->priv;
dprintk(4, "%p\n", av7110);
......
......@@ -688,8 +688,7 @@ static void ttusb_process_frame(struct ttusb *ttusb, u8 * data, int len)
memcpy(ttusb->muxpack + ttusb->muxpack_ptr,
data, avail);
ttusb->muxpack_ptr += avail;
if (ttusb->muxpack_ptr > 264)
BUG();
BUG_ON(ttusb->muxpack_ptr > 264);
data += avail;
len -= avail;
/* determine length */
......
......@@ -511,8 +511,7 @@ bttv_risc_hook(struct bttv *btv, int slot, struct btcx_riscmem *risc,
void
bttv_dma_free(struct bttv *btv, struct bttv_buffer *buf)
{
if (in_interrupt())
BUG();
BUG_ON(in_interrupt());
videobuf_waiton(&buf->vb,0,0);
videobuf_dma_pci_unmap(btv->c.pci, &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,
void
cx88_free_buffer(struct pci_dev *pci, struct cx88_buffer *buf)
{
if (in_interrupt())
BUG();
BUG_ON(in_interrupt());
videobuf_waiton(&buf->vb,0,0);
videobuf_dma_pci_unmap(pci, &buf->vb.dma);
videobuf_dma_free(&buf->vb.dma);
......
......@@ -366,8 +366,7 @@ static
void res_free(struct cx8800_dev *dev, struct cx8800_fh *fh, unsigned int bits)
{
struct cx88_core *core = dev->core;
if ((fh->resources & bits) != bits)
BUG();
BUG_ON((fh->resources & bits) != bits);
mutex_lock(&core->lock);
fh->resources &= ~bits;
......
......@@ -308,8 +308,7 @@ static int dsp_buffer_init(struct saa7134_dev *dev)
static int dsp_buffer_free(struct saa7134_dev *dev)
{
if (!dev->dmasound.blksize)
BUG();
BUG_ON(!dev->dmasound.blksize);
videobuf_dma_free(&dev->dmasound.dma);
......
......@@ -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)
{
if (in_interrupt())
BUG();
BUG_ON(in_interrupt());
videobuf_waiton(&buf->vb,0,0);
videobuf_dma_pci_unmap(dev->pci, &buf->vb.dma);
......
......@@ -84,8 +84,7 @@ static int dsp_buffer_init(struct saa7134_dev *dev)
{
int err;
if (!dev->dmasound.bufsize)
BUG();
BUG_ON(!dev->dmasound.bufsize);
videobuf_dma_init(&dev->dmasound.dma);
err = videobuf_dma_init_kernel(&dev->dmasound.dma, PCI_DMA_FROMDEVICE,
(dev->dmasound.bufsize + PAGE_SIZE) >> PAGE_SHIFT);
......@@ -96,8 +95,7 @@ static int dsp_buffer_init(struct saa7134_dev *dev)
static int dsp_buffer_free(struct saa7134_dev *dev)
{
if (!dev->dmasound.blksize)
BUG();
BUG_ON(!dev->dmasound.blksize);
videobuf_dma_free(&dev->dmasound.dma);
dev->dmasound.blocks = 0;
dev->dmasound.blksize = 0;
......
......@@ -489,8 +489,7 @@ int res_locked(struct saa7134_dev *dev, unsigned int bit)
static
void res_free(struct saa7134_dev *dev, struct saa7134_fh *fh, unsigned int bits)
{
if ((fh->resources & bits) != bits)
BUG();
BUG_ON((fh->resources & bits) != bits);
mutex_lock(&dev->lock);
fh->resources &= ~bits;
......
......@@ -59,8 +59,7 @@ videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages)
pg = vmalloc_to_page(virt);
if (NULL == pg)
goto err;
if (PageHighMem(pg))
BUG();
BUG_ON(PageHighMem(pg));
sglist[i].page = pg;
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