Commit 2ad5e2e4 authored by Daniel W. S. Almeida's avatar Daniel W. S. Almeida Committed by Mauro Carvalho Chehab

media: pci: saa7164.c: Replace if(cond) BUG with BUG_ON

Fix the following coccinelle reports:

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

drivers/media/pci/saa7164/saa7164-buffer.c:261:3-6: 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 333b90fb
...@@ -250,15 +250,14 @@ int saa7164_buffer_cfg_port(struct saa7164_port *port) ...@@ -250,15 +250,14 @@ int saa7164_buffer_cfg_port(struct saa7164_port *port)
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 (buf->flags != SAA7164_BUFFER_FREE) BUG_ON(buf->flags != SAA7164_BUFFER_FREE);
BUG();
/* Place the buffer in the h/w queue */ /* Place the buffer in the h/w queue */
saa7164_buffer_activate(buf, i); saa7164_buffer_activate(buf, i);
/* Don't exceed the device maximum # bufs */ /* Don't exceed the device maximum # bufs */
if (i++ > port->hwcfg.buffercount) BUG_ON(i > port->hwcfg.buffercount);
BUG(); i++;
} }
mutex_unlock(&port->dmaqueue_lock); mutex_unlock(&port->dmaqueue_lock);
...@@ -302,4 +301,3 @@ void saa7164_buffer_dealloc_user(struct saa7164_user_buffer *buf) ...@@ -302,4 +301,3 @@ void saa7164_buffer_dealloc_user(struct saa7164_user_buffer *buf)
kfree(buf); kfree(buf);
} }
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