Changeset 6f05705 in mainline for uspace/drv/bus/usb/usbhub/usbhub.c
- Timestamp:
- 2011-10-07T17:12:30Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fec6bf2
- Parents:
- 75f9dcd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/usbhub.c
r75f9dcd r6f05705 212 212 info->ports = NULL; 213 213 info->port_count = -1; 214 info->pending_ops_count = 0; 214 215 fibril_mutex_initialize(&info->pending_ops_mutex); 215 216 fibril_condvar_initialize(&info->pending_ops_cv); 216 info->pending_ops_count = 0;217 217 218 218 return info; … … 254 254 // TODO: +1 hack is no longer necessary 255 255 hub_info->ports = 256 malloc(sizeof(usb_hub_port_t) * (hub_info->port_count + 1));256 calloc(hub_info->port_count + 1, sizeof(usb_hub_port_t)); 257 257 if (!hub_info->ports) { 258 258 return ENOMEM; 259 259 } 260 260 261 size_t port; 262 for (port = 0; port < hub_info->port_count + 1; ++port) { 261 for (size_t port = 1; port < hub_info->port_count + 1; ++port) { 263 262 usb_hub_port_init(&hub_info->ports[port], port, control_pipe); 264 263 } … … 271 270 & HUB_CHAR_POWER_PER_PORT_FLAG; 272 271 273 for ( port = 1; port <= hub_info->port_count; ++port) {272 for (size_t port = 1; port <= hub_info->port_count; ++port) { 274 273 usb_log_debug("Powering port %zu.\n", port); 275 274 opResult = usb_hub_port_set_feature(
Note:
See TracChangeset
for help on using the changeset viewer.