Changeset ebcb05a in mainline for uspace/drv/pciintel/pci.c


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.