.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Driver for the NXP SAA7164 PCIe bridge |
---|
3 | 4 | * |
---|
4 | 5 | * 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. |
---|
16 | 6 | */ |
---|
17 | 7 | |
---|
18 | 8 | #include <linux/slab.h> |
---|
.. | .. |
---|
260 | 250 | list_for_each_safe(c, n, &port->dmaqueue.list) { |
---|
261 | 251 | buf = list_entry(c, struct saa7164_buffer, list); |
---|
262 | 252 | |
---|
263 | | - if (buf->flags != SAA7164_BUFFER_FREE) |
---|
264 | | - BUG(); |
---|
| 253 | + BUG_ON(buf->flags != SAA7164_BUFFER_FREE); |
---|
265 | 254 | |
---|
266 | 255 | /* Place the buffer in the h/w queue */ |
---|
267 | 256 | saa7164_buffer_activate(buf, i); |
---|
268 | 257 | |
---|
269 | 258 | /* Don't exceed the device maximum # bufs */ |
---|
270 | | - if (i++ > port->hwcfg.buffercount) |
---|
271 | | - BUG(); |
---|
| 259 | + BUG_ON(i > port->hwcfg.buffercount); |
---|
| 260 | + i++; |
---|
272 | 261 | |
---|
273 | 262 | } |
---|
274 | 263 | mutex_unlock(&port->dmaqueue_lock); |
---|
.. | .. |
---|
312 | 301 | |
---|
313 | 302 | kfree(buf); |
---|
314 | 303 | } |
---|
315 | | - |
---|