diff options
author | Johan Hovold <johan@kernel.org> | 2017-03-02 06:51:15 -0500 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2017-03-16 05:13:37 -0400 |
commit | ef88f33fc1ee0a12a1e5eee7e4f70b7743100a19 (patch) | |
tree | 6611aadb6396fe174a3c3d657cef11391266c65e | |
parent | c2fef4564cae387c2f724a95350084c2e9371250 (diff) |
USB: serial: clean up endpoint and port-counter types
Use unsigned-char type for the endpoint and port counters.
Signed-off-by: Johan Hovold <johan@kernel.org>
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 14 | ||||
-rw-r--r-- | include/linux/usb/serial.h | 11 |
2 files changed, 13 insertions, 12 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index c20d90ed1ef2..e5b859ad15c6 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -728,12 +728,12 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
728 | int buffer_size; | 728 | int buffer_size; |
729 | int i; | 729 | int i; |
730 | int j; | 730 | int j; |
731 | int num_interrupt_in = 0; | 731 | unsigned char num_interrupt_in = 0; |
732 | int num_interrupt_out = 0; | 732 | unsigned char num_interrupt_out = 0; |
733 | int num_bulk_in = 0; | 733 | unsigned char num_bulk_in = 0; |
734 | int num_bulk_out = 0; | 734 | unsigned char num_bulk_out = 0; |
735 | int num_ports = 0; | 735 | int num_ports = 0; |
736 | int max_endpoints; | 736 | unsigned char max_endpoints; |
737 | 737 | ||
738 | mutex_lock(&table_lock); | 738 | mutex_lock(&table_lock); |
739 | type = search_serial_device(interface); | 739 | type = search_serial_device(interface); |
@@ -879,7 +879,7 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
879 | num_ports = MAX_NUM_PORTS; | 879 | num_ports = MAX_NUM_PORTS; |
880 | } | 880 | } |
881 | 881 | ||
882 | serial->num_ports = num_ports; | 882 | serial->num_ports = (unsigned char)num_ports; |
883 | serial->num_bulk_in = num_bulk_in; | 883 | serial->num_bulk_in = num_bulk_in; |
884 | serial->num_bulk_out = num_bulk_out; | 884 | serial->num_bulk_out = num_bulk_out; |
885 | serial->num_interrupt_in = num_interrupt_in; | 885 | serial->num_interrupt_in = num_interrupt_in; |
@@ -894,7 +894,7 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
894 | max_endpoints = max(num_bulk_in, num_bulk_out); | 894 | max_endpoints = max(num_bulk_in, num_bulk_out); |
895 | max_endpoints = max(max_endpoints, num_interrupt_in); | 895 | max_endpoints = max(max_endpoints, num_interrupt_in); |
896 | max_endpoints = max(max_endpoints, num_interrupt_out); | 896 | max_endpoints = max(max_endpoints, num_interrupt_out); |
897 | max_endpoints = max(max_endpoints, (int)serial->num_ports); | 897 | max_endpoints = max(max_endpoints, serial->num_ports); |
898 | serial->num_port_pointers = max_endpoints; | 898 | serial->num_port_pointers = max_endpoints; |
899 | 899 | ||
900 | dev_dbg(ddev, "setting up %d port structure(s)\n", max_endpoints); | 900 | dev_dbg(ddev, "setting up %d port structure(s)\n", max_endpoints); |
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 704a1ab8240c..85b475933848 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -159,10 +159,10 @@ struct usb_serial { | |||
159 | unsigned char minors_reserved:1; | 159 | unsigned char minors_reserved:1; |
160 | unsigned char num_ports; | 160 | unsigned char num_ports; |
161 | unsigned char num_port_pointers; | 161 | unsigned char num_port_pointers; |
162 | char num_interrupt_in; | 162 | unsigned char num_interrupt_in; |
163 | char num_interrupt_out; | 163 | unsigned char num_interrupt_out; |
164 | char num_bulk_in; | 164 | unsigned char num_bulk_in; |
165 | char num_bulk_out; | 165 | unsigned char num_bulk_out; |
166 | struct usb_serial_port *port[MAX_NUM_PORTS]; | 166 | struct usb_serial_port *port[MAX_NUM_PORTS]; |
167 | struct kref kref; | 167 | struct kref kref; |
168 | struct mutex disc_mutex; | 168 | struct mutex disc_mutex; |
@@ -227,13 +227,14 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data) | |||
227 | struct usb_serial_driver { | 227 | struct usb_serial_driver { |
228 | const char *description; | 228 | const char *description; |
229 | const struct usb_device_id *id_table; | 229 | const struct usb_device_id *id_table; |
230 | char num_ports; | ||
231 | 230 | ||
232 | struct list_head driver_list; | 231 | struct list_head driver_list; |
233 | struct device_driver driver; | 232 | struct device_driver driver; |
234 | struct usb_driver *usb_driver; | 233 | struct usb_driver *usb_driver; |
235 | struct usb_dynids dynids; | 234 | struct usb_dynids dynids; |
236 | 235 | ||
236 | unsigned char num_ports; | ||
237 | |||
237 | size_t bulk_in_size; | 238 | size_t bulk_in_size; |
238 | size_t bulk_out_size; | 239 | size_t bulk_out_size; |
239 | 240 | ||