Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp634914pxt; Thu, 12 Aug 2021 06:25:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxyCd6PdhtxvZH/XTCkrBZkJeJRg4c/C+6LfbudDZidPSNLRKqKplQq20ducf1xeei1kdA X-Received: by 2002:a17:906:4750:: with SMTP id j16mr3601330ejs.26.1628774745384; Thu, 12 Aug 2021 06:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628774745; cv=none; d=google.com; s=arc-20160816; b=MOKB3iGDvXt1O5ZH5L8Ormx60QjAZka5tegLSSA3wn/vdsdY7csDtK+Or0Md0DaFUq 4bRxlrh8114jk4Tbf/onGFLx1yPbFxDnIgIBgD0QjJGZmOqaP8fTGOLyYtrhxAKTj9bN L+ApptJbgBH2Cgd3GD/mXl2U6dUrkxRGCRLeOywD8gNkjxSdsTDS8eG7NLWIjp3/INaD MUzt4pexPMJA+sB2OzH8dH+mclNZWU0i9PD5hGFQpx/EXCZG2250GmFxLmY+Nf0BxNt9 mfygIJL9inQFlFspEyBf+vKSmYdpZqQ5lzOeLDQRKoBfsX687ZHK6ILHiSsXAfIs/Dyn Nyow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=bv1Rq8TR5zFAnWCiN1qTX1dC17tnsmgIoYr4fbSet0E=; b=fSocApOtjvr5hYYOtdfDIsRxPNN0FDZWRRLpGXX4G20RmFgeZUNPiTmN1hhSniywB6 OuWTZrFf3/rjP0rP67NZZPIiCf7bCmngCf9NVv7FrREOU3LVZnf7koWtxv8PrIYegJFm Ahyx59eUu2iwKdLCtKDEjydtrMR18lUEjO5qXokvY/Je2HezTkbye50AxnQpYcKvDtN4 EBkvIij1hEvYXvjrx7Gd7M3O7rBKDnCygxUH59LdGxQlfr0mBc9b+C3WpWcurug0gpSw OSfCfWmaqai8wJ32F2nGHMOCC6uBsFxupkrtfMgSfg9/RTV9Bf10TPkPSE4kd792Djzo ltbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a25si2403068ejc.304.2021.08.12.06.25.21; Thu, 12 Aug 2021 06:25:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237786AbhHLNXH (ORCPT + 99 others); Thu, 12 Aug 2021 09:23:07 -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 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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); } -- 2.18.0