MCPcopy Create free account
hub / github.com/F-Stack/f-stack / device_printf

Function device_printf

freebsd/kern/subr_bus.c:2407–2436  ·  view source on GitHub ↗

* @brief Print the name of the device followed by a colon, a space * and the result of calling vprintf() with the value of @p fmt and * the following arguments. * * @returns the number of characters printed */

Source from the content-addressed store, hash-verified

2405 * @returns the number of characters printed
2406 */
2407int
2408device_printf(device_t dev, const char * fmt, ...)
2409{
2410 char buf[128];
2411 struct sbuf sb;
2412 const char *name;
2413 va_list ap;
2414 size_t retval;
2415
2416 retval = 0;
2417
2418 sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN);
2419 sbuf_set_drain(&sb, sbuf_printf_drain, &retval);
2420
2421 name = device_get_name(dev);
2422
2423 if (name == NULL)
2424 sbuf_cat(&sb, "unknown: ");
2425 else
2426 sbuf_printf(&sb, "%s%d: ", name, device_get_unit(dev));
2427
2428 va_start(ap, fmt);
2429 sbuf_vprintf(&sb, fmt, ap);
2430 va_end(ap);
2431
2432 sbuf_finish(&sb);
2433 sbuf_delete(&sb);
2434
2435 return (retval);
2436}
2437
2438/**
2439 * @internal

Callers 15

bcm_vchiq_attachFunction · 0.85
ossl_attachFunction · 0.85
blake2_attachFunction · 0.85
aesni_probeFunction · 0.85
aesni_attachFunction · 0.85
armv8_crypto_probeFunction · 0.85
armv8_crypto_attachFunction · 0.85
ccp_assign_lsb_regionsFunction · 0.85
ccp_hw_attach_queueFunction · 0.85
ccp_map_pci_barFunction · 0.85
ccp_intr_handle_errorFunction · 0.85
ccp_intr_handlerFunction · 0.85

Calls 9

sbuf_newFunction · 0.85
sbuf_set_drainFunction · 0.85
device_get_nameFunction · 0.85
sbuf_catFunction · 0.85
sbuf_printfFunction · 0.85
device_get_unitFunction · 0.85
sbuf_vprintfFunction · 0.85
sbuf_finishFunction · 0.85
sbuf_deleteFunction · 0.85

Tested by

no test coverage detected