All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org
Cc: Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Clemens Ladisch <clemens@ladisch.de>
Subject: [PATCH v3 7/9] sound: usb: remove third argument of usb_maxpacket()
Date: Thu, 17 Mar 2022 01:19:33 +0900	[thread overview]
Message-ID: <20220316161935.2049-8-mailhol.vincent@wanadoo.fr> (raw)
In-Reply-To: <20220316161935.2049-1-mailhol.vincent@wanadoo.fr>

The third argument of usb_maxpacket(): in_out has been deprecated
because it could be derived from the second argument (e.g. using
usb_pipeout(pipe)).

N.B. function usb_maxpacket() was made variadic to accommodate the
transition from the old prototype with three arguments to the new one
with only two arguments (so that no renaming is needed). The variadic
argument is to be removed once all users of usb_maxpacket() get
migrated.

CC: Jaroslav Kysela <perex@perex.cz>
CC: Takashi Iwai <tiwai@suse.com>
CC: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 sound/usb/line6/pcm.c           | 4 ++--
 sound/usb/midi.c                | 4 ++--
 sound/usb/usx2y/usb_stream.c    | 6 +++---
 sound/usb/usx2y/usbusx2yaudio.c | 2 +-
 sound/usb/usx2y/usx2yhwdeppcm.c | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sound/usb/line6/pcm.c b/sound/usb/line6/pcm.c
index fdbdfb7bce92..6a4af725aedd 100644
--- a/sound/usb/line6/pcm.c
+++ b/sound/usb/line6/pcm.c
@@ -552,10 +552,10 @@ int line6_init_pcm(struct usb_line6 *line6,
 
 	line6pcm->max_packet_size_in =
 		usb_maxpacket(line6->usbdev,
-			usb_rcvisocpipe(line6->usbdev, ep_read), 0);
+			usb_rcvisocpipe(line6->usbdev, ep_read));
 	line6pcm->max_packet_size_out =
 		usb_maxpacket(line6->usbdev,
-			usb_sndisocpipe(line6->usbdev, ep_write), 1);
+			usb_sndisocpipe(line6->usbdev, ep_write));
 	if (!line6pcm->max_packet_size_in || !line6pcm->max_packet_size_out) {
 		dev_err(line6pcm->line6->ifcdev,
 			"cannot get proper max packet size\n");
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index 2c01649c70f6..fba498f9e7dc 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -1285,7 +1285,7 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi *umidi,
 		pipe = usb_rcvintpipe(umidi->dev, ep_info->in_ep);
 	else
 		pipe = usb_rcvbulkpipe(umidi->dev, ep_info->in_ep);
-	length = usb_maxpacket(umidi->dev, pipe, 0);
+	length = usb_maxpacket(umidi->dev, pipe);
 	for (i = 0; i < INPUT_URBS; ++i) {
 		buffer = usb_alloc_coherent(umidi->dev, length, GFP_KERNEL,
 					    &ep->urbs[i]->transfer_dma);
@@ -1374,7 +1374,7 @@ static int snd_usbmidi_out_endpoint_create(struct snd_usb_midi *umidi,
 		pipe = usb_sndbulkpipe(umidi->dev, ep_info->out_ep);
 	switch (umidi->usb_id) {
 	default:
-		ep->max_transfer = usb_maxpacket(umidi->dev, pipe, 1);
+		ep->max_transfer = usb_maxpacket(umidi->dev, pipe);
 		break;
 		/*
 		 * Various chips declare a packet size larger than 4 bytes, but
diff --git a/sound/usb/usx2y/usb_stream.c b/sound/usb/usx2y/usb_stream.c
index 9d0e44793896..a4d32e8a1d36 100644
--- a/sound/usb/usx2y/usb_stream.c
+++ b/sound/usb/usx2y/usb_stream.c
@@ -51,7 +51,7 @@ static int init_pipe_urbs(struct usb_stream_kernel *sk,
 {
 	int u, p;
 	int maxpacket = use_packsize ?
-		use_packsize : usb_maxpacket(dev, pipe, usb_pipeout(pipe));
+		use_packsize : usb_maxpacket(dev, pipe);
 	int transfer_length = maxpacket * sk->n_o_ps;
 
 	for (u = 0; u < USB_STREAM_NURBS;
@@ -171,7 +171,7 @@ struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
 	out_pipe = usb_sndisocpipe(dev, out_endpoint);
 
 	max_packsize = use_packsize ?
-		use_packsize : usb_maxpacket(dev, in_pipe, 0);
+		use_packsize : usb_maxpacket(dev, in_pipe);
 
 	/*
 		t_period = period_frames / sample_rate
@@ -187,7 +187,7 @@ struct usb_stream *usb_stream_new(struct usb_stream_kernel *sk,
 	read_size += packets * USB_STREAM_URBDEPTH *
 		(max_packsize + sizeof(struct usb_stream_packet));
 
-	max_packsize = usb_maxpacket(dev, out_pipe, 1);
+	max_packsize = usb_maxpacket(dev, out_pipe);
 	write_size = max_packsize * packets * USB_STREAM_URBDEPTH;
 
 	if (read_size >= 256*PAGE_SIZE || write_size >= 256*PAGE_SIZE) {
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c
index cfc1ea53978d..9cd5e3aae4f7 100644
--- a/sound/usb/usx2y/usbusx2yaudio.c
+++ b/sound/usb/usx2y/usbusx2yaudio.c
@@ -421,7 +421,7 @@ static int usx2y_urbs_allocate(struct snd_usx2y_substream *subs)
 
 	pipe = is_playback ? usb_sndisocpipe(dev, subs->endpoint) :
 			usb_rcvisocpipe(dev, subs->endpoint);
-	subs->maxpacksize = usb_maxpacket(dev, pipe, is_playback);
+	subs->maxpacksize = usb_maxpacket(dev, pipe);
 	if (!subs->maxpacksize)
 		return -EINVAL;
 
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c
index db83522c1b49..240349b644f3 100644
--- a/sound/usb/usx2y/usx2yhwdeppcm.c
+++ b/sound/usb/usx2y/usx2yhwdeppcm.c
@@ -321,7 +321,7 @@ static int usx2y_usbpcm_urbs_allocate(struct snd_usx2y_substream *subs)
 
 	pipe = is_playback ? usb_sndisocpipe(dev, subs->endpoint) :
 			usb_rcvisocpipe(dev, subs->endpoint);
-	subs->maxpacksize = usb_maxpacket(dev, pipe, is_playback);
+	subs->maxpacksize = usb_maxpacket(dev, pipe);
 	if (!subs->maxpacksize)
 		return -EINVAL;
 
-- 
2.34.1


  parent reply	other threads:[~2022-03-16 16:20 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-04 10:53 [PATCH] usb: rework usb_maxpacket() and remove its third argument Vincent Mailhol
2022-03-04 14:20 ` Greg Kroah-Hartman
2022-03-04 17:23   ` Vincent MAILHOL
2022-03-04 17:32     ` Greg Kroah-Hartman
2022-03-06  7:55 ` [PATCH v2 00/10] " Vincent Mailhol
2022-03-06  7:55   ` [PATCH v2 01/10] usb: oxu210hp-hcd: remove redundant call to max_packet() macro Vincent Mailhol
2022-03-06  7:55   ` [PATCH v2 02/10] usb: isp1760: remove redundant " Vincent Mailhol
2022-03-06 19:49     ` Rui Miguel Silva
2022-03-06  7:55   ` [PATCH v2 03/10] usb: rework usb_maxpacket() and deprecate its third argument Vincent Mailhol
2022-03-15 17:25     ` Greg Kroah-Hartman
2022-03-16  1:41       ` Vincent MAILHOL
2022-03-06  7:55   ` [PATCH v2 04/10] HID: usbhid: remove third argument of usb_maxpacket() Vincent Mailhol
2022-03-06  7:55   ` [PATCH v2 05/10] Input: " Vincent Mailhol
2022-03-06  7:55   ` [PATCH v2 06/10] media: " Vincent Mailhol
2022-03-06  7:55   ` [PATCH v2 07/10] net: " Vincent Mailhol
2022-03-06  7:55   ` [PATCH v2 08/10] usb: " Vincent Mailhol
2022-03-06  7:55   ` [PATCH v2 09/10] sound: " Vincent Mailhol
2022-03-06  7:55   ` [PATCH v2 10/10] " Vincent Mailhol
2022-03-16 16:19 ` [PATCH v3 0/9] usb: rework usb_maxpacket() and remove its third argument Vincent Mailhol
2022-03-16 16:19   ` [PATCH v3 1/9] usb: deprecate the third argument of usb_maxpacket() Vincent Mailhol
2022-03-16 16:19   ` [PATCH v3 2/9] HID: usbhid: remove " Vincent Mailhol
2022-03-16 16:19   ` [PATCH v3 3/9] Input: " Vincent Mailhol
2022-03-16 16:19   ` [PATCH v3 4/9] media: " Vincent Mailhol
2022-03-16 16:19   ` [PATCH v3 5/9] net: " Vincent Mailhol
2022-03-16 16:19   ` [PATCH v3 6/9] usb: " Vincent Mailhol
2022-03-16 16:19   ` Vincent Mailhol [this message]
2022-03-16 16:19   ` [PATCH v3 8/9] " Vincent Mailhol
2022-03-16 16:19   ` [PATCH v3 9/9] usb: rework usb_maxpacket() using usb_pipe_endpoint() Vincent Mailhol
2022-03-16 17:17     ` Alan Stern
2022-03-16 23:26       ` Vincent MAILHOL
2022-03-17  3:55 ` [PATCH v4 0/9] usb: rework usb_maxpacket() and remove its third argument Vincent Mailhol
2022-03-17  3:55   ` [PATCH v4 1/9] usb: deprecate the third argument of usb_maxpacket() Vincent Mailhol
2022-03-17  3:55   ` [PATCH v4 2/9] HID: usbhid: remove " Vincent Mailhol
2022-03-17  3:55   ` [PATCH v4 3/9] Input: " Vincent Mailhol
2022-03-17  3:55   ` [PATCH v4 4/9] media: " Vincent Mailhol
2022-03-17  3:55   ` [PATCH v4 5/9] net: " Vincent Mailhol
2022-03-17  3:55   ` [PATCH v4 6/9] usb: " Vincent Mailhol
2022-03-17  3:55   ` [PATCH v4 7/9] sound: " Vincent Mailhol
2022-03-22 13:22     ` Takashi Iwai
2022-03-17  3:55   ` [PATCH v4 8/9] " Vincent Mailhol
2022-03-17  3:55   ` [PATCH v4 9/9] usb: rework usb_maxpacket() using usb_pipe_endpoint() Vincent Mailhol
2022-04-22 13:38   ` [PATCH v4 0/9] usb: rework usb_maxpacket() and remove its third argument Greg Kroah-Hartman
2022-04-22 14:00     ` Vincent MAILHOL
2022-04-22 14:07       ` Vincent MAILHOL
2022-04-22 14:19         ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220316161935.2049-8-mailhol.vincent@wanadoo.fr \
    --to=mailhol.vincent@wanadoo.fr \
    --cc=clemens@ladisch.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.