From: mchehab@infradead.org
To: linux-kernel@vger.kernel.org
Cc: linux-dvb-maintainer@linuxtv.org,
Eric Sesterhenn <snakebyte@gmx.de>,
Mauro Carvalho Chehab <mchehab@infradead.org>
Subject: [PATCH 10/21] BUG_ON() Conversion in drivers/video/media
Date: Fri, 17 Mar 2006 17:54:35 -0300 [thread overview]
Message-ID: <20060317205435.PS48214700010@infradead.org> (raw)
In-Reply-To: <20060317205359.PS65198900000@infradead.org>
From: Eric Sesterhenn <snakebyte@gmx.de>
Date: 1142266631 \-0300
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---
drivers/media/common/saa7146_core.c | 3 +--
drivers/media/common/saa7146_fops.c | 6 ++----
drivers/media/dvb/ttpci/av7110.c | 6 ++----
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 3 +--
drivers/media/video/bttv-risc.c | 3 +--
drivers/media/video/cx88/cx88-core.c | 3 +--
drivers/media/video/cx88/cx88-video.c | 3 +--
drivers/media/video/saa7134/saa7134-alsa.c | 3 +--
drivers/media/video/saa7134/saa7134-core.c | 3 +--
drivers/media/video/saa7134/saa7134-oss.c | 6 ++----
drivers/media/video/saa7134/saa7134-video.c | 3 +--
drivers/media/video/video-buf.c | 3 +--
12 files changed, 15 insertions(+), 30 deletions(-)
diff --git a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c
index 04c1938..98c4322 100644
--- a/drivers/media/common/saa7146_core.c
+++ b/drivers/media/common/saa7146_core.c
@@ -116,8 +116,7 @@ static struct scatterlist* vmalloc_to_sg
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;
}
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c
index f8cf73e..c53fd69 100644
--- a/drivers/media/common/saa7146_fops.c
+++ b/drivers/media/common/saa7146_fops.c
@@ -37,8 +37,7 @@ void saa7146_res_free(struct saa7146_fh
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);
down(&dev->lock);
fh->resources &= ~bits;
@@ -55,8 +54,7 @@ void saa7146_dma_free(struct saa7146_dev
{
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);
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index 7c6ccb9..d5ef440 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -1088,11 +1088,9 @@ static int dvb_get_stc(struct dmx_demux
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);
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 5a13c47..182b68b 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -689,8 +689,7 @@ static void ttusb_process_frame(struct t
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 */
diff --git a/drivers/media/video/bttv-risc.c b/drivers/media/video/bttv-risc.c
index af66a8d..952f1be 100644
--- a/drivers/media/video/bttv-risc.c
+++ b/drivers/media/video/bttv-risc.c
@@ -509,8 +509,7 @@ bttv_risc_hook(struct bttv *btv, int slo
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);
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c
index 3720f24..db3882b 100644
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@ -215,8 +215,7 @@ int cx88_risc_stopper(struct pci_dev *pc
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);
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 39328bb..5f69980 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -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);
down(&core->lock);
fh->resources &= ~bits;
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c
index 7df5e08..900541f 100644
--- a/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/drivers/media/video/saa7134/saa7134-alsa.c
@@ -308,8 +308,7 @@ static int dsp_buffer_init(struct saa713
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);
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 996b5ee..3880234 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -256,8 +256,7 @@ void saa7134_pgtable_free(struct pci_dev
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);
diff --git a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c
index 7448e38..1667d51 100644
--- a/drivers/media/video/saa7134/saa7134-oss.c
+++ b/drivers/media/video/saa7134/saa7134-oss.c
@@ -84,8 +84,7 @@ static int dsp_buffer_init(struct saa713
{
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 saa713
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;
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index e97426b..e0480ea 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -489,8 +489,7 @@ int res_locked(struct saa7134_dev *dev,
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);
down(&dev->lock);
fh->resources &= ~bits;
diff --git a/drivers/media/video/video-buf.c b/drivers/media/video/video-buf.c
index 9ef4775..ced1419 100644
--- a/drivers/media/video/video-buf.c
+++ b/drivers/media/video/video-buf.c
@@ -59,8 +59,7 @@ videobuf_vmalloc_to_sg(unsigned char *vi
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;
}
next prev parent reply other threads:[~2006-03-17 23:02 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-17 20:53 [PATCH 00/21] V4L/DVB fixes mchehab
2006-03-17 20:54 ` [PATCH 01/21] Nskips maybe used uninitialized in bttv_risc_overlay mchehab
2006-03-17 20:54 ` [PATCH 03/21] Correct gpio values for Aver 303 Studio in v4l-dvb tree mchehab
2006-03-17 20:54 ` [PATCH 04/21] Fix typo in enum name and use enum in struct dmxdev_filter mchehab
2006-03-17 20:54 ` [PATCH 02/21] Fix cx88 error messages on balance change mchehab
2006-03-17 20:54 ` [PATCH 07/21] Cx88-input.c: add IR remote control support to CX88_BOARD_PROLINK_PLAYTVPVR mchehab
2006-03-17 20:54 ` [PATCH 06/21] Cx88-cards.c: fix values of gpio0 for card CX88_BOARD_PROLINK_PLAYTVPVR mchehab
2006-03-17 20:54 ` [PATCH 05/21] Added no_overlay option and quirks to saa7134 mchehab
2006-03-17 23:24 ` Adrian Bunk
2006-03-18 0:04 ` [v4l-dvb-maintainer] " Mauro Carvalho Chehab
2006-03-17 20:54 ` mchehab [this message]
2006-03-17 20:54 ` [PATCH 11/21] Snd_cx88_create: don't dereference NULL core mchehab
2006-03-17 20:54 ` [PATCH 09/21] Cleanup mangled whitespace mchehab
2006-03-17 20:54 ` [PATCH 08/21] Cx88 default picture controls values mchehab
2006-03-17 21:10 ` Lee Revell
2006-03-18 0:25 ` Mauro Carvalho Chehab
2006-03-17 20:54 ` [PATCH 13/21] Whitespace: fix incorrect indentation of curly bracket mchehab
2006-03-17 20:54 ` [PATCH 12/21] Kconfig: select VIDEO_CX25840 to build cx25840 a/v decoder module mchehab
2006-03-17 20:54 ` [PATCH 14/21] Cinergy T2 dmx cleanup on disconnect mchehab
2006-03-17 20:54 ` [PATCH 16/21] Kconfig: swap VIDEO_CX88_ALSA and VIDEO_CX88_DVB mchehab
2006-03-18 19:59 ` Michael Krufky
2006-03-18 20:15 ` [2.6.16 PATCH] " Michael Krufky
2006-03-17 20:54 ` [PATCH 15/21] Restore tuning capabilities in v4l2 mxb driver mchehab
2006-03-17 20:54 ` [PATCH 17/21] Kconfig: fix ATSC frontend menu item names by manufacturer mchehab
2006-03-17 20:54 ` [PATCH 20/21] VIDEO_CPIA2 must depend on USB mchehab
2006-03-17 20:54 ` [PATCH 19/21] Cpia2: move Kconfig build logic into cpia2/Kconfig mchehab
2006-03-17 20:54 ` [PATCH 18/21] Fix a bug when more than MAXBOARDS were plugged on em28xx mchehab
2006-03-17 20:54 ` [PATCH 21/21] Fixed em28xx based system lockup mchehab
2006-03-17 23:07 ` [PATCH 00/21] V4L/DVB fixes Linus Torvalds
2006-03-17 23:13 ` Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060317205435.PS48214700010@infradead.org \
--to=mchehab@infradead.org \
--cc=linux-dvb-maintainer@linuxtv.org \
--cc=linux-kernel@vger.kernel.org \
--cc=snakebyte@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®