Skip to contentSkip to conversation

remove unused usb endpoint functions

PATCH In review Martin Kaiser 2 participants 6 messages Sep 10, 2021 Staging

lore
Share & tools
lore
#0 lore raw

cover remove unused usb endpoint functions

Remove driver-specific functions to detect the type and direction of a usb endpoint. Their callers have already been updated to use the helper functions from the usb core.

Martin Kaiser (4):
staging: r8188eu: remove unused function usb_endpoint_is_int
staging: r8188eu: remove unused function RT_usb_endpoint_is_bulk_in
staging: r8188eu: remove unused function RT_usb_endpoint_num
staging: r8188eu: remove the remaining usb endpoint functions

 drivers/staging/r8188eu/os_dep/usb_intf.c | 40 -----------------------
 1 file changed, 40 deletions(-)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/4 staging: r8188eu: remove unused function usb_endpoint_is_int

The usb_endpoint_is_int is not used and can be removed.

RT_usb_endpoint_xfer_int was used only by usb_endpoint_is_int. Remove this function as well.

---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/staging/r8188eu/os_dep/usb_intf.c +0 -10
index da93512993f1..1eef0423529a 100644
@@ -83,11 +83,6 @@ static inline int RT_usb_endpoint_dir_out(const struct usb_endpoint_descriptor *
 	return (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT;
 }
 
-static inline int RT_usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd)
-{
-	return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_INT;
-}
-
 static inline int RT_usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd)
 {
 	return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK;
@@ -103,11 +98,6 @@ static inline int RT_usb_endpoint_is_bulk_out(const struct usb_endpoint_descript
 	return RT_usb_endpoint_xfer_bulk(epd) && RT_usb_endpoint_dir_out(epd);
 }
 
-static inline int usb_endpoint_is_int(const struct usb_endpoint_descriptor *epd)
-{
-	return RT_usb_endpoint_xfer_int(epd) && RT_usb_endpoint_dir_in(epd);
-}
-
 static inline int RT_usb_endpoint_num(const struct usb_endpoint_descriptor *epd)
 {
 	return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/4 staging: r8188eu: remove unused function RT_usb_endpoint_is_bulk_in

In reply to Martin Kaiser

Remove the RT_usb_endpoint_is_bulk_in function which is not used.

RT_usb_endpoint_dir_in is no longer used either and can also be removed.

---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/staging/r8188eu/os_dep/usb_intf.c +0 -10
index 1eef0423529a..1071234d9e5c 100644
@@ -73,11 +73,6 @@ static struct rtw_usb_drv rtl8188e_usb_drv = {
 
 static struct rtw_usb_drv *usb_drv = &rtl8188e_usb_drv;
 
-static inline int RT_usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd)
-{
-	return (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN;
-}
-
 static inline int RT_usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd)
 {
 	return (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT;
@@ -88,11 +83,6 @@ static inline int RT_usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor
 	return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK;
 }
 
-static inline int RT_usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd)
-{
-	return RT_usb_endpoint_xfer_bulk(epd) && RT_usb_endpoint_dir_in(epd);
-}
-
 static inline int RT_usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd)
 {
 	return RT_usb_endpoint_xfer_bulk(epd) && RT_usb_endpoint_dir_out(epd);
Signature · 1 line
2.20.1
#3 lore raw

PATCH 3/4 staging: r8188eu: remove unused function RT_usb_endpoint_num

In reply to Martin Kaiser

RT_usb_endpoint_num is unused. Remove this function.

---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/staging/r8188eu/os_dep/usb_intf.c +0 -5
index 1071234d9e5c..d22022b0cc93 100644
@@ -88,11 +88,6 @@ static inline int RT_usb_endpoint_is_bulk_out(const struct usb_endpoint_descript
 	return RT_usb_endpoint_xfer_bulk(epd) && RT_usb_endpoint_dir_out(epd);
 }
 
-static inline int RT_usb_endpoint_num(const struct usb_endpoint_descriptor *epd)
-{
-	return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
-}
-
 static u8 rtw_init_intf_priv(struct dvobj_priv *dvobj)
 {
 	u8 rst = _SUCCESS;
Signature · 1 line
2.20.1
#4 lore raw

PATCH 4/4 staging: r8188eu: remove the remaining usb endpoint functions

In reply to Martin Kaiser

Remove the last bunch of unused RT_usb_endpoint_... functions.

---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 15 ---------------
 1 file changed, 15 deletions(-)
drivers/staging/r8188eu/os_dep/usb_intf.c +0 -15
index d22022b0cc93..b174cc69ded7 100644
@@ -73,21 +73,6 @@ static struct rtw_usb_drv rtl8188e_usb_drv = {
 
 static struct rtw_usb_drv *usb_drv = &rtl8188e_usb_drv;
 
-static inline int RT_usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd)
-{
-	return (epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT;
-}
-
-static inline int RT_usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd)
-{
-	return (epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK;
-}
-
-static inline int RT_usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd)
-{
-	return RT_usb_endpoint_xfer_bulk(epd) && RT_usb_endpoint_dir_out(epd);
-}
-
 static u8 rtw_init_intf_priv(struct dvobj_priv *dvobj)
 {
 	u8 rst = _SUCCESS;
Signature · 1 line
2.20.1
Acked-by on the v1 series
#5 lore raw
In reply to Martin Kaiser
Quoted 4 lines · Martin Kaiser

Remove driver-specific functions to detect the type and direction of a usb endpoint. Their callers have already been updated to use the helper functions from the usb core.

Quoted 9 lines

Martin Kaiser (4):
staging: r8188eu: remove unused function usb_endpoint_is_int
staging: r8188eu: remove unused function RT_usb_endpoint_is_bulk_in
staging: r8188eu: remove unused function RT_usb_endpoint_num
staging: r8188eu: remove the remaining usb endpoint functions

  drivers/staging/r8188eu/os_dep/usb_intf.c | 40 -----------------------
  1 file changed, 40 deletions(-)

Compiles and looks good to me.

For all 4 patches