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 47F11C433F5 for ; Mon, 13 Dec 2021 10:05:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241749AbhLMKFM (ORCPT ); Mon, 13 Dec 2021 05:05:12 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:44506 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238275AbhLMJ77 (ORCPT ); Mon, 13 Dec 2021 04:59:59 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8EAC9B80E7C; Mon, 13 Dec 2021 09:59:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E489C34602; Mon, 13 Dec 2021 09:59:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1639389597; bh=iV7hY+24lHXYb0ugaOaJv+4a10EG7s1MTFwQxMWJiQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lkgEvOqDYWRlIiUYGApdetef8htT+4C7T028zppr5/riSE5xubiGYRL13SBgCCnGv r9yZOkBMTpfMlBovh+H+9FSTaVmb3li3X0M8WfI6j5PAzxIu372U5vGb53Fw9SD/VE T2F+HjneoYPHuHIeBHI9Wco5ww5AJEiuZyukYYJ8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alan Stern , Pavel Hofman Subject: [PATCH 5.15 141/171] usb: core: config: using bit mask instead of individual bits Date: Mon, 13 Dec 2021 10:30:56 +0100 Message-Id: <20211213092949.777660927@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211213092945.091487407@linuxfoundation.org> References: <20211213092945.091487407@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Hofman commit ca5737396927afd4d57b133fd2874bbcf3421cdb upstream. Using standard USB_EP_MAXP_MULT_MASK instead of individual bits for extracting multiple-transactions bits from wMaxPacketSize value. Acked-by: Alan Stern Signed-off-by: Pavel Hofman Link: https://lore.kernel.org/r/20211210085219.16796-2-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/core/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -422,9 +422,9 @@ static int usb_parse_endpoint(struct dev maxpacket_maxes = full_speed_maxpacket_maxes; break; case USB_SPEED_HIGH: - /* Bits 12..11 are allowed only for HS periodic endpoints */ + /* Multiple-transactions bits are allowed only for HS periodic endpoints */ if (usb_endpoint_xfer_int(d) || usb_endpoint_xfer_isoc(d)) { - i = maxp & (BIT(12) | BIT(11)); + i = maxp & USB_EP_MAXP_MULT_MASK; maxp &= ~i; } fallthrough;