Changes in / [bfc12ef:458e40c] in mainline
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/main.c
rbfc12ef r458e40c 65 65 int main(int argc, char *argv[]) 66 66 { 67 usb_ dprintf_enable(NAME, USB_LOG_LEVEL_INFO);67 usb_log_enable(USB_LOG_LEVEL_INFO, NAME); 68 68 69 69 fibril_mutex_initialize(&usb_hub_list_lock); -
uspace/drv/usbhub/usbhub_private.h
rbfc12ef r458e40c 65 65 //************ 66 66 #define dprintf(level, format, ...) \ 67 usb_ dprintf(NAME,(level), format "\n", ##__VA_ARGS__)67 usb_log_printf((level), format "\n", ##__VA_ARGS__) 68 68 69 69 -
uspace/lib/usb/src/debug.c
rbfc12ef r458e40c 206 206 void usb_log_printf(usb_log_level_t level, const char *format, ...) 207 207 { 208 FILE *s tream = NULL;208 FILE *screen_stream = NULL; 209 209 switch (level) { 210 210 case USB_LOG_LEVEL_FATAL: 211 211 case USB_LOG_LEVEL_ERROR: 212 s tream = stderr;212 screen_stream = stderr; 213 213 break; 214 214 default: 215 s tream = stdout;215 screen_stream = stdout; 216 216 break; 217 217 } 218 assert(s tream != NULL);218 assert(screen_stream != NULL); 219 219 220 220 va_list args; 221 va_start(args, format);222 221 223 222 /* … … 231 230 232 231 if (log_stream != NULL) { 232 va_start(args, format); 233 233 234 fprintf(log_stream, "[%s]%s: ", log_prefix, level_name); 234 235 vfprintf(log_stream, format, args); 236 fflush(log_stream); 237 238 va_end(args); 235 239 } 236 240 237 241 if (level <= log_level) { 238 fprintf(stream, "[%s]%s: ", log_prefix, level_name); 239 vfprintf(stream, format, args); 242 va_start(args, format); 243 244 fprintf(screen_stream, "[%s]%s: ", log_prefix, level_name); 245 vfprintf(screen_stream, format, args); 246 fflush(screen_stream); 247 248 va_end(args); 240 249 } 241 250 242 251 fibril_mutex_unlock(&log_serializer); 243 244 va_end(args);245 252 } 246 253 -
uspace/lib/usb/src/recognise.c
rbfc12ef r458e40c 359 359 { 360 360 static size_t device_name_index = 0; 361 static FIBRIL_MUTEX_INITIALIZE(device_name_index_mutex); 362 363 size_t this_device_name_index; 364 365 fibril_mutex_lock(&device_name_index_mutex); 366 this_device_name_index = device_name_index; 367 device_name_index++; 368 fibril_mutex_unlock(&device_name_index_mutex); 369 361 370 362 371 device_t *child = NULL; … … 374 383 * naming etc., something more descriptive could be created. 375 384 */ 376 rc = asprintf(&child_name, "usbdev%02zu", device_name_index);385 rc = asprintf(&child_name, "usbdev%02zu", this_device_name_index); 377 386 if (rc < 0) { 378 387 goto failure; … … 396 405 } 397 406 398 device_name_index++;399 400 407 return EOK; 401 408
Note:
See TracChangeset
for help on using the changeset viewer.