diff mbox

[6/8] usb: Remove unused functions

Message ID 1425922215-20819-7-git-send-email-thuth@linux.vnet.ibm.com
State New
Headers show

Commit Message

Thomas Huth March 9, 2015, 5:30 p.m. UTC
Delete set_usb_string(), usb_ep_get_ifnum(), usb_ep_get_max_packet_size()
usb_ep_get_max_streams() and usb_ep_set_pipeline() since they are
not used anymore.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/core.c    |   41 -----------------------------------------
 include/hw/usb.h |    5 -----
 2 files changed, 0 insertions(+), 46 deletions(-)

Comments

Gerd Hoffmann March 10, 2015, 8:38 a.m. UTC | #1
On Mo, 2015-03-09 at 18:30 +0100, Thomas Huth wrote:
> Delete set_usb_string(), usb_ep_get_ifnum(), usb_ep_get_max_packet_size()
> usb_ep_get_max_streams() and usb_ep_set_pipeline() since they are
> not used anymore.

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>

> 
> Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/usb/core.c    |   41 -----------------------------------------
>  include/hw/usb.h |    5 -----
>  2 files changed, 0 insertions(+), 46 deletions(-)
> 
> diff --git a/hw/usb/core.c b/hw/usb/core.c
> index cf34755..d0025db 100644
> --- a/hw/usb/core.c
> +++ b/hw/usb/core.c
> @@ -331,23 +331,6 @@ void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p)
>      usb_packet_complete(s, p);
>  }
>  
> -/* XXX: fix overflow */
> -int set_usb_string(uint8_t *buf, const char *str)
> -{
> -    int len, i;
> -    uint8_t *q;
> -
> -    q = buf;
> -    len = strlen(str);
> -    *q++ = 2 * len + 2;
> -    *q++ = 3;
> -    for(i = 0; i < len; i++) {
> -        *q++ = str[i];
> -        *q++ = 0;
> -    }
> -    return q - buf;
> -}
> -
>  USBDevice *usb_find_device(USBPort *port, uint8_t addr)
>  {
>      USBDevice *dev = port->dev;
> @@ -749,12 +732,6 @@ void usb_ep_set_type(USBDevice *dev, int pid, int ep, uint8_t type)
>      uep->type = type;
>  }
>  
> -uint8_t usb_ep_get_ifnum(USBDevice *dev, int pid, int ep)
> -{
> -    struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> -    return uep->ifnum;
> -}
> -
>  void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum)
>  {
>      struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> @@ -782,12 +759,6 @@ void usb_ep_set_max_packet_size(USBDevice *dev, int pid, int ep,
>      uep->max_packet_size = size * microframes;
>  }
>  
> -int usb_ep_get_max_packet_size(USBDevice *dev, int pid, int ep)
> -{
> -    struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> -    return uep->max_packet_size;
> -}
> -
>  void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw)
>  {
>      struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> @@ -801,18 +772,6 @@ void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw)
>      }
>  }
>  
> -int usb_ep_get_max_streams(USBDevice *dev, int pid, int ep)
> -{
> -    struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> -    return uep->max_streams;
> -}
> -
> -void usb_ep_set_pipeline(USBDevice *dev, int pid, int ep, bool enabled)
> -{
> -    struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> -    uep->pipeline = enabled;
> -}
> -
>  void usb_ep_set_halted(USBDevice *dev, int pid, int ep, bool halted)
>  {
>      struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
> diff --git a/include/hw/usb.h b/include/hw/usb.h
> index e6dfb87..bdd570a 100644
> --- a/include/hw/usb.h
> +++ b/include/hw/usb.h
> @@ -445,15 +445,11 @@ void usb_ep_reset(USBDevice *dev);
>  void usb_ep_dump(USBDevice *dev);
>  struct USBEndpoint *usb_ep_get(USBDevice *dev, int pid, int ep);
>  uint8_t usb_ep_get_type(USBDevice *dev, int pid, int ep);
> -uint8_t usb_ep_get_ifnum(USBDevice *dev, int pid, int ep);
>  void usb_ep_set_type(USBDevice *dev, int pid, int ep, uint8_t type);
>  void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum);
>  void usb_ep_set_max_packet_size(USBDevice *dev, int pid, int ep,
>                                  uint16_t raw);
> -int usb_ep_get_max_packet_size(USBDevice *dev, int pid, int ep);
>  void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw);
> -int usb_ep_get_max_streams(USBDevice *dev, int pid, int ep);
> -void usb_ep_set_pipeline(USBDevice *dev, int pid, int ep, bool enabled);
>  void usb_ep_set_halted(USBDevice *dev, int pid, int ep, bool halted);
>  USBPacket *usb_ep_find_packet_by_id(USBDevice *dev, int pid, int ep,
>                                      uint64_t id);
> @@ -469,7 +465,6 @@ void usb_port_reset(USBPort *port);
>  void usb_device_reset(USBDevice *dev);
>  void usb_wakeup(USBEndpoint *ep, unsigned int stream);
>  void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p);
> -int set_usb_string(uint8_t *buf, const char *str);
>  
>  /* usb-linux.c */
>  USBDevice *usb_host_device_open(USBBus *bus, const char *devname);
diff mbox

Patch

diff --git a/hw/usb/core.c b/hw/usb/core.c
index cf34755..d0025db 100644
--- a/hw/usb/core.c
+++ b/hw/usb/core.c
@@ -331,23 +331,6 @@  void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p)
     usb_packet_complete(s, p);
 }
 
-/* XXX: fix overflow */
-int set_usb_string(uint8_t *buf, const char *str)
-{
-    int len, i;
-    uint8_t *q;
-
-    q = buf;
-    len = strlen(str);
-    *q++ = 2 * len + 2;
-    *q++ = 3;
-    for(i = 0; i < len; i++) {
-        *q++ = str[i];
-        *q++ = 0;
-    }
-    return q - buf;
-}
-
 USBDevice *usb_find_device(USBPort *port, uint8_t addr)
 {
     USBDevice *dev = port->dev;
@@ -749,12 +732,6 @@  void usb_ep_set_type(USBDevice *dev, int pid, int ep, uint8_t type)
     uep->type = type;
 }
 
-uint8_t usb_ep_get_ifnum(USBDevice *dev, int pid, int ep)
-{
-    struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
-    return uep->ifnum;
-}
-
 void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum)
 {
     struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
@@ -782,12 +759,6 @@  void usb_ep_set_max_packet_size(USBDevice *dev, int pid, int ep,
     uep->max_packet_size = size * microframes;
 }
 
-int usb_ep_get_max_packet_size(USBDevice *dev, int pid, int ep)
-{
-    struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
-    return uep->max_packet_size;
-}
-
 void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw)
 {
     struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
@@ -801,18 +772,6 @@  void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw)
     }
 }
 
-int usb_ep_get_max_streams(USBDevice *dev, int pid, int ep)
-{
-    struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
-    return uep->max_streams;
-}
-
-void usb_ep_set_pipeline(USBDevice *dev, int pid, int ep, bool enabled)
-{
-    struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
-    uep->pipeline = enabled;
-}
-
 void usb_ep_set_halted(USBDevice *dev, int pid, int ep, bool halted)
 {
     struct USBEndpoint *uep = usb_ep_get(dev, pid, ep);
diff --git a/include/hw/usb.h b/include/hw/usb.h
index e6dfb87..bdd570a 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -445,15 +445,11 @@  void usb_ep_reset(USBDevice *dev);
 void usb_ep_dump(USBDevice *dev);
 struct USBEndpoint *usb_ep_get(USBDevice *dev, int pid, int ep);
 uint8_t usb_ep_get_type(USBDevice *dev, int pid, int ep);
-uint8_t usb_ep_get_ifnum(USBDevice *dev, int pid, int ep);
 void usb_ep_set_type(USBDevice *dev, int pid, int ep, uint8_t type);
 void usb_ep_set_ifnum(USBDevice *dev, int pid, int ep, uint8_t ifnum);
 void usb_ep_set_max_packet_size(USBDevice *dev, int pid, int ep,
                                 uint16_t raw);
-int usb_ep_get_max_packet_size(USBDevice *dev, int pid, int ep);
 void usb_ep_set_max_streams(USBDevice *dev, int pid, int ep, uint8_t raw);
-int usb_ep_get_max_streams(USBDevice *dev, int pid, int ep);
-void usb_ep_set_pipeline(USBDevice *dev, int pid, int ep, bool enabled);
 void usb_ep_set_halted(USBDevice *dev, int pid, int ep, bool halted);
 USBPacket *usb_ep_find_packet_by_id(USBDevice *dev, int pid, int ep,
                                     uint64_t id);
@@ -469,7 +465,6 @@  void usb_port_reset(USBPort *port);
 void usb_device_reset(USBDevice *dev);
 void usb_wakeup(USBEndpoint *ep, unsigned int stream);
 void usb_generic_async_ctrl_complete(USBDevice *s, USBPacket *p);
-int set_usb_string(uint8_t *buf, const char *str);
 
 /* usb-linux.c */
 USBDevice *usb_host_device_open(USBBus *bus, const char *devname);