LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 0/4] remove unused usb endpoint functions
@ 2021-09-10 20:21 Martin Kaiser
  2021-09-10 20:21 ` [PATCH 1/4] staging: r8188eu: remove unused function usb_endpoint_is_int Martin Kaiser
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Martin Kaiser @ 2021-09-10 20:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, 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.

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(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] staging: r8188eu: remove unused function usb_endpoint_is_int
  2021-09-10 20:21 [PATCH 0/4] remove unused usb endpoint functions Martin Kaiser
@ 2021-09-10 20:21 ` Martin Kaiser
  2021-09-10 20:21 ` [PATCH 2/4] staging: r8188eu: remove unused function RT_usb_endpoint_is_bulk_in Martin Kaiser
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Martin Kaiser @ 2021-09-10 20:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

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.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index da93512993f1..1eef0423529a 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -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;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/4] staging: r8188eu: remove unused function RT_usb_endpoint_is_bulk_in
  2021-09-10 20:21 [PATCH 0/4] remove unused usb endpoint functions Martin Kaiser
  2021-09-10 20:21 ` [PATCH 1/4] staging: r8188eu: remove unused function usb_endpoint_is_int Martin Kaiser
@ 2021-09-10 20:21 ` Martin Kaiser
  2021-09-10 20:21 ` [PATCH 3/4] staging: r8188eu: remove unused function RT_usb_endpoint_num Martin Kaiser
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Martin Kaiser @ 2021-09-10 20:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, 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.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 1eef0423529a..1071234d9e5c 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -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);
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/4] staging: r8188eu: remove unused function RT_usb_endpoint_num
  2021-09-10 20:21 [PATCH 0/4] remove unused usb endpoint functions Martin Kaiser
  2021-09-10 20:21 ` [PATCH 1/4] staging: r8188eu: remove unused function usb_endpoint_is_int Martin Kaiser
  2021-09-10 20:21 ` [PATCH 2/4] staging: r8188eu: remove unused function RT_usb_endpoint_is_bulk_in Martin Kaiser
@ 2021-09-10 20:21 ` Martin Kaiser
  2021-09-10 20:21 ` [PATCH 4/4] staging: r8188eu: remove the remaining usb endpoint functions Martin Kaiser
  2021-09-10 21:06 ` [PATCH 0/4] remove unused " Michael Straube
  4 siblings, 0 replies; 6+ messages in thread
From: Martin Kaiser @ 2021-09-10 20:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

RT_usb_endpoint_num is unused. Remove this function.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index 1071234d9e5c..d22022b0cc93 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -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;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4/4] staging: r8188eu: remove the remaining usb endpoint functions
  2021-09-10 20:21 [PATCH 0/4] remove unused usb endpoint functions Martin Kaiser
                   ` (2 preceding siblings ...)
  2021-09-10 20:21 ` [PATCH 3/4] staging: r8188eu: remove unused function RT_usb_endpoint_num Martin Kaiser
@ 2021-09-10 20:21 ` Martin Kaiser
  2021-09-10 21:06 ` [PATCH 0/4] remove unused " Michael Straube
  4 siblings, 0 replies; 6+ messages in thread
From: Martin Kaiser @ 2021-09-10 20:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, Michael Straube, linux-staging,
	linux-kernel, Martin Kaiser

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

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/staging/r8188eu/os_dep/usb_intf.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/drivers/staging/r8188eu/os_dep/usb_intf.c b/drivers/staging/r8188eu/os_dep/usb_intf.c
index d22022b0cc93..b174cc69ded7 100644
--- a/drivers/staging/r8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/r8188eu/os_dep/usb_intf.c
@@ -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;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/4] remove unused usb endpoint functions
  2021-09-10 20:21 [PATCH 0/4] remove unused usb endpoint functions Martin Kaiser
                   ` (3 preceding siblings ...)
  2021-09-10 20:21 ` [PATCH 4/4] staging: r8188eu: remove the remaining usb endpoint functions Martin Kaiser
@ 2021-09-10 21:06 ` Michael Straube
  4 siblings, 0 replies; 6+ messages in thread
From: Michael Straube @ 2021-09-10 21:06 UTC (permalink / raw)
  To: Martin Kaiser, Greg Kroah-Hartman
  Cc: Larry Finger, Phillip Potter, linux-staging, linux-kernel

On 9/10/21 22:21, Martin Kaiser wrote:
> 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(-)
> 

Compiles and looks good to me.

For all 4 patches

Acked-by: Michael Straube <straube.linux@gmail.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-09-10 21:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-10 20:21 [PATCH 0/4] remove unused usb endpoint functions Martin Kaiser
2021-09-10 20:21 ` [PATCH 1/4] staging: r8188eu: remove unused function usb_endpoint_is_int Martin Kaiser
2021-09-10 20:21 ` [PATCH 2/4] staging: r8188eu: remove unused function RT_usb_endpoint_is_bulk_in Martin Kaiser
2021-09-10 20:21 ` [PATCH 3/4] staging: r8188eu: remove unused function RT_usb_endpoint_num Martin Kaiser
2021-09-10 20:21 ` [PATCH 4/4] staging: r8188eu: remove the remaining usb endpoint functions Martin Kaiser
2021-09-10 21:06 ` [PATCH 0/4] remove unused " Michael Straube

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).