Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

+5 -10
+1 -2
drivers/media/usb/cx231xx/cx231xx-417.c
··· 1249 1249 struct cx231xx *dev = fh->dev; 1250 1250 unsigned long flags = 0; 1251 1251 1252 - if (in_interrupt()) 1253 - BUG(); 1252 + BUG_ON(in_interrupt()); 1254 1253 1255 1254 spin_lock_irqsave(&dev->video_mode.slock, flags); 1256 1255 if (dev->USE_ISO) {
+1 -2
drivers/media/usb/cx231xx/cx231xx-vbi.c
··· 192 192 struct cx231xx_fh *fh = vq->priv_data; 193 193 struct cx231xx *dev = fh->dev; 194 194 unsigned long flags = 0; 195 - if (in_interrupt()) 196 - BUG(); 195 + BUG_ON(in_interrupt()); 197 196 198 197 /* We used to wait for the buffer to finish here, but this didn't work 199 198 because, as we were keeping the state as VIDEOBUF_QUEUED,
+1 -2
drivers/media/usb/cx231xx/cx231xx-video.c
··· 749 749 struct cx231xx *dev = fh->dev; 750 750 unsigned long flags = 0; 751 751 752 - if (in_interrupt()) 753 - BUG(); 752 + BUG_ON(in_interrupt()); 754 753 755 754 /* We used to wait for the buffer to finish here, but this didn't work 756 755 because, as we were keeping the state as VIDEOBUF_QUEUED,
+1 -2
drivers/media/usb/tm6000/tm6000-video.c
··· 714 714 struct tm6000_core *dev = fh->dev; 715 715 unsigned long flags; 716 716 717 - if (in_interrupt()) 718 - BUG(); 717 + BUG_ON(in_interrupt()); 719 718 720 719 /* We used to wait for the buffer to finish here, but this didn't work 721 720 because, as we were keeping the state as VIDEOBUF_QUEUED,
+1 -2
drivers/media/usb/zr364xx/zr364xx.c
··· 377 377 { 378 378 _DBG("%s\n", __func__); 379 379 380 - if (in_interrupt()) 381 - BUG(); 380 + BUG_ON(in_interrupt()); 382 381 383 382 videobuf_vmalloc_free(&buf->vb); 384 383 buf->vb.state = VIDEOBUF_NEEDS_INIT;