mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>,
	Michael Straube <straube.linux@gmail.com>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH 7/8] staging: r8188eu: don't store nr_endpoint in a global struct
Date: Fri, 26 Nov 2021 18:32:04 +0100	[thread overview]
Message-ID: <20211126173205.21352-8-martin@kaiser.cx> (raw)
In-Reply-To: <20211126173205.21352-1-martin@kaiser.cx>

There's no need to store the number of endpoints in a global struct.
We only need it at startup when we iterate over the endpoints.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/include/drv_types.h | 1 -
 drivers/staging/r8188eu/os_dep/usb_intf.c   | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/r8188eu/include/drv_types.h b/drivers/staging/r8188eu/include/drv_types.h
index a3fb509f3f90..1eb6b5f29425 100644
--- a/drivers/staging/r8188eu/include/drv_types.h
+++ b/drivers/staging/r8188eu/include/drv_types.h
@@ -145,7 +145,6 @@ struct dvobj_priv {
 
 /*-------- below is for USB INTERFACE --------*/
 
-	u8	nr_endpoint;
 	u8	ishighspeed;
 	u8	RtNumInPipes;
 	u8	RtNumOutPipes;
diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 8aa22c2f56cd..04454237a477 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -97,9 +97,8 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
 
 	pdvobjpriv->NumInterfaces = pconf_desc->bNumInterfaces;
 	pdvobjpriv->InterfaceNumber = piface_desc->bInterfaceNumber;
-	pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints;
 
-	for (i = 0; i < pdvobjpriv->nr_endpoint; i++) {
+	for (i = 0; i < piface_desc->bNumEndpoints; i++) {
 		int ep_num;
 		pendp_desc = &phost_iface->endpoint[i].desc;
 
-- 
2.20.1


  parent reply	other threads:[~2021-11-26 17:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-26 17:31 [PATCH 0/8] staging: r8188eu: simplify usb in ep handling Martin Kaiser
2021-11-26 17:31 ` [PATCH 1/8] staging: r8188eu: rtw_read_port needs no cnt parameter Martin Kaiser
2021-11-26 17:31 ` [PATCH 2/8] staging: r8188eu: only the bulk in ep is used for network data Martin Kaiser
2021-11-26 17:32 ` [PATCH 3/8] staging: r8188eu: get the rcv bulk pipe handle directly Martin Kaiser
2021-11-26 17:32 ` [PATCH 4/8] staging: r8188eu: remove code to get int in pipe handle Martin Kaiser
2021-11-26 17:32 ` [PATCH 5/8] staging: r8188eu: if2 is not used Martin Kaiser
2021-11-26 17:32 ` [PATCH 6/8] staging: r8188eu: remove ep_num array Martin Kaiser
2021-11-26 17:32 ` Martin Kaiser [this message]
2021-11-26 17:32 ` [PATCH 8/8] staging: r8188eu: require a single bulk in endpoint Martin Kaiser

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=20211126173205.21352-8-martin@kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=phil@philpotter.co.uk \
    --cc=straube.linux@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®