From patchwork Thu Aug 12 13:18:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2h1bmZlbmcgWXVuICjkupHmmKXls7Ap?= X-Patchwork-Id: 12433549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29150C3F6A3 for ; Thu, 12 Aug 2021 13:22:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1947461059 for ; Thu, 12 Aug 2021 13:22:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237771AbhHLNWm (ORCPT ); Thu, 12 Aug 2021 09:22:42 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:49864 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S237519AbhHLNTM (ORCPT ); Thu, 12 Aug 2021 09:19:12 -0400 X-UUID: 784ae4dc5f974741b6be19797cfd0f9e-20210812 X-UUID: 784ae4dc5f974741b6be19797cfd0f9e-20210812 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1053439353; Thu, 12 Aug 2021 21:18:44 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 12 Aug 2021 21:18:43 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 12 Aug 2021 21:18:42 +0800 From: Chunfeng Yun To: Greg Kroah-Hartman , Felipe Balbi CC: Pawel Laszczak , Al Cooper , Thierry Reding , Jonathan Hunter , Chunfeng Yun , Matthias Brugger , Christophe JAILLET , Yang Yingliang , Rikard Falkeborn , , , , , , , Eddie Hung Subject: [PATCH v2 7/7] usb: gadget: remove unnecessary AND operation when get ep maxp Date: Thu, 12 Aug 2021 21:18:03 +0800 Message-ID: <1628774283-475-7-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1628774283-475-1-git-send-email-chunfeng.yun@mediatek.com> References: <1628774283-475-1-git-send-email-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org usb_endpoint_maxp() already returns actual max packet size, no need AND 0x7ff. Acked-by: Felipe Balbi Signed-off-by: Chunfeng Yun --- v2: add acked-by felipe --- include/linux/usb/gadget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 75c7538e350a..f181c84310b6 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -491,7 +491,7 @@ extern char *usb_get_gadget_udc_name(void); */ static inline size_t usb_ep_align(struct usb_ep *ep, size_t len) { - int max_packet_size = (size_t)usb_endpoint_maxp(ep->desc) & 0x7ff; + int max_packet_size = (size_t)usb_endpoint_maxp(ep->desc); return round_up(len, max_packet_size); }