Changeset ebcb05a in mainline


Ignore:
Timestamp:
2011-04-01T19:00:51Z (13 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
969585f, ea53529
Parents:
bdbb6f6
Message:

Logging functions should append newline automatically. Since one has no
choice but to end log message with a newline, there is no need to do it
manually in every invocation.

Location:
uspace
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/isa/isa.c

    rbdbb6f6 rebcb05a  
    135135        fd = open(conf_path, O_RDONLY);
    136136        if (fd < 0) {
    137                 ddf_msg(LVL_ERROR, "Unable to open %s\n", conf_path);
     137                ddf_msg(LVL_ERROR, "Unable to open %s", conf_path);
    138138                goto cleanup;
    139139        }
     
    144144        lseek(fd, 0, SEEK_SET);
    145145        if (len == 0) {
    146                 ddf_msg(LVL_ERROR, "Configuration file '%s' is empty.\n",
     146                ddf_msg(LVL_ERROR, "Configuration file '%s' is empty.",
    147147                    conf_path);
    148148                goto cleanup;
     
    151151        buf = malloc(len + 1);
    152152        if (buf == NULL) {
    153                 ddf_msg(LVL_ERROR, "Memory allocation failed.\n");
     153                ddf_msg(LVL_ERROR, "Memory allocation failed.");
    154154                goto cleanup;
    155155        }
    156156
    157157        if (0 >= read(fd, buf, len)) {
    158                 ddf_msg(LVL_ERROR, "Unable to read file '%s'.\n", conf_path);
     158                ddf_msg(LVL_ERROR, "Unable to read file '%s'.", conf_path);
    159159                goto cleanup;
    160160        }
     
    252252                fun->hw_resources.count++;
    253253
    254                 ddf_msg(LVL_NOTE, "Added irq 0x%x to function %s\n", irq,
     254                ddf_msg(LVL_NOTE, "Added irq 0x%x to function %s", irq,
    255255                    fun->fnode->name);
    256256        }
     
    271271
    272272                ddf_msg(LVL_NOTE, "Added io range (addr=0x%x, size=0x%x) to "
    273                     "function %s\n", (unsigned int) addr, (unsigned int) len,
     273                    "function %s", (unsigned int) addr, (unsigned int) len,
    274274                    fun->fnode->name);
    275275        }
     
    332332        if (val == end) {
    333333                ddf_msg(LVL_ERROR, "Cannot read match score for function "
    334                     "%s.\n", fun->fnode->name);
     334                    "%s.", fun->fnode->name);
    335335                return;
    336336        }
     
    339339        get_match_id(&id, val);
    340340        if (id == NULL) {
    341                 ddf_msg(LVL_ERROR, "Cannot read match ID for function %s.\n",
     341                ddf_msg(LVL_ERROR, "Cannot read match ID for function %s.",
    342342                    fun->fnode->name);
    343343                return;
     
    345345
    346346        ddf_msg(LVL_DEBUG, "Adding match id '%s' with score %d to "
    347             "function %s\n", id, score, fun->fnode->name);
     347            "function %s", id, score, fun->fnode->name);
    348348
    349349        rc = ddf_fun_add_match_id(fun->fnode, id, score);
    350350        if (rc != EOK) {
    351                 ddf_msg(LVL_ERROR, "Failed adding match ID: %s\n",
     351                ddf_msg(LVL_ERROR, "Failed adding match ID: %s",
    352352                    str_error(rc));
    353353        }
     
    379379            !prop_parse(fun, line, "match", &fun_parse_match_id)) {
    380380
    381                 ddf_msg(LVL_ERROR, "Undefined device property at line '%s'\n",
     381                ddf_msg(LVL_ERROR, "Undefined device property at line '%s'",
    382382                    line);
    383383        }
     
    441441        fun->fnode->ops = &isa_fun_ops;
    442442
    443         ddf_msg(LVL_DEBUG, "Binding function %s.\n", fun->fnode->name);
     443        ddf_msg(LVL_DEBUG, "Binding function %s.", fun->fnode->name);
    444444
    445445        /* XXX Handle error */
     
    469469static int isa_add_device(ddf_dev_t *dev)
    470470{
    471         ddf_msg(LVL_DEBUG, "isa_add_device, device handle = %d\n",
     471        ddf_msg(LVL_DEBUG, "isa_add_device, device handle = %d",
    472472            (int) dev->handle);
    473473
    474474        /* Make the bus device more visible. Does not do anything. */
    475         ddf_msg(LVL_DEBUG, "Adding a 'ctl' function\n");
     475        ddf_msg(LVL_DEBUG, "Adding a 'ctl' function");
    476476
    477477        ddf_fun_t *ctl = ddf_fun_create(dev, fun_exposed, "ctl");
    478478        if (ctl == NULL) {
    479                 ddf_msg(LVL_ERROR, "Failed creating control function.\n");
     479                ddf_msg(LVL_ERROR, "Failed creating control function.");
    480480                return EXDEV;
    481481        }
    482482
    483483        if (ddf_fun_bind(ctl) != EOK) {
    484                 ddf_msg(LVL_ERROR, "Failed binding control function.\n");
     484                ddf_msg(LVL_ERROR, "Failed binding control function.");
    485485                return EXDEV;
    486486        }
     
    488488        /* Add functions as specified in the configuration file. */
    489489        isa_functions_add(dev);
    490         ddf_msg(LVL_NOTE, "Finished enumerating legacy functions\n");
     490        ddf_msg(LVL_NOTE, "Finished enumerating legacy functions");
    491491
    492492        return EOK;
  • uspace/drv/ns8250/ns8250.c

    rbdbb6f6 rebcb05a  
    276276static bool ns8250_pio_enable(ns8250_t *ns)
    277277{
    278         ddf_msg(LVL_DEBUG, "ns8250_pio_enable %s\n", ns->dev->name);
     278        ddf_msg(LVL_DEBUG, "ns8250_pio_enable %s", ns->dev->name);
    279279       
    280280        /* Gain control over port's registers. */
     
    282282            (void **) &ns->port)) {
    283283                ddf_msg(LVL_ERROR, "Cannot map the port %#" PRIx32
    284                     " for device %s.\n", ns->io_addr, ns->dev->name);
     284                    " for device %s.", ns->io_addr, ns->dev->name);
    285285                return false;
    286286        }
     
    296296static bool ns8250_dev_probe(ns8250_t *ns)
    297297{
    298         ddf_msg(LVL_DEBUG, "ns8250_dev_probe %s\n", ns->dev->name);
     298        ddf_msg(LVL_DEBUG, "ns8250_dev_probe %s", ns->dev->name);
    299299       
    300300        ioport8_t *port_addr = ns->port;
     
    315315       
    316316        if (!res) {
    317                 ddf_msg(LVL_DEBUG, "Device %s is not present.\n",
     317                ddf_msg(LVL_DEBUG, "Device %s is not present.",
    318318                    ns->dev->name);
    319319        }
     
    329329static int ns8250_dev_initialize(ns8250_t *ns)
    330330{
    331         ddf_msg(LVL_DEBUG, "ns8250_dev_initialize %s\n", ns->dev->name);
     331        ddf_msg(LVL_DEBUG, "ns8250_dev_initialize %s", ns->dev->name);
    332332       
    333333        int ret = EOK;
     
    341341        if (ns->dev->parent_phone < 0) {
    342342                ddf_msg(LVL_ERROR, "Failed to connect to parent driver of "
    343                     "device %s.\n", ns->dev->name);
     343                    "device %s.", ns->dev->name);
    344344                ret = ns->dev->parent_phone;
    345345                goto failed;
     
    350350        if (ret != EOK) {
    351351                ddf_msg(LVL_ERROR, "Failed to get HW resources for device "
    352                     "%s.\n", ns->dev->name);
     352                    "%s.", ns->dev->name);
    353353                goto failed;
    354354        }
     
    365365                        ns->irq = res->res.interrupt.irq;
    366366                        irq = true;
    367                         ddf_msg(LVL_NOTE, "Device %s was asigned irq = 0x%x.\n",
     367                        ddf_msg(LVL_NOTE, "Device %s was asigned irq = 0x%x.",
    368368                            ns->dev->name, ns->irq);
    369369                        break;
     
    373373                        if (res->res.io_range.size < REG_COUNT) {
    374374                                ddf_msg(LVL_ERROR, "I/O range assigned to "
    375                                     "device %s is too small.\n", ns->dev->name);
     375                                    "device %s is too small.", ns->dev->name);
    376376                                ret = ELIMIT;
    377377                                goto failed;
     
    379379                        ioport = true;
    380380                        ddf_msg(LVL_NOTE, "Device %s was asigned I/O address = "
    381                             "0x%x.\n", ns->dev->name, ns->io_addr);
    382                         break;
     381                            "0x%x.", ns->dev->name, ns->io_addr);
     382                        break;
    383383                       
    384384                default:
     
    388388       
    389389        if (!irq || !ioport) {
    390                 ddf_msg(LVL_ERROR, "Missing HW resource(s) for device %s.\n",
     390                ddf_msg(LVL_ERROR, "Missing HW resource(s) for device %s.",
    391391                    ns->dev->name);
    392392                ret = ENOENT;
     
    473473       
    474474        if (baud_rate < 50 || MAX_BAUD_RATE % baud_rate != 0) {
    475                 ddf_msg(LVL_ERROR, "Invalid baud rate %d requested.\n",
     475                ddf_msg(LVL_ERROR, "Invalid baud rate %d requested.",
    476476                    baud_rate);
    477477                return EINVAL;
     
    658658                                if (!buf_push_back(&ns->input_buffer, val)) {
    659659                                        ddf_msg(LVL_WARN, "Buffer overflow on "
    660                                             "%s.\n", ns->dev->name);
     660                                            "%s.", ns->dev->name);
    661661                                } else {
    662662                                        ddf_msg(LVL_DEBUG2, "Character %c saved "
    663                                             "to the buffer of %s.\n",
     663                                            "to the buffer of %s.",
    664664                                            val, ns->dev->name);
    665665                                }
     
    717717        int rc;
    718718       
    719         ddf_msg(LVL_DEBUG, "ns8250_add_device %s (handle = %d)\n",
     719        ddf_msg(LVL_DEBUG, "ns8250_add_device %s (handle = %d)",
    720720            dev->name, (int) dev->handle);
    721721       
     
    752752        /* Register interrupt handler. */
    753753        if (ns8250_register_interrupt_handler(ns) != EOK) {
    754                 ddf_msg(LVL_ERROR, "Failed to register interrupt handler.\n");
     754                ddf_msg(LVL_ERROR, "Failed to register interrupt handler.");
    755755                rc = EADDRNOTAVAIL;
    756756                goto fail;
     
    761761        if (rc != EOK) {
    762762                ddf_msg(LVL_ERROR, "Failed to enable the interrupt. Error code = "
    763                     "%d.\n", rc);
     763                    "%d.", rc);
    764764                goto fail;
    765765        }
     
    767767        fun = ddf_fun_create(dev, fun_exposed, "a");
    768768        if (fun == NULL) {
    769                 ddf_msg(LVL_ERROR, "Failed creating function.\n");
     769                ddf_msg(LVL_ERROR, "Failed creating function.");
    770770                goto fail;
    771771        }
     
    775775        rc = ddf_fun_bind(fun);
    776776        if (rc != EOK) {
    777                 ddf_msg(LVL_ERROR, "Failed binding function.\n");
     777                ddf_msg(LVL_ERROR, "Failed binding function.");
    778778                goto fail;
    779779        }
     
    783783        ddf_fun_add_to_class(fun, "serial");
    784784       
    785         ddf_msg(LVL_NOTE, "Device %s successfully initialized.\n",
     785        ddf_msg(LVL_NOTE, "Device %s successfully initialized.",
    786786            dev->name);
    787787       
     
    866866       
    867867        ddf_msg(LVL_DEBUG, "ns8250_get_props: baud rate %d, parity 0x%x, word "
    868             "length %d, stop bits %d\n", *baud_rate, *parity, *word_length,
     868            "length %d, stop bits %d", *baud_rate, *parity, *word_length,
    869869            *stop_bits);
    870870}
     
    883883{
    884884        ddf_msg(LVL_DEBUG, "ns8250_set_props: baud rate %d, parity 0x%x, word "
    885             "length %d, stop bits %d\n", baud_rate, parity, word_length,
     885            "length %d, stop bits %d", baud_rate, parity, word_length,
    886886            stop_bits);
    887887       
  • uspace/drv/pciintel/pci.c

    rbdbb6f6 rebcb05a  
    226226
    227227        if (match_id_str == NULL) {
    228                 ddf_msg(LVL_ERROR, "Out of memory creating match ID.\n");
     228                ddf_msg(LVL_ERROR, "Out of memory creating match ID.");
    229229                return;
    230230        }
     
    232232        rc = ddf_fun_add_match_id(fun->fnode, match_id_str, 90);
    233233        if (rc != EOK) {
    234                 ddf_msg(LVL_ERROR, "Failed adding match ID: %s\n",
     234                ddf_msg(LVL_ERROR, "Failed adding match ID: %s",
    235235                    str_error(rc));
    236236        }
     
    325325        if (range_addr != 0) {
    326326                ddf_msg(LVL_DEBUG, "Function %s : address = %" PRIx64
    327                     ", size = %x\n", fun->fnode->name, range_addr,
     327                    ", size = %x", fun->fnode->name, range_addr,
    328328                    (unsigned int) range_size);
    329329        }
     
    351351        hw_res_list->count++;
    352352       
    353         ddf_msg(LVL_NOTE, "Function %s uses irq %x.\n", fun->fnode->name, irq);
     353        ddf_msg(LVL_NOTE, "Function %s uses irq %x.", fun->fnode->name, irq);
    354354}
    355355
     
    407407                        char *fun_name = pci_fun_create_name(fun);
    408408                        if (fun_name == NULL) {
    409                                 ddf_msg(LVL_ERROR, "Out of memory.\n");
     409                                ddf_msg(LVL_ERROR, "Out of memory.");
    410410                                return;
    411411                        }
     
    413413                        fnode = ddf_fun_create(bus->dnode, fun_inner, fun_name);
    414414                        if (fnode == NULL) {
    415                                 ddf_msg(LVL_ERROR, "Failed creating function.\n");
     415                                ddf_msg(LVL_ERROR, "Failed creating function.");
    416416                                return;
    417417                        }
     
    427427                        fnode->driver_data = fun;
    428428                       
    429                         ddf_msg(LVL_DEBUG, "Adding new function %s.\n",
     429                        ddf_msg(LVL_DEBUG, "Adding new function %s.",
    430430                            fnode->name);
    431431                       
     
    445445                                    PCI_BRIDGE_SEC_BUS_NUM);
    446446                                ddf_msg(LVL_DEBUG, "Device is pci-to-pci "
    447                                     "bridge, secondary bus number = %d.\n",
     447                                    "bridge, secondary bus number = %d.",
    448448                                    bus_num);
    449449                                if (child_bus > bus_num)
     
    468468        int rc;
    469469       
    470         ddf_msg(LVL_DEBUG, "pci_add_device\n");
     470        ddf_msg(LVL_DEBUG, "pci_add_device");
    471471        dnode->parent_phone = -1;
    472472       
    473473        bus = pci_bus_new();
    474474        if (bus == NULL) {
    475                 ddf_msg(LVL_ERROR, "pci_add_device allocation failed.\n");
     475                ddf_msg(LVL_ERROR, "pci_add_device allocation failed.");
    476476                rc = ENOMEM;
    477477                goto fail;
     
    484484        if (dnode->parent_phone < 0) {
    485485                ddf_msg(LVL_ERROR, "pci_add_device failed to connect to the "
    486                     "parent's driver.\n");
     486                    "parent's driver.");
    487487                rc = dnode->parent_phone;
    488488                goto fail;
     
    494494        if (rc != EOK) {
    495495                ddf_msg(LVL_ERROR, "pci_add_device failed to get hw resources "
    496                     "for the device.\n");
     496                    "for the device.");
    497497                goto fail;
    498498        }
    499499        got_res = true;
    500500       
    501         ddf_msg(LVL_DEBUG, "conf_addr = %" PRIx64 ".\n",
     501        ddf_msg(LVL_DEBUG, "conf_addr = %" PRIx64 ".",
    502502            hw_resources.resources[0].res.io_range.address);
    503503       
     
    511511        if (pio_enable((void *)(uintptr_t)bus->conf_io_addr, 8,
    512512            &bus->conf_addr_port)) {
    513                 ddf_msg(LVL_ERROR, "Failed to enable configuration ports.\n");
     513                ddf_msg(LVL_ERROR, "Failed to enable configuration ports.");
    514514                rc = EADDRNOTAVAIL;
    515515                goto fail;
     
    518518       
    519519        /* Make the bus device more visible. It has no use yet. */
    520         ddf_msg(LVL_DEBUG, "Adding a 'ctl' function\n");
     520        ddf_msg(LVL_DEBUG, "Adding a 'ctl' function");
    521521       
    522522        ctl = ddf_fun_create(bus->dnode, fun_exposed, "ctl");
    523523        if (ctl == NULL) {
    524                 printf(NAME ": error creating control function.\n");
     524                ddf_msg(LVL_ERROR, "Failed creating control function.");
    525525                rc = ENOMEM;
    526526                goto fail;
     
    529529        rc = ddf_fun_bind(ctl);
    530530        if (rc != EOK) {
    531                 printf(NAME ": error binding control function.\n");
     531                ddf_msg(LVL_ERROR, "Failed binding control function.");
    532532                goto fail;
    533533        }
    534534       
    535535        /* Enumerate functions. */
    536         ddf_msg(LVL_DEBUG, "Scanning the bus\n");
     536        ddf_msg(LVL_DEBUG, "Scanning the bus");
    537537        pci_bus_scan(bus, 0);
    538538       
     
    634634int main(int argc, char *argv[])
    635635{
    636         printf(NAME ": HelenOS pci bus driver (intel method 1).\n");
     636        printf(NAME ": HelenOS PCI bus driver (Intel method 1).\n");
    637637        pciintel_init();
    638638        return ddf_driver_main(&pci_driver);
  • uspace/drv/root/root.c

    rbdbb6f6 rebcb05a  
    9191
    9292        ddf_msg(LVL_DEBUG, "Adding new function for virtual devices. "
    93             "Function node is `%s' (%d %s)\n", name,
     93            "Function node is `%s' (%d %s)", name,
    9494            VIRTUAL_FUN_MATCH_SCORE, VIRTUAL_FUN_MATCH_ID);
    9595
    9696        fun = ddf_fun_create(dev, fun_inner, name);
    9797        if (fun == NULL) {
    98                 ddf_msg(LVL_ERROR, "Failed creating function %s\n", name);
     98                ddf_msg(LVL_ERROR, "Failed creating function %s", name);
    9999                return ENOMEM;
    100100        }
     
    103103            VIRTUAL_FUN_MATCH_SCORE);
    104104        if (rc != EOK) {
    105                 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n", name);
     105                ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s",
     106                    name);
    106107                ddf_fun_destroy(fun);
    107108                return rc;
     
    110111        rc = ddf_fun_bind(fun);
    111112        if (rc != EOK) {
    112                 ddf_msg(LVL_ERROR, "Failed binding function %s: %s\n", name,
     113                ddf_msg(LVL_ERROR, "Failed binding function %s: %s", name,
    113114                    str_error(rc));
    114115                ddf_fun_destroy(fun);
     
    137138        platform = sysinfo_get_data("platform", &platform_size);
    138139        if (platform == NULL) {
    139                 ddf_msg(LVL_ERROR, "Failed to obtain platform name.\n");
     140                ddf_msg(LVL_ERROR, "Failed to obtain platform name.");
    140141                return ENOENT;
    141142        }
     
    144145        platform = realloc(platform, platform_size + 1);
    145146        if (platform == NULL) {
    146                 ddf_msg(LVL_ERROR, "Memory allocation failed.\n");
     147                ddf_msg(LVL_ERROR, "Memory allocation failed.");
    147148                return ENOMEM;
    148149        }
     
    152153        /* Construct match ID. */
    153154        if (asprintf(&match_id, PLATFORM_FUN_MATCH_ID_FMT, platform) == -1) {
    154                 ddf_msg(LVL_ERROR, "Memory allocation failed.\n");
     155                ddf_msg(LVL_ERROR, "Memory allocation failed.");
    155156                return ENOMEM;
    156157        }
     
    158159        /* Add function. */
    159160        ddf_msg(LVL_DEBUG, "Adding platform function. Function node is `%s' "
    160             " (%d %s)\n", PLATFORM_FUN_NAME, PLATFORM_FUN_MATCH_SCORE,
     161            " (%d %s)", PLATFORM_FUN_NAME, PLATFORM_FUN_MATCH_SCORE,
    161162            match_id);
    162163
    163164        fun = ddf_fun_create(dev, fun_inner, name);
    164165        if (fun == NULL) {
    165                 ddf_msg(LVL_ERROR, "Error creating function %s\n", name);
     166                ddf_msg(LVL_ERROR, "Error creating function %s", name);
    166167                return ENOMEM;
    167168        }
     
    169170        rc = ddf_fun_add_match_id(fun, match_id, PLATFORM_FUN_MATCH_SCORE);
    170171        if (rc != EOK) {
    171                 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n",
     172                ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s",
    172173                    name);
    173174                ddf_fun_destroy(fun);
     
    177178        rc = ddf_fun_bind(fun);
    178179        if (rc != EOK) {
    179                 ddf_msg(LVL_ERROR, "Failed binding function %s: %s\n", name,
     180                ddf_msg(LVL_ERROR, "Failed binding function %s: %s", name,
    180181                    str_error(rc));
    181182                ddf_fun_destroy(fun);
     
    193194static int root_add_device(ddf_dev_t *dev)
    194195{
    195         ddf_msg(LVL_DEBUG, "root_add_device, device handle=%" PRIun "\n",
     196        ddf_msg(LVL_DEBUG, "root_add_device, device handle=%" PRIun,
    196197            dev->handle);
    197198
     
    206207        int res = add_platform_fun(dev);
    207208        if (EOK != res)
    208                 ddf_msg(LVL_ERROR, "Failed adding child device for platform.\n");
     209                ddf_msg(LVL_ERROR, "Failed adding child device for platform.");
    209210
    210211        return res;
  • uspace/drv/rootpc/rootpc.c

    rbdbb6f6 rebcb05a  
    120120    rootpc_fun_t *fun)
    121121{
    122         ddf_msg(LVL_DEBUG, "Adding new function '%s'.\n", name);
     122        ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name);
    123123       
    124124        ddf_fun_t *fnode = NULL;
     
    146146        /* Register function. */
    147147        if (ddf_fun_bind(fnode) != EOK) {
    148                 ddf_msg(LVL_ERROR, "Failed binding function %s.\n", name);
     148                ddf_msg(LVL_ERROR, "Failed binding function %s.", name);
    149149                goto failure;
    150150        }
     
    159159                ddf_fun_destroy(fnode);
    160160       
    161         ddf_msg(LVL_ERROR, "Failed adding function '%s'.\n", name);
     161        ddf_msg(LVL_ERROR, "Failed adding function '%s'.", name);
    162162       
    163163        return false;
     
    177177static int rootpc_add_device(ddf_dev_t *dev)
    178178{
    179         ddf_msg(LVL_DEBUG, "rootpc_add_device, device handle = %d\n",
     179        ddf_msg(LVL_DEBUG, "rootpc_add_device, device handle = %d",
    180180            (int)dev->handle);
    181181       
    182182        /* Register functions. */
    183183        if (!rootpc_add_functions(dev)) {
    184                 ddf_msg(LVL_ERROR, "Failed to add functions for PC platform.\n");
     184                ddf_msg(LVL_ERROR, "Failed to add functions for PC platform.");
    185185        }
    186186       
  • uspace/drv/rootvirt/rootvirt.c

    rbdbb6f6 rebcb05a  
    8484        int rc;
    8585
    86         ddf_msg(LVL_DEBUG, "Registering function `%s' (match \"%s\")\n",
     86        ddf_msg(LVL_DEBUG, "Registering function `%s' (match \"%s\")",
    8787            vfun->name, vfun->match_id);
    8888
    8989        fun = ddf_fun_create(vdev, fun_inner, vfun->name);
    9090        if (fun == NULL) {
    91                 ddf_msg(LVL_ERROR, "Failed creating function %s\n", vfun->name);
     91                ddf_msg(LVL_ERROR, "Failed creating function %s", vfun->name);
    9292                return ENOMEM;
    9393        }
     
    9595        rc = ddf_fun_add_match_id(fun, vfun->match_id, 10);
    9696        if (rc != EOK) {
    97                 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n",
     97                ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s",
    9898                    vfun->name);
    9999                ddf_fun_destroy(fun);
     
    103103        rc = ddf_fun_bind(fun);
    104104        if (rc != EOK) {
    105                 ddf_msg(LVL_ERROR, "Failed binding function %s: %s\n", vfun->name,
    106                     str_error(rc));
     105                ddf_msg(LVL_ERROR, "Failed binding function %s: %s",
     106                    vfun->name, str_error(rc));
    107107                ddf_fun_destroy(fun);
    108108                return rc;
    109109        }
    110110
    111         ddf_msg(LVL_NOTE, "Registered child device `%s'\n", vfun->name);
     111        ddf_msg(LVL_NOTE, "Registered child device `%s'", vfun->name);
    112112        return EOK;
    113113}
     
    125125        }
    126126
    127         ddf_msg(LVL_DEBUG, "add_device(handle=%d)\n", (int)dev->handle);
     127        ddf_msg(LVL_DEBUG, "add_device(handle=%d)", (int)dev->handle);
    128128
    129129        /*
  • uspace/drv/test1/test1.c

    rbdbb6f6 rebcb05a  
    6565        int rc;
    6666
    67         ddf_msg(LVL_DEBUG, "Registering function `%s': %s.\n", name, message);
     67        ddf_msg(LVL_DEBUG, "Registering function `%s': %s.", name, message);
    6868
    6969        fun = ddf_fun_create(parent, fun_inner, name);
    7070        if (fun == NULL) {
    71                 ddf_msg(LVL_ERROR, "Failed creating function %s\n", name);
     71                ddf_msg(LVL_ERROR, "Failed creating function %s", name);
    7272                rc = ENOMEM;
    7373                goto leave;
     
    7676        rc = ddf_fun_add_match_id(fun, str_dup(match_id), match_score);
    7777        if (rc != EOK) {
    78                 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n",
     78                ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s",
    7979                    name);
    8080                goto leave;
     
    8383        rc = ddf_fun_bind(fun);
    8484        if (rc != EOK) {
    85                 ddf_msg(LVL_ERROR, "Failed binding function %s: %s\n", name,
     85                ddf_msg(LVL_ERROR, "Failed binding function %s: %s", name,
    8686                    str_error(rc));
    8787                goto leave;
    8888        }
    8989
    90         ddf_msg(LVL_NOTE, "Registered child device `%s'\n", name);
     90        ddf_msg(LVL_NOTE, "Registered child device `%s'", name);
    9191        rc = EOK;
    9292
     
    128128        int rc;
    129129
    130         ddf_msg(LVL_DEBUG, "add_device(name=\"%s\", handle=%d)\n",
     130        ddf_msg(LVL_DEBUG, "add_device(name=\"%s\", handle=%d)",
    131131            dev->name, (int) dev->handle);
    132132
    133133        fun_a = ddf_fun_create(dev, fun_exposed, "a");
    134134        if (fun_a == NULL) {
    135                 ddf_msg(LVL_ERROR, "Failed creating function 'a'.\n");
     135                ddf_msg(LVL_ERROR, "Failed creating function 'a'.");
    136136                return ENOMEM;
    137137        }
     
    139139        rc = ddf_fun_bind(fun_a);
    140140        if (rc != EOK) {
    141                 ddf_msg(LVL_ERROR, "Failed binding function 'a'.\n");
     141                ddf_msg(LVL_ERROR, "Failed binding function 'a'.");
    142142                return rc;
    143143        }
     
    161161        }
    162162
    163         ddf_msg(LVL_DEBUG, "Device `%s' accepted.\n", dev->name);
     163        ddf_msg(LVL_DEBUG, "Device `%s' accepted.", dev->name);
    164164
    165165        return EOK;
  • uspace/drv/test2/test2.c

    rbdbb6f6 rebcb05a  
    6565        int rc;
    6666
    67         ddf_msg(LVL_DEBUG, "Registering function `%s': %s.\n", name, message);
     67        ddf_msg(LVL_DEBUG, "Registering function `%s': %s.", name, message);
    6868
    6969        fun = ddf_fun_create(parent, fun_inner, name);
    7070        if (fun == NULL) {
    71                 ddf_msg(LVL_ERROR, "Failed creating function %s\n", name);
     71                ddf_msg(LVL_ERROR, "Failed creating function %s", name);
    7272                return ENOMEM;
    7373        }
     
    7575        rc = ddf_fun_add_match_id(fun, match_id, match_score);
    7676        if (rc != EOK) {
    77                 ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s\n",
     77                ddf_msg(LVL_ERROR, "Failed adding match IDs to function %s",
    7878                    name);
    7979                ddf_fun_destroy(fun);
     
    8383        rc = ddf_fun_bind(fun);
    8484        if (rc != EOK) {
    85                 ddf_msg(LVL_ERROR, "Failed binding function %s: %s\n", name,
     85                ddf_msg(LVL_ERROR, "Failed binding function %s: %s", name,
    8686                    str_error(rc));
    8787                ddf_fun_destroy(fun);
     
    8989        }
    9090
    91         ddf_msg(LVL_NOTE, "Registered child device `%s'\n", name);
     91        ddf_msg(LVL_NOTE, "Registered child device `%s'", name);
    9292        return EOK;
    9393}
     
    113113        fun_a = ddf_fun_create(dev, fun_exposed, "a");
    114114        if (fun_a == NULL) {
    115                 ddf_msg(LVL_ERROR, "Failed creating function 'a'.\n");
     115                ddf_msg(LVL_ERROR, "Failed creating function 'a'.");
    116116                return ENOMEM;
    117117        }
     
    119119        rc = ddf_fun_bind(fun_a);
    120120        if (rc != EOK) {
    121                 ddf_msg(LVL_ERROR, "Failed binding function 'a'.\n");
     121                ddf_msg(LVL_ERROR, "Failed binding function 'a'.");
    122122                return rc;
    123123        }
     
    130130static int test2_add_device(ddf_dev_t *dev)
    131131{
    132         ddf_msg(LVL_DEBUG, "test2_add_device(name=\"%s\", handle=%d)\n",
     132        ddf_msg(LVL_DEBUG, "test2_add_device(name=\"%s\", handle=%d)",
    133133            dev->name, (int) dev->handle);
    134134
     
    136136                fid_t postpone = fibril_create(postponed_birth, dev);
    137137                if (postpone == 0) {
    138                         ddf_msg(LVL_ERROR, "fibril_create() failed.\n");
     138                        ddf_msg(LVL_ERROR, "fibril_create() failed.");
    139139                        return ENOMEM;
    140140                }
  • uspace/lib/c/generic/io/log.c

    rbdbb6f6 rebcb05a  
    8484 *                      if verbosity is less than or equal to current
    8585 *                      reporting level.
    86  * @param fmt           Format string
     86 * @param fmt           Format string (no traling newline).
    8787 */
    8888void log_msg(log_level_t level, const char *fmt, ...)
     
    100100 *                      if verbosity is less than or equal to current
    101101 *                      reporting level.
    102  * @param fmt           Format string
     102 * @param fmt           Format string (no trailing newline)
    103103 */
    104104void log_msgv(log_level_t level, const char *fmt, va_list args)
     
    113113                    log_level_names[level]);
    114114                vfprintf(log_stream, fmt, args);
     115                fputc('\n', log_stream);
    115116                fflush(log_stream);
    116117
  • uspace/lib/drv/generic/log.c

    rbdbb6f6 rebcb05a  
    5151 *                      if verbosity is less than or equal to current
    5252 *                      reporting level.
    53  * @param fmt           Format string
     53 * @param fmt           Format string (no trailing newline)
    5454 */
    5555void ddf_msg(log_level_t level, const char *fmt, ...)
  • uspace/srv/devman/devman.c

    rbdbb6f6 rebcb05a  
    148148
    149149        log_msg(LVL_NOTE, "Driver `%s' was added to the list of available "
    150             "drivers.\n", drv->name);
     150            "drivers.", drv->name);
    151151}
    152152
     
    238238bool read_match_ids(const char *conf_path, match_id_list_t *ids)
    239239{
    240         log_msg(LVL_DEBUG, "read_match_ids(conf_path=\"%s\")\n", conf_path);
     240        log_msg(LVL_DEBUG, "read_match_ids(conf_path=\"%s\")", conf_path);
    241241       
    242242        bool suc = false;
     
    248248        fd = open(conf_path, O_RDONLY);
    249249        if (fd < 0) {
    250                 log_msg(LVL_ERROR, "Unable to open `%s' for reading: %s.\n",
     250                log_msg(LVL_ERROR, "Unable to open `%s' for reading: %s.",
    251251                    conf_path, str_error(fd));
    252252                goto cleanup;
     
    257257        lseek(fd, 0, SEEK_SET);
    258258        if (len == 0) {
    259                 log_msg(LVL_ERROR, "Configuration file '%s' is empty.\n",
     259                log_msg(LVL_ERROR, "Configuration file '%s' is empty.",
    260260                    conf_path);
    261261                goto cleanup;
     
    265265        if (buf == NULL) {
    266266                log_msg(LVL_ERROR, "Memory allocation failed when parsing file "
    267                     "'%s'.\n", conf_path);
     267                    "'%s'.", conf_path);
    268268                goto cleanup;
    269269        }
     
    271271        ssize_t read_bytes = safe_read(fd, buf, len);
    272272        if (read_bytes <= 0) {
    273                 log_msg(LVL_ERROR, "Unable to read file '%s'.\n", conf_path);
     273                log_msg(LVL_ERROR, "Unable to read file '%s'.", conf_path);
    274274                goto cleanup;
    275275        }
     
    309309bool get_driver_info(const char *base_path, const char *name, driver_t *drv)
    310310{
    311         log_msg(LVL_DEBUG, "get_driver_info(base_path=\"%s\", name=\"%s\")\n",
     311        log_msg(LVL_DEBUG, "get_driver_info(base_path=\"%s\", name=\"%s\")",
    312312            base_path, name);
    313313       
     
    369369int lookup_available_drivers(driver_list_t *drivers_list, const char *dir_path)
    370370{
    371         log_msg(LVL_DEBUG, "lookup_available_drivers(dir=\"%s\")\n", dir_path);
     371        log_msg(LVL_DEBUG, "lookup_available_drivers(dir=\"%s\")", dir_path);
    372372       
    373373        int drv_cnt = 0;
     
    403403        dev_node_t *dev;
    404404       
    405         log_msg(LVL_DEBUG, "create_root_nodes()\n");
     405        log_msg(LVL_DEBUG, "create_root_nodes()");
    406406       
    407407        fibril_rwlock_write_lock(&tree->rwlock);
     
    488488void attach_driver(dev_node_t *dev, driver_t *drv)
    489489{
    490         log_msg(LVL_DEBUG, "attach_driver(dev=\"%s\",drv=\"%s\")\n",
     490        log_msg(LVL_DEBUG, "attach_driver(dev=\"%s\",drv=\"%s\")",
    491491            dev->pfun->pathname, drv->name);
    492492       
     
    511511        assert(fibril_mutex_is_locked(&drv->driver_mutex));
    512512       
    513         log_msg(LVL_DEBUG, "start_driver(drv=\"%s\")\n", drv->name);
     513        log_msg(LVL_DEBUG, "start_driver(drv=\"%s\")", drv->name);
    514514       
    515515        rc = task_spawnl(NULL, drv->binary_path, drv->binary_path, NULL);
    516516        if (rc != EOK) {
    517                 log_msg(LVL_ERROR, "Spawning driver `%s' (%s) failed: %s.\n",
     517                log_msg(LVL_ERROR, "Spawning driver `%s' (%s) failed: %s.",
    518518                    drv->name, drv->binary_path, str_error(rc));
    519519                return false;
     
    578578        int phone;
    579579
    580         log_msg(LVL_DEBUG, "pass_devices_to_driver(driver=\"%s\")\n",
     580        log_msg(LVL_DEBUG, "pass_devices_to_driver(driver=\"%s\")",
    581581            driver->name);
    582582
     
    646646         * immediately and possibly started here as well.
    647647         */
    648         log_msg(LVL_DEBUG, "Driver `%s' enters running state.\n", driver->name);
     648        log_msg(LVL_DEBUG, "Driver `%s' enters running state.", driver->name);
    649649        driver->state = DRIVER_RUNNING;
    650650
     
    663663void initialize_running_driver(driver_t *driver, dev_tree_t *tree)
    664664{
    665         log_msg(LVL_DEBUG, "initialize_running_driver(driver=\"%s\")\n",
     665        log_msg(LVL_DEBUG, "initialize_running_driver(driver=\"%s\")",
    666666            driver->name);
    667667       
     
    754754         * access any structures that would affect driver_t.
    755755         */
    756         log_msg(LVL_DEBUG, "add_device(drv=\"%s\", dev=\"%s\")\n",
     756        log_msg(LVL_DEBUG, "add_device(drv=\"%s\", dev=\"%s\")",
    757757            drv->name, dev->pfun->name);
    758758       
     
    816816        driver_t *drv = find_best_match_driver(drivers_list, dev);
    817817        if (drv == NULL) {
    818                 log_msg(LVL_ERROR, "No driver found for device `%s'.\n",
     818                log_msg(LVL_ERROR, "No driver found for device `%s'.",
    819819                    dev->pfun->pathname);
    820820                return false;
     
    854854bool init_device_tree(dev_tree_t *tree, driver_list_t *drivers_list)
    855855{
    856         log_msg(LVL_DEBUG, "init_device_tree()\n");
     856        log_msg(LVL_DEBUG, "init_device_tree()");
    857857       
    858858        tree->current_handle = 0;
     
    10331033        fun->pathname = (char *) malloc(pathsize);
    10341034        if (fun->pathname == NULL) {
    1035                 log_msg(LVL_ERROR, "Failed to allocate device path.\n");
     1035                log_msg(LVL_ERROR, "Failed to allocate device path.");
    10361036                return false;
    10371037        }
     
    10641064        assert(fibril_rwlock_is_write_locked(&tree->rwlock));
    10651065       
    1066         log_msg(LVL_DEBUG, "insert_dev_node(dev=%p, pfun=%p [\"%s\"])\n",
     1066        log_msg(LVL_DEBUG, "insert_dev_node(dev=%p, pfun=%p [\"%s\"])",
    10671067            dev, pfun, pfun->pathname);
    10681068
  • uspace/srv/devman/main.c

    rbdbb6f6 rebcb05a  
    7373        driver_t *driver = NULL;
    7474
    75         log_msg(LVL_DEBUG, "devman_driver_register\n");
     75        log_msg(LVL_DEBUG, "devman_driver_register");
    7676       
    7777        iid = async_get_call(&icall);
     
    9090        }
    9191
    92         log_msg(LVL_DEBUG, "The `%s' driver is trying to register.\n",
     92        log_msg(LVL_DEBUG, "The `%s' driver is trying to register.",
    9393            drv_name);
    9494       
     
    9797       
    9898        if (driver == NULL) {
    99                 log_msg(LVL_ERROR, "No driver named `%s' was found.\n", drv_name);
     99                log_msg(LVL_ERROR, "No driver named `%s' was found.", drv_name);
    100100                free(drv_name);
    101101                drv_name = NULL;
     
    108108       
    109109        /* Create connection to the driver. */
    110         log_msg(LVL_DEBUG, "Creating connection to the `%s' driver.\n",
     110        log_msg(LVL_DEBUG, "Creating connection to the `%s' driver.",
    111111            driver->name);
    112112        ipc_call_t call;
     
    122122       
    123123        log_msg(LVL_NOTE,
    124             "The `%s' driver was successfully registered as running.\n",
     124            "The `%s' driver was successfully registered as running.",
    125125            driver->name);
    126126       
     
    147147        if (DEVMAN_ADD_MATCH_ID != IPC_GET_IMETHOD(call)) {
    148148                log_msg(LVL_ERROR,
    149                     "Invalid protocol when trying to receive match id.\n");
     149                    "Invalid protocol when trying to receive match id.");
    150150                async_answer_0(callid, EINVAL);
    151151                delete_match_id(match_id);
     
    154154       
    155155        if (match_id == NULL) {
    156                 log_msg(LVL_ERROR, "Failed to allocate match id.\n");
     156                log_msg(LVL_ERROR, "Failed to allocate match id.");
    157157                async_answer_0(callid, ENOMEM);
    158158                return ENOMEM;
     
    168168        if (rc != EOK) {
    169169                delete_match_id(match_id);
    170                 log_msg(LVL_ERROR, "Failed to receive match id string: %s.\n",
     170                log_msg(LVL_ERROR, "Failed to receive match id string: %s.",
    171171                    str_error(rc));
    172172                return rc;
     
    175175        list_append(&match_id->link, &match_ids->ids);
    176176       
    177         log_msg(LVL_DEBUG, "Received match id `%s', score %d.\n",
     177        log_msg(LVL_DEBUG, "Received match id `%s', score %d.",
    178178            match_id->id, match_id->score);
    179179        return rc;
     
    232232                /* Unknown function type */
    233233                log_msg(LVL_ERROR,
    234                     "Unknown function type %d provided by driver.\n",
     234                    "Unknown function type %d provided by driver.",
    235235                    (int) ftype);
    236236
     
    280280        fibril_rwlock_write_unlock(&tree->rwlock);
    281281       
    282         log_msg(LVL_DEBUG, "devman_add_function(fun=\"%s\")\n", fun->pathname);
     282        log_msg(LVL_DEBUG, "devman_add_function(fun=\"%s\")", fun->pathname);
    283283       
    284284        devman_receive_match_ids(match_count, &fun->match_ids);
     
    362362        devmap_register_class_dev(class_info);
    363363       
    364         log_msg(LVL_NOTE, "Function `%s' added to class `%s' as `%s'.\n",
     364        log_msg(LVL_NOTE, "Function `%s' added to class `%s' as `%s'.",
    365365            fun->pathname, class_name, class_info->dev_name);
    366366
     
    378378       
    379379        initialize_running_driver(driver, &device_tree);
    380         log_msg(LVL_DEBUG, "The `%s` driver was successfully initialized.\n",
     380        log_msg(LVL_DEBUG, "The `%s` driver was successfully initialized.",
    381381            driver->name);
    382382        return 0;
     
    401401        if (fid == 0) {
    402402                log_msg(LVL_ERROR, "Failed to create initialization fibril " \
    403                     "for driver `%s' .\n", driver->name);
     403                    "for driver `%s'.", driver->name);
    404404                return;
    405405        }
     
    537537        if (dev == NULL) {
    538538                log_msg(LVL_ERROR, "IPC forwarding failed - no device or "
    539                     "function with handle %" PRIun " was found.\n", handle);
     539                    "function with handle %" PRIun " was found.", handle);
    540540                async_answer_0(iid, ENOENT);
    541541                return;
     
    544544        if (fun == NULL && !drv_to_parent) {
    545545                log_msg(LVL_ERROR, NAME ": devman_forward error - cannot "
    546                     "connect to handle %" PRIun ", refers to a device.\n",
     546                    "connect to handle %" PRIun ", refers to a device.",
    547547                    handle);
    548548                async_answer_0(iid, ENOENT);
     
    567567        if (driver == NULL) {
    568568                log_msg(LVL_ERROR, "IPC forwarding refused - " \
    569                     "the device %" PRIun " is not in usable state.\n", handle);
     569                    "the device %" PRIun " is not in usable state.", handle);
    570570                async_answer_0(iid, ENOENT);
    571571                return;
     
    580580        if (driver->phone <= 0) {
    581581                log_msg(LVL_ERROR,
    582                     "Could not forward to driver `%s' (phone is %d).\n",
     582                    "Could not forward to driver `%s' (phone is %d).",
    583583                    driver->name, (int) driver->phone);
    584584                async_answer_0(iid, EINVAL);
     
    588588        if (fun != NULL) {
    589589                log_msg(LVL_DEBUG,
    590                     "Forwarding request for `%s' function to driver `%s'.\n",
     590                    "Forwarding request for `%s' function to driver `%s'.",
    591591                    fun->pathname, driver->name);
    592592        } else {
    593593                log_msg(LVL_DEBUG,
    594                     "Forwarding request for `%s' device to driver `%s'.\n",
     594                    "Forwarding request for `%s' device to driver `%s'.",
    595595                    dev->pfun->pathname, driver->name);
    596596        }
     
    626626            IPC_FF_NONE);
    627627        log_msg(LVL_DEBUG,
    628             "Forwarding devmapper request for `%s' function to driver `%s'.\n",
     628            "Forwarding devmapper request for `%s' function to driver `%s'.",
    629629            fun->pathname, dev->drv->name);
    630630}
     
    662662static bool devman_init(void)
    663663{
    664         log_msg(LVL_DEBUG, "devman_init - looking for available drivers.\n");
     664        log_msg(LVL_DEBUG, "devman_init - looking for available drivers.");
    665665       
    666666        /* Initialize list of available drivers. */
     
    668668        if (lookup_available_drivers(&drivers_list,
    669669            DRIVER_DEFAULT_STORE) == 0) {
    670                 log_msg(LVL_FATAL, "no drivers found.");
     670                log_msg(LVL_FATAL, "No drivers found.");
    671671                return false;
    672672        }
    673673
    674         log_msg(LVL_DEBUG, "devman_init - list of drivers has been initialized.\n");
     674        log_msg(LVL_DEBUG, "devman_init - list of drivers has been initialized.");
    675675
    676676        /* Create root device node. */
     
    703703
    704704        if (!devman_init()) {
    705                 log_msg(LVL_ERROR, "Error while initializing service.\n");
     705                log_msg(LVL_ERROR, "Error while initializing service.");
    706706                return -1;
    707707        }
     
    712712        /* Register device manager at naming service. */
    713713        if (service_register(SERVICE_DEVMAN) != EOK) {
    714                 log_msg(LVL_ERROR, "Failed registering as a service.\n");
     714                log_msg(LVL_ERROR, "Failed registering as a service.");
    715715                return -1;
    716716        }
Note: See TracChangeset for help on using the changeset viewer.