forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/media/pci/saa7164/saa7164-buffer.c
....@@ -1,18 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Driver for the NXP SAA7164 PCIe bridge
34 *
45 * Copyright (c) 2010-2015 Steven Toth <stoth@kernellabs.com>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- *
15
- * GNU General Public License for more details.
166 */
177
188 #include <linux/slab.h>
....@@ -260,15 +250,14 @@
260250 list_for_each_safe(c, n, &port->dmaqueue.list) {
261251 buf = list_entry(c, struct saa7164_buffer, list);
262252
263
- if (buf->flags != SAA7164_BUFFER_FREE)
264
- BUG();
253
+ BUG_ON(buf->flags != SAA7164_BUFFER_FREE);
265254
266255 /* Place the buffer in the h/w queue */
267256 saa7164_buffer_activate(buf, i);
268257
269258 /* Don't exceed the device maximum # bufs */
270
- if (i++ > port->hwcfg.buffercount)
271
- BUG();
259
+ BUG_ON(i > port->hwcfg.buffercount);
260
+ i++;
272261
273262 }
274263 mutex_unlock(&port->dmaqueue_lock);
....@@ -312,4 +301,3 @@
312301
313302 kfree(buf);
314303 }
315
-