Commit 56149c8c authored by Daniel W. S. Almeida's avatar Daniel W. S. Almeida Committed by Mauro Carvalho Chehab

media: pci: saa7164-core.c: replace if (cond) BUG() with BUG_ON()

Fix the following coccinelle reports:

drivers/media/pci/saa7164/saa7164-core.c:579:2-5:
WARNING: Use BUG_ON instead of if condition followed by BUG.

drivers/media/pci/saa7164/saa7164-core.c:592:3-6:
WARNING: Use BUG_ON instead of if condition followed by BUG.

drivers/media/pci/saa7164/saa7164-core.c:898:2-5:
WARNING: Use BUG_ON instead of if condition followed by BUG.

Found using - Coccinelle (http://coccinelle.lip6.fr)
Signed-off-by: default avatarDaniel W. S. Almeida <dwlsalmeida@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent d8018ec1
...@@ -575,8 +575,8 @@ static irqreturn_t saa7164_irq_ts(struct saa7164_port *port) ...@@ -575,8 +575,8 @@ static irqreturn_t saa7164_irq_ts(struct saa7164_port *port)
/* Find the current write point from the hardware */ /* Find the current write point from the hardware */
wp = saa7164_readl(port->bufcounter); wp = saa7164_readl(port->bufcounter);
if (wp > (port->hwcfg.buffercount - 1))
BUG(); BUG_ON(wp > (port->hwcfg.buffercount - 1));
/* Find the previous buffer to the current write point */ /* Find the previous buffer to the current write point */
if (wp == 0) if (wp == 0)
...@@ -588,8 +588,8 @@ static irqreturn_t saa7164_irq_ts(struct saa7164_port *port) ...@@ -588,8 +588,8 @@ static irqreturn_t saa7164_irq_ts(struct saa7164_port *port)
/* TODO: turn this into a worker thread */ /* TODO: turn this into a worker thread */
list_for_each_safe(c, n, &port->dmaqueue.list) { list_for_each_safe(c, n, &port->dmaqueue.list) {
buf = list_entry(c, struct saa7164_buffer, list); buf = list_entry(c, struct saa7164_buffer, list);
if (i++ > port->hwcfg.buffercount) BUG_ON(i > port->hwcfg.buffercount);
BUG(); i++;
if (buf->idx == rp) { if (buf->idx == rp) {
/* Found the buffer, deal with it */ /* Found the buffer, deal with it */
...@@ -894,8 +894,7 @@ static int saa7164_port_init(struct saa7164_dev *dev, int portnr) ...@@ -894,8 +894,7 @@ static int saa7164_port_init(struct saa7164_dev *dev, int portnr)
{ {
struct saa7164_port *port = NULL; struct saa7164_port *port = NULL;
if ((portnr < 0) || (portnr >= SAA7164_MAX_PORTS)) BUG_ON((portnr < 0) || (portnr >= SAA7164_MAX_PORTS));
BUG();
port = &dev->ports[portnr]; port = &dev->ports[portnr];
...@@ -1563,4 +1562,3 @@ static void __exit saa7164_fini(void) ...@@ -1563,4 +1562,3 @@ static void __exit saa7164_fini(void)
module_init(saa7164_init); module_init(saa7164_init);
module_exit(saa7164_fini); module_exit(saa7164_fini);
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