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

NFC: digital: Remove PR_ERR and PR_DBG macros

They can be replaced by the standard pr_err and pr_debug one after
defining the right pr_fmt macro.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

+31 -27
+2 -4
net/nfc/digital.h
··· 22 22 #include <linux/crc-ccitt.h> 23 23 #include <linux/crc-itu-t.h> 24 24 25 - #define PR_DBG(fmt, ...) pr_debug("%s: " fmt "\n", __func__, ##__VA_ARGS__) 26 - #define PR_ERR(fmt, ...) pr_err("%s: " fmt "\n", __func__, ##__VA_ARGS__) 27 - #define PROTOCOL_ERR(req) pr_err("%s:%d: NFC Digital Protocol error: %s\n", \ 28 - __func__, __LINE__, req) 25 + #define PROTOCOL_ERR(req) pr_err("%d: NFC Digital Protocol error: %s\n", \ 26 + __LINE__, req) 29 27 30 28 #define DIGITAL_CMD_IN_SEND 0 31 29 #define DIGITAL_CMD_TG_SEND 1
+18 -16
net/nfc/digital_core.c
··· 13 13 * 14 14 */ 15 15 16 + #define pr_fmt(fmt) "digital: %s: " fmt, __func__ 17 + 16 18 #include <linux/module.h> 17 19 18 20 #include "digital.h" ··· 198 196 break; 199 197 200 198 default: 201 - PR_ERR("Unknown cmd type %d", cmd->type); 199 + pr_err("Unknown cmd type %d", cmd->type); 202 200 return; 203 201 } 204 202 205 203 if (!rc) 206 204 return; 207 205 208 - PR_ERR("in_send_command returned err %d", rc); 206 + pr_err("in_send_command returned err %d", rc); 209 207 210 208 mutex_lock(&ddev->cmd_lock); 211 209 list_del(&cmd->queue); ··· 252 250 253 251 rc = ddev->ops->in_configure_hw(ddev, type, param); 254 252 if (rc) 255 - PR_ERR("in_configure_hw failed: %d", rc); 253 + pr_err("in_configure_hw failed: %d", rc); 256 254 257 255 return rc; 258 256 } ··· 263 261 264 262 rc = ddev->ops->tg_configure_hw(ddev, type, param); 265 263 if (rc) 266 - PR_ERR("tg_configure_hw failed: %d", rc); 264 + pr_err("tg_configure_hw failed: %d", rc); 267 265 268 266 return rc; 269 267 } ··· 332 330 break; 333 331 334 332 default: 335 - PR_ERR("Invalid protocol %d", protocol); 333 + pr_err("Invalid protocol %d", protocol); 336 334 return -EINVAL; 337 335 } 338 336 339 - PR_DBG("rf_tech=%d, protocol=%d", rf_tech, protocol); 337 + pr_debug("rf_tech=%d, protocol=%d", rf_tech, protocol); 340 338 341 339 ddev->curr_rf_tech = rf_tech; 342 340 ddev->curr_protocol = protocol; ··· 434 432 struct nfc_digital_dev *ddev = nfc_get_drvdata(nfc_dev); 435 433 u32 matching_im_protocols, matching_tm_protocols; 436 434 437 - PR_DBG("protocols: im 0x%x, tm 0x%x, supported 0x%x", im_protocols, 438 - tm_protocols, ddev->protocols); 435 + pr_debug("protocols: im 0x%x, tm 0x%x, supported 0x%x", im_protocols, 436 + tm_protocols, ddev->protocols); 439 437 440 438 matching_im_protocols = ddev->protocols & im_protocols; 441 439 matching_tm_protocols = ddev->protocols & tm_protocols; 442 440 443 441 if (!matching_im_protocols && !matching_tm_protocols) { 444 - PR_ERR("No known protocol"); 442 + pr_err("No known protocol"); 445 443 return -EINVAL; 446 444 } 447 445 448 446 if (ddev->poll_tech_count) { 449 - PR_ERR("Already polling"); 447 + pr_err("Already polling"); 450 448 return -EBUSY; 451 449 } 452 450 453 451 if (ddev->curr_protocol) { 454 - PR_ERR("A target is already active"); 452 + pr_err("A target is already active"); 455 453 return -EBUSY; 456 454 } 457 455 ··· 487 485 } 488 486 489 487 if (!ddev->poll_tech_count) { 490 - PR_ERR("Unsupported protocols: im=0x%x, tm=0x%x", 488 + pr_err("Unsupported protocols: im=0x%x, tm=0x%x", 491 489 matching_im_protocols, matching_tm_protocols); 492 490 return -EINVAL; 493 491 } ··· 504 502 mutex_lock(&ddev->poll_lock); 505 503 506 504 if (!ddev->poll_tech_count) { 507 - PR_ERR("Polling operation was not running"); 505 + pr_err("Polling operation was not running"); 508 506 mutex_unlock(&ddev->poll_lock); 509 507 return; 510 508 } ··· 611 609 612 610 data_exch = kzalloc(sizeof(struct digital_data_exch), GFP_KERNEL); 613 611 if (!data_exch) { 614 - PR_ERR("Failed to allocate data_exch struct"); 612 + pr_err("Failed to allocate data_exch struct"); 615 613 return -ENOMEM; 616 614 } 617 615 ··· 654 652 655 653 ddev = kzalloc(sizeof(struct nfc_digital_dev), GFP_KERNEL); 656 654 if (!ddev) { 657 - PR_ERR("kzalloc failed"); 655 + pr_err("kzalloc failed"); 658 656 return NULL; 659 657 } 660 658 ··· 686 684 ddev->tx_headroom, 687 685 ddev->tx_tailroom); 688 686 if (!ddev->nfc_dev) { 689 - PR_ERR("nfc_allocate_device failed"); 687 + pr_err("nfc_allocate_device failed"); 690 688 goto free_dev; 691 689 } 692 690
+8 -6
net/nfc/digital_dep.c
··· 13 13 * 14 14 */ 15 15 16 + #define pr_fmt(fmt) "digital: %s: " fmt, __func__ 17 + 16 18 #include "digital.h" 17 19 18 20 #define DIGITAL_NFC_DEP_FRAME_DIR_OUT 0xD4 ··· 315 313 break; 316 314 317 315 case DIGITAL_NFC_DEP_PFB_ACK_NACK_PDU: 318 - PR_ERR("Received a ACK/NACK PDU"); 316 + pr_err("Received a ACK/NACK PDU"); 319 317 rc = -EIO; 320 318 goto error; 321 319 ··· 334 332 } 335 333 336 334 if (DIGITAL_NFC_DEP_MI_BIT_SET(pfb)) { 337 - PR_ERR("MI bit set. Chained PDU not supported."); 335 + pr_err("MI bit set. Chained PDU not supported."); 338 336 rc = -EIO; 339 337 goto error; 340 338 } ··· 426 424 427 425 switch (DIGITAL_NFC_DEP_PFB_TYPE(dep_req->pfb)) { 428 426 case DIGITAL_NFC_DEP_PFB_I_PDU: 429 - PR_DBG("DIGITAL_NFC_DEP_PFB_I_PDU"); 427 + pr_debug("DIGITAL_NFC_DEP_PFB_I_PDU"); 430 428 ddev->curr_nfc_dep_pni = DIGITAL_NFC_DEP_PFB_PNI(dep_req->pfb); 431 429 break; 432 430 case DIGITAL_NFC_DEP_PFB_ACK_NACK_PDU: 433 - PR_ERR("Received a ACK/NACK PDU"); 431 + pr_err("Received a ACK/NACK PDU"); 434 432 rc = -EINVAL; 435 433 goto exit; 436 434 break; 437 435 case DIGITAL_NFC_DEP_PFB_SUPERVISOR_PDU: 438 - PR_ERR("Received a SUPERVISOR PDU"); 436 + pr_err("Received a SUPERVISOR PDU"); 439 437 rc = -EINVAL; 440 438 goto exit; 441 439 break; ··· 563 561 rf_tech = NFC_DIGITAL_RF_TECH_424F; 564 562 break; 565 563 default: 566 - PR_ERR("Unsuported dsi value %d", dsi); 564 + pr_err("Unsuported dsi value %d", dsi); 567 565 goto exit; 568 566 } 569 567
+3 -1
net/nfc/digital_technology.c
··· 13 13 * 14 14 */ 15 15 16 + #define pr_fmt(fmt) "digital: %s: " fmt, __func__ 17 + 16 18 #include "digital.h" 17 19 18 20 #define DIGITAL_CMD_SENS_REQ 0x26 ··· 260 258 261 259 skb = digital_skb_alloc(ddev, 2); 262 260 if (!skb) { 263 - PR_ERR("alloc_skb failed"); 261 + pr_err("alloc_skb failed"); 264 262 return -ENOMEM; 265 263 } 266 264