Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #33 from tklauser/master

lsusb: Store link state descriptions without preceding space
  • Loading branch information...
commit 115695e97a186ec894511df95c4b0a2f3100a93d 2 parents 4b98630 + d9027fe
@gregkh authored
Showing with 14 additions and 14 deletions.
  1. +14 −14 lsusb.c
View
28 lsusb.c
@@ -3254,19 +3254,19 @@ static void do_hub(libusb_device_handle *fd, unsigned tt_type, unsigned speed)
+ 2 /* bitmasks */ * HUB_STATUS_BYTELEN];
int i, ret, value;
unsigned int link_state;
- char *link_state_descriptions[] = {
- " U0",
- " U1",
- " U2",
- " suspend",
- " SS.disabled",
- " Rx.Detect",
- " SS.Inactive",
- " Polling",
- " Recovery",
- " Hot Reset",
- " Compliance",
- " Loopback",
+ const char * const link_state_descriptions[] = {
+ "U0",
+ "U1",
+ "U2",
+ "suspend",
+ "SS.disabled",
+ "Rx.Detect",
+ "SS.Inactive",
+ "Polling",
+ "Recovery",
+ "Hot Reset",
+ "Compliance",
+ "Loopback",
};
/* USB 3.x hubs have a slightly different descriptor */
@@ -3352,7 +3352,7 @@ static void do_hub(libusb_device_handle *fd, unsigned tt_type, unsigned speed)
/* Link state is bits 8:5 */
if (link_state < (sizeof(link_state_descriptions) /
sizeof(*link_state_descriptions)))
- printf("%s", link_state_descriptions[link_state]);
+ printf(" %s", link_state_descriptions[link_state]);
printf("%s%s%s%s\n",
(status[0] & 0x10) ? " RESET" : "",
(status[0] & 0x08) ? " oc" : "",
Please sign in to comment.
Something went wrong with that request. Please try again.