diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-05-19 07:00:56 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-06-09 17:30:09 -0400 |
commit | 09f2082e23ad8e89e10152b8701d3511ace45290 (patch) | |
tree | 9d18d835e169f7e88eb9561d5fd11e94968f289b | |
parent | fa8cb6444c3236d2bad7460bdfdb2685f82b7ee4 (diff) |
[media] usb drivers: use BUG_ON() instead of if () BUG
Some USB drivers have a logic at the VB buffer handling like:
if (in_interrupt())
BUG();
Use, instead:
BUG_ON(in_interrupt());
Btw, this logic looks weird on my eyes. We should convert them
to use VB2, in order to avoid those crappy things.
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-417.c | 3 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-vbi.c | 3 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-video.c | 3 | ||||
-rw-r--r-- | drivers/media/usb/tm6000/tm6000-video.c | 3 | ||||
-rw-r--r-- | drivers/media/usb/zr364xx/zr364xx.c | 3 |
5 files changed, 5 insertions, 10 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx231xx/cx231xx-417.c index 855a708387c6..47a98a2014a5 100644 --- a/drivers/media/usb/cx231xx/cx231xx-417.c +++ b/drivers/media/usb/cx231xx/cx231xx-417.c | |||
@@ -1249,8 +1249,7 @@ static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf) | |||
1249 | struct cx231xx *dev = fh->dev; | 1249 | struct cx231xx *dev = fh->dev; |
1250 | unsigned long flags = 0; | 1250 | unsigned long flags = 0; |
1251 | 1251 | ||
1252 | if (in_interrupt()) | 1252 | BUG_ON(in_interrupt()); |
1253 | BUG(); | ||
1254 | 1253 | ||
1255 | spin_lock_irqsave(&dev->video_mode.slock, flags); | 1254 | spin_lock_irqsave(&dev->video_mode.slock, flags); |
1256 | if (dev->USE_ISO) { | 1255 | if (dev->USE_ISO) { |
diff --git a/drivers/media/usb/cx231xx/cx231xx-vbi.c b/drivers/media/usb/cx231xx/cx231xx-vbi.c index 80261ac40208..a08014d20a5c 100644 --- a/drivers/media/usb/cx231xx/cx231xx-vbi.c +++ b/drivers/media/usb/cx231xx/cx231xx-vbi.c | |||
@@ -192,8 +192,7 @@ static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf) | |||
192 | struct cx231xx_fh *fh = vq->priv_data; | 192 | struct cx231xx_fh *fh = vq->priv_data; |
193 | struct cx231xx *dev = fh->dev; | 193 | struct cx231xx *dev = fh->dev; |
194 | unsigned long flags = 0; | 194 | unsigned long flags = 0; |
195 | if (in_interrupt()) | 195 | BUG_ON(in_interrupt()); |
196 | BUG(); | ||
197 | 196 | ||
198 | /* We used to wait for the buffer to finish here, but this didn't work | 197 | /* We used to wait for the buffer to finish here, but this didn't work |
199 | because, as we were keeping the state as VIDEOBUF_QUEUED, | 198 | because, as we were keeping the state as VIDEOBUF_QUEUED, |
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index af44f2d1c0a1..c6ff8968286a 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c | |||
@@ -749,8 +749,7 @@ static void free_buffer(struct videobuf_queue *vq, struct cx231xx_buffer *buf) | |||
749 | struct cx231xx *dev = fh->dev; | 749 | struct cx231xx *dev = fh->dev; |
750 | unsigned long flags = 0; | 750 | unsigned long flags = 0; |
751 | 751 | ||
752 | if (in_interrupt()) | 752 | BUG_ON(in_interrupt()); |
753 | BUG(); | ||
754 | 753 | ||
755 | /* We used to wait for the buffer to finish here, but this didn't work | 754 | /* We used to wait for the buffer to finish here, but this didn't work |
756 | because, as we were keeping the state as VIDEOBUF_QUEUED, | 755 | because, as we were keeping the state as VIDEOBUF_QUEUED, |
diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c index 5287d2960282..fa5e8bda2ae4 100644 --- a/drivers/media/usb/tm6000/tm6000-video.c +++ b/drivers/media/usb/tm6000/tm6000-video.c | |||
@@ -714,8 +714,7 @@ static void free_buffer(struct videobuf_queue *vq, struct tm6000_buffer *buf) | |||
714 | struct tm6000_core *dev = fh->dev; | 714 | struct tm6000_core *dev = fh->dev; |
715 | unsigned long flags; | 715 | unsigned long flags; |
716 | 716 | ||
717 | if (in_interrupt()) | 717 | BUG_ON(in_interrupt()); |
718 | BUG(); | ||
719 | 718 | ||
720 | /* We used to wait for the buffer to finish here, but this didn't work | 719 | /* We used to wait for the buffer to finish here, but this didn't work |
721 | because, as we were keeping the state as VIDEOBUF_QUEUED, | 720 | because, as we were keeping the state as VIDEOBUF_QUEUED, |
diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c index ca850316d379..7433ba5c4bad 100644 --- a/drivers/media/usb/zr364xx/zr364xx.c +++ b/drivers/media/usb/zr364xx/zr364xx.c | |||
@@ -377,8 +377,7 @@ static void free_buffer(struct videobuf_queue *vq, struct zr364xx_buffer *buf) | |||
377 | { | 377 | { |
378 | _DBG("%s\n", __func__); | 378 | _DBG("%s\n", __func__); |
379 | 379 | ||
380 | if (in_interrupt()) | 380 | BUG_ON(in_interrupt()); |
381 | BUG(); | ||
382 | 381 | ||
383 | videobuf_vmalloc_free(&buf->vb); | 382 | videobuf_vmalloc_free(&buf->vb); |
384 | buf->vb.state = VIDEOBUF_NEEDS_INIT; | 383 | buf->vb.state = VIDEOBUF_NEEDS_INIT; |