Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFC: logging neatening

Add missing terminating newlines to nfc_info and nfc_err
to avoid possible interleaving from other messages.

Miscellanea:

o typo fix of "unknonwn" in message
o remove unnecessary OOM messages as there's a generic dump_stack()
o realign arguments

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Joe Perches and committed by
Samuel Ortiz
3590ebc0 5df848f3

+36 -43
+1 -1
drivers/nfc/microread/i2c.c
··· 286 286 if (r < 0) 287 287 goto err_irq; 288 288 289 - nfc_info(&client->dev, "Probed"); 289 + nfc_info(&client->dev, "Probed\n"); 290 290 291 291 return 0; 292 292
+2 -2
drivers/nfc/nfcmrvl/main.c
··· 111 111 112 112 priv->ndev = nci_allocate_device(&nfcmrvl_nci_ops, protocols, 0, 0); 113 113 if (!priv->ndev) { 114 - nfc_err(dev, "nci_allocate_device failed"); 114 + nfc_err(dev, "nci_allocate_device failed\n"); 115 115 rc = -ENOMEM; 116 116 goto error; 117 117 } ··· 120 120 121 121 rc = nci_register_device(priv->ndev); 122 122 if (rc) { 123 - nfc_err(dev, "nci_register_device failed %d", rc); 123 + nfc_err(dev, "nci_register_device failed %d\n", rc); 124 124 nci_free_device(priv->ndev); 125 125 goto error; 126 126 }
+9 -9
drivers/nfc/nfcmrvl/usb.c
··· 80 80 if (!urb->status) { 81 81 if (nfcmrvl_nci_recv_frame(drv_data->priv, urb->transfer_buffer, 82 82 urb->actual_length) < 0) 83 - nfc_err(&drv_data->udev->dev, "corrupted Rx packet"); 83 + nfc_err(&drv_data->udev->dev, "corrupted Rx packet\n"); 84 84 } 85 85 86 86 if (!test_bit(NFCMRVL_USB_BULK_RUNNING, &drv_data->flags)) ··· 96 96 */ 97 97 if (err != -EPERM && err != -ENODEV) 98 98 nfc_err(&drv_data->udev->dev, 99 - "urb %p failed to resubmit (%d)", urb, -err); 99 + "urb %p failed to resubmit (%d)\n", urb, -err); 100 100 usb_unanchor_urb(urb); 101 101 } 102 102 } ··· 137 137 if (err) { 138 138 if (err != -EPERM && err != -ENODEV) 139 139 nfc_err(&drv_data->udev->dev, 140 - "urb %p submission failed (%d)", urb, -err); 140 + "urb %p submission failed (%d)\n", urb, -err); 141 141 usb_unanchor_urb(urb); 142 142 } 143 143 ··· 153 153 struct nfcmrvl_private *priv = nci_get_drvdata(ndev); 154 154 struct nfcmrvl_usb_drv_data *drv_data = priv->drv_data; 155 155 156 - nfc_info(priv->dev, "urb %p status %d count %d", 156 + nfc_info(priv->dev, "urb %p status %d count %d\n", 157 157 urb, urb->status, urb->actual_length); 158 158 159 159 spin_lock(&drv_data->txlock); ··· 253 253 if (err) { 254 254 if (err != -EPERM && err != -ENODEV) 255 255 nfc_err(&drv_data->udev->dev, 256 - "urb %p submission failed (%d)", urb, -err); 256 + "urb %p submission failed (%d)\n", urb, -err); 257 257 kfree(urb->setup_packet); 258 258 usb_unanchor_urb(urb); 259 259 } else { ··· 293 293 int i; 294 294 struct usb_device *udev = interface_to_usbdev(intf); 295 295 296 - nfc_info(&udev->dev, "intf %p id %p", intf, id); 296 + nfc_info(&udev->dev, "intf %p id %p\n", intf, id); 297 297 298 298 drv_data = devm_kzalloc(&intf->dev, sizeof(*drv_data), GFP_KERNEL); 299 299 if (!drv_data) ··· 348 348 if (!drv_data) 349 349 return; 350 350 351 - nfc_info(&drv_data->udev->dev, "intf %p", intf); 351 + nfc_info(&drv_data->udev->dev, "intf %p\n", intf); 352 352 353 353 nfcmrvl_nci_unregister_dev(drv_data->priv); 354 354 ··· 360 360 { 361 361 struct nfcmrvl_usb_drv_data *drv_data = usb_get_intfdata(intf); 362 362 363 - nfc_info(&drv_data->udev->dev, "intf %p", intf); 363 + nfc_info(&drv_data->udev->dev, "intf %p\n", intf); 364 364 365 365 if (drv_data->suspend_count++) 366 366 return 0; ··· 401 401 struct nfcmrvl_usb_drv_data *drv_data = usb_get_intfdata(intf); 402 402 int err = 0; 403 403 404 - nfc_info(&drv_data->udev->dev, "intf %p", intf); 404 + nfc_info(&drv_data->udev->dev, "intf %p\n", intf); 405 405 406 406 if (--drv_data->suspend_count) 407 407 return 0;
+1 -1
drivers/nfc/pn533.c
··· 1820 1820 if (IS_ERR(resp)) { 1821 1821 rc = PTR_ERR(resp); 1822 1822 1823 - nfc_err(&dev->interface->dev, "RF setting error %d", rc); 1823 + nfc_err(&dev->interface->dev, "RF setting error %d\n", rc); 1824 1824 1825 1825 return rc; 1826 1826 }
+2 -5
drivers/nfc/pn544/i2c.c
··· 953 953 } 954 954 955 955 nfc_info(dev, "GPIO resource, no:%d irq:%d\n", 956 - desc_to_gpio(gpiod_irq), ret); 956 + desc_to_gpio(gpiod_irq), ret); 957 957 client->irq = ret; 958 958 959 959 return 0; ··· 1062 1062 1063 1063 phy = devm_kzalloc(&client->dev, sizeof(struct pn544_i2c_phy), 1064 1064 GFP_KERNEL); 1065 - if (!phy) { 1066 - nfc_err(&client->dev, 1067 - "Cannot allocate memory for pn544 i2c phy.\n"); 1065 + if (!phy) 1068 1066 return -ENOMEM; 1069 - } 1070 1067 1071 1068 INIT_WORK(&phy->fw_work, pn544_hci_i2c_fw_work); 1072 1069 phy->fw_work_state = FW_WORK_STATE_IDLE;
+18 -18
drivers/nfc/port100.c
··· 604 604 case -ECONNRESET: 605 605 case -ENOENT: 606 606 nfc_err(&dev->interface->dev, 607 - "The urb has been canceled (status %d)", urb->status); 607 + "The urb has been canceled (status %d)\n", urb->status); 608 608 goto sched_wq; 609 609 case -ESHUTDOWN: 610 610 default: 611 - nfc_err(&dev->interface->dev, "Urb failure (status %d)", 611 + nfc_err(&dev->interface->dev, "Urb failure (status %d)\n", 612 612 urb->status); 613 613 goto sched_wq; 614 614 } ··· 616 616 in_frame = dev->in_urb->transfer_buffer; 617 617 618 618 if (!port100_rx_frame_is_valid(in_frame)) { 619 - nfc_err(&dev->interface->dev, "Received an invalid frame"); 619 + nfc_err(&dev->interface->dev, "Received an invalid frame\n"); 620 620 cmd->status = -EIO; 621 621 goto sched_wq; 622 622 } ··· 626 626 627 627 if (!port100_rx_frame_is_cmd_response(dev, in_frame)) { 628 628 nfc_err(&dev->interface->dev, 629 - "It's not the response to the last command"); 629 + "It's not the response to the last command\n"); 630 630 cmd->status = -EIO; 631 631 goto sched_wq; 632 632 } ··· 657 657 case -ECONNRESET: 658 658 case -ENOENT: 659 659 nfc_err(&dev->interface->dev, 660 - "The urb has been stopped (status %d)", urb->status); 660 + "The urb has been stopped (status %d)\n", urb->status); 661 661 goto sched_wq; 662 662 case -ESHUTDOWN: 663 663 default: 664 - nfc_err(&dev->interface->dev, "Urb failure (status %d)", 664 + nfc_err(&dev->interface->dev, "Urb failure (status %d)\n", 665 665 urb->status); 666 666 goto sched_wq; 667 667 } ··· 669 669 in_frame = dev->in_urb->transfer_buffer; 670 670 671 671 if (!port100_rx_frame_is_ack(in_frame)) { 672 - nfc_err(&dev->interface->dev, "Received an invalid ack"); 672 + nfc_err(&dev->interface->dev, "Received an invalid ack\n"); 673 673 cmd->status = -EIO; 674 674 goto sched_wq; 675 675 } ··· 677 677 rc = port100_submit_urb_for_response(dev, GFP_ATOMIC); 678 678 if (rc) { 679 679 nfc_err(&dev->interface->dev, 680 - "usb_submit_urb failed with result %d", rc); 680 + "usb_submit_urb failed with result %d\n", rc); 681 681 cmd->status = rc; 682 682 goto sched_wq; 683 683 } ··· 873 873 case -ECONNRESET: 874 874 case -ENOENT: 875 875 nfc_err(&dev->interface->dev, 876 - "The urb has been stopped (status %d)", urb->status); 876 + "The urb has been stopped (status %d)\n", urb->status); 877 877 break; 878 878 case -ESHUTDOWN: 879 879 default: 880 - nfc_err(&dev->interface->dev, "Urb failure (status %d)", 880 + nfc_err(&dev->interface->dev, "Urb failure (status %d)\n", 881 881 urb->status); 882 882 } 883 883 } ··· 1094 1094 1095 1095 if (resp->len < 4) { 1096 1096 nfc_err(&dev->interface->dev, 1097 - "Invalid packet length received.\n"); 1097 + "Invalid packet length received\n"); 1098 1098 rc = -EIO; 1099 1099 goto error; 1100 1100 } ··· 1250 1250 PORT100_MDAA_TGT_WAS_ACTIVATED_MASK; 1251 1251 break; 1252 1252 default: 1253 - nfc_err(&dev->interface->dev, "Unknonwn command type.\n"); 1253 + nfc_err(&dev->interface->dev, "Unknown command type\n"); 1254 1254 return false; 1255 1255 } 1256 1256 ··· 1481 1481 cmd_type_mask = port100_get_command_type_mask(dev); 1482 1482 if (!cmd_type_mask) { 1483 1483 nfc_err(&interface->dev, 1484 - "Could not get supported command types.\n"); 1484 + "Could not get supported command types\n"); 1485 1485 rc = -ENODEV; 1486 1486 goto error; 1487 1487 } ··· 1494 1494 rc = port100_set_command_type(dev, dev->cmd_type); 1495 1495 if (rc) { 1496 1496 nfc_err(&interface->dev, 1497 - "The device does not support command type %u.\n", 1497 + "The device does not support command type %u\n", 1498 1498 dev->cmd_type); 1499 1499 goto error; 1500 1500 } ··· 1502 1502 fw_version = port100_get_firmware_version(dev); 1503 1503 if (!fw_version) 1504 1504 nfc_err(&interface->dev, 1505 - "Could not get device firmware version.\n"); 1505 + "Could not get device firmware version\n"); 1506 1506 1507 1507 nfc_info(&interface->dev, 1508 1508 "Sony NFC Port-100 Series attached (firmware v%x.%02x)\n", ··· 1515 1515 dev->skb_tailroom); 1516 1516 if (!dev->nfc_digital_dev) { 1517 1517 nfc_err(&interface->dev, 1518 - "Could not allocate nfc_digital_dev.\n"); 1518 + "Could not allocate nfc_digital_dev\n"); 1519 1519 rc = -ENOMEM; 1520 1520 goto error; 1521 1521 } ··· 1526 1526 rc = nfc_digital_register_device(dev->nfc_digital_dev); 1527 1527 if (rc) { 1528 1528 nfc_err(&interface->dev, 1529 - "Could not register digital device.\n"); 1529 + "Could not register digital device\n"); 1530 1530 goto free_nfc_dev; 1531 1531 } 1532 1532 ··· 1562 1562 1563 1563 kfree(dev->cmd); 1564 1564 1565 - nfc_info(&interface->dev, "Sony Port-100 NFC device disconnected"); 1565 + nfc_info(&interface->dev, "Sony Port-100 NFC device disconnected\n"); 1566 1566 } 1567 1567 1568 1568 static struct usb_driver port100_driver = {
+1 -4
drivers/nfc/st21nfcb/i2c.c
··· 313 313 314 314 phy = devm_kzalloc(&client->dev, sizeof(struct st21nfcb_i2c_phy), 315 315 GFP_KERNEL); 316 - if (!phy) { 317 - nfc_err(&client->dev, 318 - "Cannot allocate memory for st21nfcb i2c phy.\n"); 316 + if (!phy) 319 317 return -ENOMEM; 320 - } 321 318 322 319 phy->i2c_dev = client; 323 320
+2 -3
drivers/nfc/st21nfcb/ndlc.c
··· 256 256 struct llt_ndlc *ndlc; 257 257 258 258 ndlc = devm_kzalloc(dev, sizeof(struct llt_ndlc), GFP_KERNEL); 259 - if (!ndlc) { 260 - nfc_err(dev, "Cannot allocate memory for ndlc.\n"); 259 + if (!ndlc) 261 260 return -ENOMEM; 262 - } 261 + 263 262 ndlc->ops = phy_ops; 264 263 ndlc->phy_id = phy_id; 265 264 ndlc->dev = dev;