V4L/DVB (3485): BUG_ON() Conversion in drivers/video/media
authorEric Sesterhenn <snakebyte@gmx.de>
Mon, 13 Mar 2006 16:17:11 +0000 (13:17 -0300)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 21 Mar 2006 16:53:19 +0000 (08:53 -0800)
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
12 files changed:
drivers/media/common/saa7146_core.c
drivers/media/common/saa7146_fops.c
drivers/media/dvb/ttpci/av7110.c
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
drivers/media/video/bttv-risc.c
drivers/media/video/cx88/cx88-core.c
drivers/media/video/cx88/cx88-video.c
drivers/media/video/saa7134/saa7134-alsa.c
drivers/media/video/saa7134/saa7134-core.c
drivers/media/video/saa7134/saa7134-oss.c
drivers/media/video/saa7134/saa7134-video.c
drivers/media/video/video-buf.c

index ee16c042ef6e308a7f1201e8923a6da6c31f9599..8cdd4d265ffa235bb69a57f7a57679b6e0827e72 100644 (file)
@@ -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;
        }
index dc7fb20f47b5e71ec58b8220308f061d49a8b778..3870fa948cc08356a5ec1a8a5bed2b7eadbb941d 100644 (file)
@@ -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);
index aef4f58d712d65d3b7f47f8b062c9ed66d88a516..7497b1e8d883f4a6649b8b25f45766f6c2f4ab02 100644 (file)
@@ -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);
index ecb15d4ecf81d51a589d34ab32c5421e39e7e3be..248fdc7accfb123d52c37460cc057faec7e2ca52 100644 (file)
@@ -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 */
index 5c746110df6295a84f0fa5b830d3e2651c55edc6..344f84e9af0462899f8a6f62ddac7315ed720cb0 100644 (file)
@@ -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);
index 25be3a976d09462254ccb956c36ea437c6992df3..c2cdbafdb77b34ae3b06b723f5e963e61854f92b 100644 (file)
@@ -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);
index b1892dff0fe889dc5b8bc86e85f97bd3696c633c..6c97aa740d27f776f381aa7e2b5b2864325c8160 100644 (file)
@@ -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;
index 614f7b923403b838eeb11d373198ee2c002b0683..64e2c108df344122c6c266cb0038a4640d7d5eb8 100644 (file)
@@ -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);
 
index f5f2cf5d150766cfac3e541f631e4113d23dcb3b..be85e0b0cbb05b2bc1c0382a989b6864b7cc66a6 100644 (file)
@@ -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);
index 80e34a5fdcc5466c62367f4d92462008090a2a30..d79d05f88705026216e2efa3aa9a2de786268d32 100644 (file)
@@ -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;
index 72f389a51a137b296f713f986abba7b68080a443..600c3c7e3dca9fcb99be9c4f73ac3667eeb32268 100644 (file)
@@ -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;
index cb1c228e29f86b1451cd2171e9e9ab57e0dc031d..a8918e839f65860e382e16dfd145a96232c044c0 100644 (file)
@@ -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;
        }