| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Line 6 Linux USB driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at) |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or |
|---|
| 7 | | - * modify it under the terms of the GNU General Public License as |
|---|
| 8 | | - * published by the Free Software Foundation, version 2. |
|---|
| 9 | | - * |
|---|
| 10 | 6 | */ |
|---|
| 11 | 7 | |
|---|
| 12 | 8 | #include <linux/slab.h> |
|---|
| .. | .. |
|---|
| 48 | 44 | int req, done; |
|---|
| 49 | 45 | |
|---|
| 50 | 46 | for (;;) { |
|---|
| 51 | | - req = min(line6_midibuf_bytes_free(mb), line6->max_packet_size); |
|---|
| 47 | + req = min3(line6_midibuf_bytes_free(mb), line6->max_packet_size, |
|---|
| 48 | + LINE6_FALLBACK_MAXPACKETSIZE); |
|---|
| 52 | 49 | done = snd_rawmidi_transmit_peek(substream, chunk, req); |
|---|
| 53 | 50 | |
|---|
| 54 | 51 | if (done == 0) |
|---|
| .. | .. |
|---|
| 60 | 57 | |
|---|
| 61 | 58 | for (;;) { |
|---|
| 62 | 59 | done = line6_midibuf_read(mb, chunk, |
|---|
| 63 | | - LINE6_FALLBACK_MAXPACKETSIZE); |
|---|
| 60 | + LINE6_FALLBACK_MAXPACKETSIZE, |
|---|
| 61 | + LINE6_MIDIBUF_READ_TX); |
|---|
| 64 | 62 | |
|---|
| 65 | 63 | if (done == 0) |
|---|
| 66 | 64 | break; |
|---|