sound: usb-audio: remove MIN_PACKS_URB
Remove the MIN_PACKS_URB symbol because other limits can force the
number of packets down to one, regardless of the value of this symbol,
and nobody has ever changed it anyway.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index c69cc6e..2b24496 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -107,7 +107,6 @@
#define MAX_PACKS_HS (MAX_PACKS * 8) /* in high speed mode */
#define MAX_URBS 8
#define SYNC_URBS 4 /* always four urbs for sync */
-#define MIN_PACKS_URB 1 /* minimum 1 packet per urb */
#define MAX_QUEUE 24 /* try not to exceed this queue length, in ms */
struct audioformat {
@@ -1071,8 +1070,7 @@
subs->packs_per_ms = packs_per_ms;
if (is_playback) {
- urb_packs = nrpacks;
- urb_packs = max(urb_packs, (unsigned int)MIN_PACKS_URB);
+ urb_packs = max(nrpacks, 1);
urb_packs = min(urb_packs, (unsigned int)MAX_PACKS);
} else
urb_packs = 1;
@@ -1093,9 +1091,9 @@
total_packs = (total_packs + packs_per_ms - 1)
& ~(packs_per_ms - 1);
/* we need at least two URBs for queueing */
- if (total_packs < 2 * MIN_PACKS_URB * packs_per_ms)
- total_packs = 2 * MIN_PACKS_URB * packs_per_ms;
- else {
+ if (total_packs < 2 * packs_per_ms) {
+ total_packs = 2 * packs_per_ms;
+ } else {
/* and we don't want too long a queue either */
maxpacks = max((unsigned int)MAX_QUEUE, urb_packs * 2);
if (total_packs > maxpacks * packs_per_ms)
@@ -1909,7 +1907,7 @@
* in the current code assume the 1ms period.
*/
snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_PERIOD_TIME,
- 1000 * MIN_PACKS_URB,
+ 1000,
/*(nrpacks * MAX_URBS) * 1000*/ UINT_MAX);
err = check_hw_params_convention(subs);
@@ -3753,7 +3751,7 @@
static int __init snd_usb_audio_init(void)
{
- if (nrpacks < MIN_PACKS_URB || nrpacks > MAX_PACKS) {
+ if (nrpacks < 1 || nrpacks > MAX_PACKS) {
printk(KERN_WARNING "invalid nrpacks value.\n");
return -EINVAL;
}