From patchwork Wed Mar 16 16:19:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Mailhol X-Patchwork-Id: 553328 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5051CC433FE for ; Wed, 16 Mar 2022 16:19:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357484AbiCPQVI (ORCPT ); Wed, 16 Mar 2022 12:21:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357489AbiCPQVF (ORCPT ); Wed, 16 Mar 2022 12:21:05 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DE0636B71 for ; Wed, 16 Mar 2022 09:19:50 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id n2so2209069plf.4 for ; Wed, 16 Mar 2022 09:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9NdJb4RDgp+BJmtWEEcZQrfda0+GIucqryqqu1rCYYc=; b=JFg/b3Er62OZQ10vBXK9Lrev4pZxFdLx2I4zuqIqaOBLYK/MqFqBWrpbFy3sKSzbZb /qYJProVO4sjDuMPGac+pIPDvhtxXlTf+oqb4M2V7T80GdKjOnQgJO8gFblAfBiqbmJS fWo80s5ku5DkvXOHsUfcRr/Bwfkild4JuBmDHtY4cd1pvLYmWan7TiGdzAmQHPAwEjJX MT8Cr5IK3YUZS7lvvSq1V3h2KQL4KtQ3lLMTNhzvWYSCTEp5lxyZ7v9JO2B3ETvnyxAV ChR9KdW0mZRfLVjPgOuM9m8OgZSyQm0KHWGLogW/TgoA/THGPYN25ZJjfbQ7mpKl9oSt 998Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=9NdJb4RDgp+BJmtWEEcZQrfda0+GIucqryqqu1rCYYc=; b=krA4Kyr+iTvjFbP2n4WBr21SJOPtMYOmQ+oSk068NXHSAr7QDGsQGv/PuVx0LUj7nP hZz4sV7/66z0lWSCAZX/HJChHdar8q2S1dPOPwQenkE/bdRVsy+MKXTG3Kg/cgbApes9 JZHZbkfZ6MBvepHU2+B17o+NvDgmMS9EAoR2kYm2mQOZUVzanb0VnHQ60SKJWGqAJnBf 5UQyv/vLzlgMzDdxjFwmMlTcUFIMFtHtMWGEpwJ+2EsLDwwSeIiEXFK0qpC5ZGRc7IXn X7rj+jh5lOL6JO6W4nR3kdRmvWvWphH3TEMprCjatfF1BNzBuMzEHUQJU1ek+e4OhdkW fkSQ== X-Gm-Message-State: AOAM532FTNwF6jXUMZoSyFr9P0VSLFD9DBQLgyKIQSfm4uuKGQ/7TH+R 296n6hm42p6XG0evLPFbUjk= X-Google-Smtp-Source: ABdhPJyiQz79B7DM7PZ2Wmhx8k59ndJAK/X3ERo6Lk5bZaxLHfTcVor5tB+lFH2t3oW7cCElZG6+OA== X-Received: by 2002:a17:902:7610:b0:151:6152:549c with SMTP id k16-20020a170902761000b001516152549cmr394441pll.91.1647447589959; Wed, 16 Mar 2022 09:19:49 -0700 (PDT) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id mt15-20020a17090b230f00b001bf191e6f08sm2988374pjb.9.2022.03.16.09.19.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 09:19:49 -0700 (PDT) Sender: Vincent Mailhol From: Vincent Mailhol To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Vincent Mailhol , Jiri Kosina , Benjamin Tissoires Subject: [PATCH v3 2/9] HID: usbhid: remove third argument of usb_maxpacket() Date: Thu, 17 Mar 2022 01:19:28 +0900 Message-Id: <20220316161935.2049-3-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316161935.2049-1-mailhol.vincent@wanadoo.fr> References: <20220304105420.1059585-1-mailhol.vincent@wanadoo.fr> <20220316161935.2049-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: Jiri Kosina CC: Benjamin Tissoires Signed-off-by: Vincent Mailhol --- drivers/hid/usbhid/hid-core.c | 2 +- drivers/hid/usbhid/usbkbd.c | 2 +- drivers/hid/usbhid/usbmouse.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 54752c85604b..4490e2f7252a 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -387,7 +387,7 @@ static int hid_submit_ctrl(struct hid_device *hid) usbhid->urbctrl->pipe = usb_rcvctrlpipe(hid_to_usb_dev(hid), 0); maxpacket = usb_maxpacket(hid_to_usb_dev(hid), - usbhid->urbctrl->pipe, 0); + usbhid->urbctrl->pipe); len += (len == 0); /* Don't allow 0-length reports */ len = round_up(len, maxpacket); if (len > usbhid->bufsize) diff --git a/drivers/hid/usbhid/usbkbd.c b/drivers/hid/usbhid/usbkbd.c index df02002066ce..b4b007c4beb6 100644 --- a/drivers/hid/usbhid/usbkbd.c +++ b/drivers/hid/usbhid/usbkbd.c @@ -279,7 +279,7 @@ static int usb_kbd_probe(struct usb_interface *iface, return -ENODEV; pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); - maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); + maxp = usb_maxpacket(dev, pipe); kbd = kzalloc(sizeof(struct usb_kbd), GFP_KERNEL); input_dev = input_allocate_device(); diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c index c89332017d5d..fb1d7d1f6999 100644 --- a/drivers/hid/usbhid/usbmouse.c +++ b/drivers/hid/usbhid/usbmouse.c @@ -123,7 +123,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i return -ENODEV; pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress); - maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); + maxp = usb_maxpacket(dev, pipe); mouse = kzalloc(sizeof(struct usb_mouse), GFP_KERNEL); input_dev = input_allocate_device(); From patchwork Wed Mar 16 16:19:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Mailhol X-Patchwork-Id: 553327 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C0F9C433EF for ; Wed, 16 Mar 2022 16:19:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354704AbiCPQVL (ORCPT ); Wed, 16 Mar 2022 12:21:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245536AbiCPQVJ (ORCPT ); Wed, 16 Mar 2022 12:21:09 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A48BB6D4C6 for ; Wed, 16 Mar 2022 09:19:54 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id o26so584276pgb.8 for ; Wed, 16 Mar 2022 09:19:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=C0UobVydT6v+Is9Yv7AR/ZZyJ5Kvok9L9Dkq1B3Bfxw=; b=S4iF1OyiIvmQYnrHFWqvqFneKDf/NYedpBDBD90j/7Fqdzwkl4FNVdmbecn0jcZPFh VM8wgoZnuKdAClKb+1s7nQMvGaPn3ziY3hz2g9dAsmLhbUIcCzdFLQUSE+WYuWv05+7o CQCP3HnUrq3ALa84Uv1G4+Q0Moyy/zwutv9kuK3k4SepGMPaZy55wJjKhfIiVSimuMBb UBUzMhRQfs9XhJafvzSvhU8eoDN2zWFLhshE2sS9ctageaOCIvb8KT7AhgaHK2yg42RJ lfjER01xg12vugwRla/GmlVE6OH/YeQ9XisSWU636ykrFfBjeiXLAnYKe4L9x9CRu5qx qFWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=C0UobVydT6v+Is9Yv7AR/ZZyJ5Kvok9L9Dkq1B3Bfxw=; b=fp2iPCWfmEh26skEt8u8L52GaETQTfzbfI08fdv24YOeKUimgsAM+pzProNAknaYjO yDnE2Y5/fXORlVaAADECGpLiCRP8/jjORz6+/GH81Job+nrw0y+P0KvSimJB/0i1XipG AZrApZ3cgYF7+BwlV5zhMDn2ozB9XCwKs/ya8ZKeN2OuZAIg2yphhxm48D03XAEP+VTa irIWr1/gnrXTkwxhy/+r+eo/2keCQQFHfxugscXd5kTiQ0nBqm/GFZ/kBoqXeaGm7Tdu CZ9ELLxEPFcmxnuzQskcjDLD8LD3B5v+eKrt7JSTCgBhHud27WH625pLkFqTcD8w0aGD B64w== X-Gm-Message-State: AOAM532H9NfUjhOgtg2zaCrqQ6w53HsqLX+vaDL3uM8CSbGiaCGsT3lt NauUAqAj/JUAfOzghFOM/Ezjhf2yMUw= X-Google-Smtp-Source: ABdhPJzn2sGzwiWDiKaczGXT8LdHQCRUzbJFwh8snwel181dG2zaGcznz/SQPyt8m9QiriUU4I78EQ== X-Received: by 2002:a65:5a06:0:b0:375:81c9:74b1 with SMTP id y6-20020a655a06000000b0037581c974b1mr343999pgs.122.1647447594078; Wed, 16 Mar 2022 09:19:54 -0700 (PDT) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id mt15-20020a17090b230f00b001bf191e6f08sm2988374pjb.9.2022.03.16.09.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 09:19:53 -0700 (PDT) Sender: Vincent Mailhol From: Vincent Mailhol To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Vincent Mailhol , Sean Young , Mauro Carvalho Chehab , Benjamin Valentin Subject: [PATCH v3 4/9] media: remove third argument of usb_maxpacket() Date: Thu, 17 Mar 2022 01:19:30 +0900 Message-Id: <20220316161935.2049-5-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316161935.2049-1-mailhol.vincent@wanadoo.fr> References: <20220304105420.1059585-1-mailhol.vincent@wanadoo.fr> <20220316161935.2049-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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: Sean Young CC: Mauro Carvalho Chehab CC: Benjamin Valentin Signed-off-by: Vincent Mailhol --- drivers/media/rc/ati_remote.c | 4 ++-- drivers/media/rc/mceusb.c | 2 +- drivers/media/rc/streamzap.c | 2 +- drivers/media/rc/xbox_remote.c | 2 +- drivers/media/usb/tm6000/tm6000-dvb.c | 2 +- drivers/media/usb/tm6000/tm6000-input.c | 2 +- drivers/media/usb/tm6000/tm6000-video.c | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/media/rc/ati_remote.c b/drivers/media/rc/ati_remote.c index c12dda73cdd5..3155e876616d 100644 --- a/drivers/media/rc/ati_remote.c +++ b/drivers/media/rc/ati_remote.c @@ -773,7 +773,7 @@ static int ati_remote_initialize(struct ati_remote *ati_remote) /* Set up irq_urb */ pipe = usb_rcvintpipe(udev, ati_remote->endpoint_in->bEndpointAddress); - maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); + maxp = usb_maxpacket(udev, pipe); maxp = (maxp > DATA_BUFSIZE) ? DATA_BUFSIZE : maxp; usb_fill_int_urb(ati_remote->irq_urb, udev, pipe, ati_remote->inbuf, @@ -784,7 +784,7 @@ static int ati_remote_initialize(struct ati_remote *ati_remote) /* Set up out_urb */ pipe = usb_sndintpipe(udev, ati_remote->endpoint_out->bEndpointAddress); - maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); + maxp = usb_maxpacket(udev, pipe); maxp = (maxp > DATA_BUFSIZE) ? DATA_BUFSIZE : maxp; usb_fill_int_urb(ati_remote->out_urb, udev, pipe, ati_remote->outbuf, diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 2dc810f5a73f..0834d5f866fd 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -1728,7 +1728,7 @@ static int mceusb_dev_probe(struct usb_interface *intf, pipe = usb_rcvintpipe(dev, ep_in->bEndpointAddress); else pipe = usb_rcvbulkpipe(dev, ep_in->bEndpointAddress); - maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe)); + maxp = usb_maxpacket(dev, pipe); ir = kzalloc(sizeof(struct mceusb_dev), GFP_KERNEL); if (!ir) diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c index 16ba85d7c090..deb85330c940 100644 --- a/drivers/media/rc/streamzap.c +++ b/drivers/media/rc/streamzap.c @@ -307,7 +307,7 @@ static int streamzap_probe(struct usb_interface *intf, } pipe = usb_rcvintpipe(usbdev, endpoint->bEndpointAddress); - maxp = usb_maxpacket(usbdev, pipe, usb_pipeout(pipe)); + maxp = usb_maxpacket(usbdev, pipe); if (maxp == 0) { dev_err(&intf->dev, "%s: endpoint Max Packet Size is 0!?!\n", diff --git a/drivers/media/rc/xbox_remote.c b/drivers/media/rc/xbox_remote.c index 98d0b43608ad..7424b2031152 100644 --- a/drivers/media/rc/xbox_remote.c +++ b/drivers/media/rc/xbox_remote.c @@ -171,7 +171,7 @@ static int xbox_remote_initialize(struct xbox_remote *xbox_remote, /* Set up irq_urb */ pipe = usb_rcvintpipe(udev, endpoint_in->bEndpointAddress); - maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe)); + maxp = usb_maxpacket(udev, pipe); maxp = (maxp > DATA_BUFSIZE) ? DATA_BUFSIZE : maxp; usb_fill_int_urb(xbox_remote->irq_urb, udev, pipe, xbox_remote->inbuf, diff --git a/drivers/media/usb/tm6000/tm6000-dvb.c b/drivers/media/usb/tm6000/tm6000-dvb.c index 4990fa886d7a..335f747b0375 100644 --- a/drivers/media/usb/tm6000/tm6000-dvb.c +++ b/drivers/media/usb/tm6000/tm6000-dvb.c @@ -120,7 +120,7 @@ static int tm6000_start_stream(struct tm6000_core *dev) pipe = usb_rcvbulkpipe(dev->udev, dev->bulk_in.endp->desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); - size = usb_maxpacket(dev->udev, pipe, usb_pipeout(pipe)); + size = usb_maxpacket(dev->udev, pipe); size = size * 15; /* 512 x 8 or 12 or 15 */ dvb->bulk_urb->transfer_buffer = kzalloc(size, GFP_KERNEL); diff --git a/drivers/media/usb/tm6000/tm6000-input.c b/drivers/media/usb/tm6000/tm6000-input.c index 84602edf3fe8..5136e9e202f1 100644 --- a/drivers/media/usb/tm6000/tm6000-input.c +++ b/drivers/media/usb/tm6000/tm6000-input.c @@ -340,7 +340,7 @@ static int __tm6000_ir_int_start(struct rc_dev *rc) dev->int_in.endp->desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); - size = usb_maxpacket(dev->udev, pipe, usb_pipeout(pipe)); + size = usb_maxpacket(dev->udev, pipe); dprintk(1, "IR max size: %d\n", size); ir->int_urb->transfer_buffer = kzalloc(size, GFP_ATOMIC); diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c index e293f6f3d1bc..d855a19551f3 100644 --- a/drivers/media/usb/tm6000/tm6000-video.c +++ b/drivers/media/usb/tm6000/tm6000-video.c @@ -570,7 +570,7 @@ static int tm6000_prepare_isoc(struct tm6000_core *dev) dev->isoc_in.endp->desc.bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); - size = usb_maxpacket(dev->udev, pipe, usb_pipeout(pipe)); + size = usb_maxpacket(dev->udev, pipe); if (size > dev->isoc_in.maxsize) size = dev->isoc_in.maxsize; From patchwork Wed Mar 16 16:19:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Mailhol X-Patchwork-Id: 553326 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D003C433F5 for ; Wed, 16 Mar 2022 16:20:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357496AbiCPQVU (ORCPT ); Wed, 16 Mar 2022 12:21:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245166AbiCPQVS (ORCPT ); Wed, 16 Mar 2022 12:21:18 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E42325C71 for ; Wed, 16 Mar 2022 09:20:02 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d18so2207301plr.6 for ; Wed, 16 Mar 2022 09:20:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NavN5PfG0SoH7IP8V9kbX5XfpZ3HZw9He6gkjWERkCU=; b=aRtq8m6AplfkGdQM8vHchSXJey9gLA1J0kI7EntQwE9Bb0FR1WAX74A9Uxz1PIf2Zc uBiS05P2FGFeYZOfdploJDsS4XgPAAwkRsmVtBmGzkDkHLsFqxx927TVzs9vF1atAtsy q2UP94kXKt6RXpocnEhjQPM2apmfRsDKPPBRlNiRrBRlZIIprCAQQuRc1ASiSvPWajGp plNFZlroXgiGrFelvjZE45x40m5ENxuRs9U+gt/pkiqafevV7Z8e6YvReBPtXOduPsvz GU1MVBZx/GGHrGw4KFxzqFObscD2LwgfDMaXrTAvf6aBLCq9I5BJcbfAjQGcfaIuPWfd n3kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=NavN5PfG0SoH7IP8V9kbX5XfpZ3HZw9He6gkjWERkCU=; b=UaN1NJ1evGLZPWJKap00unt5itSu7gkUslM8+LoUFFSkIY8VQJL3JoxIxlfIKU5eV5 RySojwwNf8oHPZKoCIh38p+YcS3fc/AjJM3Y05BeuJvyjDEeJZ7Di0xmtImXcFKeGhzO Vb/qNaEvVQosutmNee6M0G/6oKJdbAVL/RvbteDvClXX7WWVzgitTnTlkrkUlJCDB4+a CJRyunmuT44uvwpDXpAml0YdGG3Vv40QxhtU0RkP1P4GZ8VSn/DLTnmEuQtM3MHAm7t5 p4SNygnAoOG5coTk/KTfe1VAX/ueZNts7QZQWrI9071qH1xpKG9sWaw9Q8pviO2UVJzP VHIQ== X-Gm-Message-State: AOAM533LcOoohux6Wgq98xI+4aslLfYLmrezuE9JUAGWnNEYE/IxoSt2 Ai5ElhCJzVR7txRYavmCYwI= X-Google-Smtp-Source: ABdhPJyrZZcXt4g/e8ADdwQu64NTcx4pQjMASNJEOEfddB6A/mhFdbe/GCAIxz7Ccpm96jqDghYc4g== X-Received: by 2002:a17:90a:4214:b0:1bf:6ae9:f62a with SMTP id o20-20020a17090a421400b001bf6ae9f62amr10966061pjg.64.1647447601567; Wed, 16 Mar 2022 09:20:01 -0700 (PDT) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id mt15-20020a17090b230f00b001bf191e6f08sm2988374pjb.9.2022.03.16.09.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 09:20:01 -0700 (PDT) Sender: Vincent Mailhol From: Vincent Mailhol To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Vincent Mailhol , Jaroslav Kysela , Takashi Iwai , Clemens Ladisch Subject: [PATCH v3 7/9] sound: usb: remove third argument of usb_maxpacket() Date: Thu, 17 Mar 2022 01:19:33 +0900 Message-Id: <20220316161935.2049-8-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316161935.2049-1-mailhol.vincent@wanadoo.fr> References: <20220304105420.1059585-1-mailhol.vincent@wanadoo.fr> <20220316161935.2049-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 CC: Takashi Iwai CC: Clemens Ladisch Signed-off-by: Vincent Mailhol --- 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; From patchwork Wed Mar 16 16:19:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Mailhol X-Patchwork-Id: 553325 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 477A2C433EF for ; Wed, 16 Mar 2022 16:20:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357515AbiCPQVY (ORCPT ); Wed, 16 Mar 2022 12:21:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357503AbiCPQVU (ORCPT ); Wed, 16 Mar 2022 12:21:20 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2D126D4FA for ; Wed, 16 Mar 2022 09:20:03 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id s8so4360767pfk.12 for ; Wed, 16 Mar 2022 09:20:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IYm0xrEfQCLBvqWht5ahAv+lSz1UlH3ACTq5MZ064P0=; b=XPyn+ehW9DJVy6/OCfscxNvpluITLGWmHyPV2yGdhxKZj+cGNPJD6bmzFPG0H1A1KA SzYZdnHljt9R6hYs1/holfNiSe19kbngdiQfdA63e3dJHEDvBjbclJOnFGQ3F9bFUs3+ E6bVk5penW0Q3gfkx4tPctYcUe2AaVWYOeXDkYazQyS+oOzgn6GvKexNz84MolqB763O EgyJhgV5Ee0BLVY+4KRDsoT1a8rPVeXaECU0bleqfhPEWuIQ5CHrF6lMNIofCOU5x6Zi nWbsG97HZQwDZod3LcCL8InlNWU4GTi/dYDA4uLjHxuKtJOgt33rSXr4n1xEr7nSvskR qN3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IYm0xrEfQCLBvqWht5ahAv+lSz1UlH3ACTq5MZ064P0=; b=cvO+biF5KjINMF2Ifg6yUiy1Bf0HojPOBPG6wzz6vXm9mD0gEbw59sxTA1n4zxs+Zd wgRN2kufLfJ3Bo8b2sGAFJ/gXb2y3+wP9BUzw3MKKh1ZmZnanI8fpLatbAMiCvGTbZCn CyAZOyKbnyUO21g/vg9EG8VP4iZR3L29iQXYvROKsxFM3AeBBVSglUA7ZYlpRlU9iQjg NLFisHYx5q7BFNQ0dsqO6fTgpaoul4sDHsT76+ywXiMc65mK7sXsK9A3eE8BtuwIDhJ4 t7CStQyO9qL+CxplRv7mlm5XKaiGAUkudLzbtrQYDVyrPeAUz7cb8hKkUD9v1qMuZ+Bc vJYg== X-Gm-Message-State: AOAM530oyXq5OqldgkCUHEJM5y/zMWKylIKO4RXP+aCcM2pVp7MbwO6p 8Mxeu4kHZiPB/mDCu+FR6wg= X-Google-Smtp-Source: ABdhPJxSw66KA066WisllxvzlMHJzvlUAx13tD6dGHd9tOHqOc4DSxYZtzr96Y8ElcTC3LdGKjZgtA== X-Received: by 2002:a05:6a00:2485:b0:4f7:37cd:d040 with SMTP id c5-20020a056a00248500b004f737cdd040mr3500pfv.55.1647447603068; Wed, 16 Mar 2022 09:20:03 -0700 (PDT) Received: from localhost.localdomain (124x33x176x97.ap124.ftth.ucom.ne.jp. [124.33.176.97]) by smtp.gmail.com with ESMTPSA id mt15-20020a17090b230f00b001bf191e6f08sm2988374pjb.9.2022.03.16.09.20.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 09:20:02 -0700 (PDT) Sender: Vincent Mailhol From: Vincent Mailhol To: Greg Kroah-Hartman , linux-usb@vger.kernel.org Cc: Vincent Mailhol Subject: [PATCH v3 8/9] usb: remove third argument of usb_maxpacket() Date: Thu, 17 Mar 2022 01:19:34 +0900 Message-Id: <20220316161935.2049-9-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220316161935.2049-1-mailhol.vincent@wanadoo.fr> References: <20220304105420.1059585-1-mailhol.vincent@wanadoo.fr> <20220316161935.2049-1-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Now that all users of usb_maxpacket() have been migrated to only use two arguments, remove the third variadic argument which was introduced for the transition. Signed-off-by: Vincent Mailhol --- include/linux/usb.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/linux/usb.h b/include/linux/usb.h index 572e136f6314..8127782aa7a1 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -1969,8 +1969,7 @@ usb_pipe_endpoint(struct usb_device *dev, unsigned int pipe) return eps[usb_pipeendpoint(pipe)]; } -static inline u16 usb_maxpacket(struct usb_device *udev, int pipe, - /* int is_out deprecated */ ...) +static inline u16 usb_maxpacket(struct usb_device *udev, int pipe) { struct usb_host_endpoint *ep; unsigned epnum = usb_pipeendpoint(pipe);