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

staging: pi433: standardize use of line escape chars in dev_dbg stmts

In this driver there are strings ending with of both '\n' and ''
(without '\n') when using dev_dbg function. While it doesn't affect
drivers functionality, it would be good to keep it consistent across the
driver's source code.

This patch add '\n' characters where it's missing to make it consistent
with the other dev_dbg instances.

Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Link: https://lore.kernel.org/r/YgA4XHU4uf6YkOk5@mail.google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Paulo Miguel Almeida and committed by
Greg Kroah-Hartman
1b6a6147 9e223aa4

+53 -52
+27 -27
drivers/staging/pi433/pi433_if.c
··· 414 414 dev->interrupt_rx_allowed = false; 415 415 416 416 /* wait for any tx to finish */ 417 - dev_dbg(dev->dev, "rx: going to wait for any tx to finish"); 417 + dev_dbg(dev->dev, "rx: going to wait for any tx to finish\n"); 418 418 retval = wait_event_interruptible(dev->rx_wait_queue, !dev->tx_active); 419 419 if (retval) { 420 420 /* wait was interrupted */ ··· 440 440 wake_up_interruptible(&dev->tx_wait_queue); 441 441 442 442 /* wait for RSSI level to become high */ 443 - dev_dbg(dev->dev, "rx: going to wait for high RSSI level"); 443 + dev_dbg(dev->dev, "rx: going to wait for high RSSI level\n"); 444 444 retval = wait_event_interruptible(dev->rx_wait_queue, 445 445 rf69_get_flag(dev->spi, 446 446 rssi_exceeded_threshold)); ··· 467 467 goto abort; 468 468 } 469 469 bytes_total = dev->rx_cfg.fixed_message_length; 470 - dev_dbg(dev->dev, "rx: msg len set to %d by fixed length", 470 + dev_dbg(dev->dev, "rx: msg len set to %d by fixed length\n", 471 471 bytes_total); 472 472 } else { 473 473 bytes_total = dev->rx_buffer_size; 474 - dev_dbg(dev->dev, "rx: msg len set to %d as requested by read", 474 + dev_dbg(dev->dev, "rx: msg len set to %d as requested by read\n", 475 475 bytes_total); 476 476 } 477 477 ··· 488 488 goto abort; 489 489 } 490 490 dev->free_in_fifo++; 491 - dev_dbg(dev->dev, "rx: msg len reset to %d due to length byte", 491 + dev_dbg(dev->dev, "rx: msg len reset to %d due to length byte\n", 492 492 bytes_total); 493 493 } 494 494 ··· 505 505 506 506 rf69_read_fifo(spi, &dummy, 1); 507 507 dev->free_in_fifo++; 508 - dev_dbg(dev->dev, "rx: address byte stripped off"); 508 + dev_dbg(dev->dev, "rx: address byte stripped off\n"); 509 509 } 510 510 511 511 /* get payload */ ··· 567 567 568 568 while (1) { 569 569 /* wait for fifo to be populated or for request to terminate*/ 570 - dev_dbg(device->dev, "thread: going to wait for new messages"); 570 + dev_dbg(device->dev, "thread: going to wait for new messages\n"); 571 571 wait_event_interruptible(device->tx_wait_queue, 572 572 (!kfifo_is_empty(&device->tx_fifo) || 573 573 kthread_should_stop())); ··· 583 583 retval = kfifo_out(&device->tx_fifo, &tx_cfg, sizeof(tx_cfg)); 584 584 if (retval != sizeof(tx_cfg)) { 585 585 dev_dbg(device->dev, 586 - "reading tx_cfg from fifo failed: got %d byte(s), expected %d", 586 + "reading tx_cfg from fifo failed: got %d byte(s), expected %d\n", 587 587 retval, (unsigned int)sizeof(tx_cfg)); 588 588 continue; 589 589 } ··· 591 591 retval = kfifo_out(&device->tx_fifo, &size, sizeof(size_t)); 592 592 if (retval != sizeof(size_t)) { 593 593 dev_dbg(device->dev, 594 - "reading msg size from fifo failed: got %d, expected %d", 594 + "reading msg size from fifo failed: got %d, expected %d\n", 595 595 retval, (unsigned int)sizeof(size_t)); 596 596 continue; 597 597 } ··· 628 628 retval = kfifo_out(&device->tx_fifo, &device->buffer[position], 629 629 sizeof(device->buffer) - position); 630 630 dev_dbg(device->dev, 631 - "read %d message byte(s) from fifo queue.", retval); 631 + "read %d message byte(s) from fifo queue.\n", retval); 632 632 633 633 /* 634 634 * if rx is active, we need to interrupt the waiting for ··· 733 733 734 734 /* we are done. Wait for packet to get sent */ 735 735 dev_dbg(device->dev, 736 - "thread: wait for packet to get sent/fifo to be empty"); 736 + "thread: wait for packet to get sent/fifo to be empty\n"); 737 737 wait_event_interruptible(device->fifo_wait_queue, 738 738 device->free_in_fifo == FIFO_SIZE || 739 739 kthread_should_stop()); ··· 741 741 return 0; 742 742 743 743 /* STOP_TRANSMISSION */ 744 - dev_dbg(device->dev, "thread: Packet sent. Set mode to stby."); 744 + dev_dbg(device->dev, "thread: Packet sent. Set mode to stby.\n"); 745 745 retval = rf69_set_mode(spi, standby); 746 746 if (retval < 0) 747 747 goto abort; ··· 831 831 */ 832 832 if (!instance->tx_cfg_initialized) { 833 833 dev_notice_once(device->dev, 834 - "write: failed due to unconfigured tx_cfg (see PI433_IOC_WR_TX_CFG)"); 834 + "write: failed due to unconfigured tx_cfg (see PI433_IOC_WR_TX_CFG)\n"); 835 835 return -EINVAL; 836 836 } 837 837 ··· 846 846 required = sizeof(instance->tx_cfg) + sizeof(size_t) + count; 847 847 available = kfifo_avail(&device->tx_fifo); 848 848 if (required > available) { 849 - dev_dbg(device->dev, "write to fifo failed: %d bytes required but %d available", 849 + dev_dbg(device->dev, "write to fifo failed: %d bytes required but %d available\n", 850 850 required, available); 851 851 mutex_unlock(&device->tx_fifo_lock); 852 852 return -EAGAIN; ··· 869 869 870 870 /* start transfer */ 871 871 wake_up_interruptible(&device->tx_wait_queue); 872 - dev_dbg(device->dev, "write: generated new msg with %d bytes.", copied); 872 + dev_dbg(device->dev, "write: generated new msg with %d bytes.\n", copied); 873 873 874 874 return copied; 875 875 876 876 abort: 877 877 dev_warn(device->dev, 878 - "write to fifo failed, non recoverable: 0x%x", retval); 878 + "write to fifo failed, non recoverable: 0x%x\n", retval); 879 879 mutex_unlock(&device->tx_fifo_lock); 880 880 return -EAGAIN; 881 881 } ··· 1000 1000 1001 1001 if (device->gpiod[i] == ERR_PTR(-ENOENT)) { 1002 1002 dev_dbg(&device->spi->dev, 1003 - "Could not find entry for %s. Ignoring.", name); 1003 + "Could not find entry for %s. Ignoring.\n", name); 1004 1004 continue; 1005 1005 } 1006 1006 1007 1007 if (device->gpiod[i] == ERR_PTR(-EBUSY)) 1008 - dev_dbg(&device->spi->dev, "%s is busy.", name); 1008 + dev_dbg(&device->spi->dev, "%s is busy.\n", name); 1009 1009 1010 1010 if (IS_ERR(device->gpiod[i])) { 1011 1011 retval = PTR_ERR(device->gpiod[i]); ··· 1038 1038 if (retval) 1039 1039 return retval; 1040 1040 1041 - dev_dbg(&device->spi->dev, "%s successfully configured", name); 1041 + dev_dbg(&device->spi->dev, "%s successfully configured\n", name); 1042 1042 } 1043 1043 1044 1044 return 0; ··· 1186 1186 } 1187 1187 1188 1188 dev_dbg(&spi->dev, 1189 - "spi interface setup: mode 0x%2x, %d bits per word, %dhz max speed", 1189 + "spi interface setup: mode 0x%2x, %d bits per word, %dhz max speed\n", 1190 1190 spi->mode, spi->bits_per_word, spi->max_speed_hz); 1191 1191 1192 1192 /* read chip version */ ··· 1196 1196 1197 1197 switch (retval) { 1198 1198 case 0x24: 1199 - dev_dbg(&spi->dev, "found pi433 (ver. 0x%x)", retval); 1199 + dev_dbg(&spi->dev, "found pi433 (ver. 0x%x)\n", retval); 1200 1200 break; 1201 1201 default: 1202 - dev_dbg(&spi->dev, "unknown chip version: 0x%x", retval); 1202 + dev_dbg(&spi->dev, "unknown chip version: 0x%x\n", retval); 1203 1203 return -ENODEV; 1204 1204 } 1205 1205 ··· 1236 1236 /* setup GPIO (including irq_handler) for the different DIOs */ 1237 1237 retval = setup_gpio(device); 1238 1238 if (retval) { 1239 - dev_dbg(&spi->dev, "setup of GPIOs failed"); 1239 + dev_dbg(&spi->dev, "setup of GPIOs failed\n"); 1240 1240 goto GPIO_failed; 1241 1241 } 1242 1242 ··· 1266 1266 /* determ minor number */ 1267 1267 retval = pi433_get_minor(device); 1268 1268 if (retval) { 1269 - dev_dbg(&spi->dev, "get of minor number failed"); 1269 + dev_dbg(&spi->dev, "get of minor number failed\n"); 1270 1270 goto minor_failed; 1271 1271 } 1272 1272 ··· 1295 1295 "pi433.%d_tx_task", 1296 1296 device->minor); 1297 1297 if (IS_ERR(device->tx_task_struct)) { 1298 - dev_dbg(device->dev, "start of send thread failed"); 1298 + dev_dbg(device->dev, "start of send thread failed\n"); 1299 1299 retval = PTR_ERR(device->tx_task_struct); 1300 1300 goto send_thread_failed; 1301 1301 } ··· 1303 1303 /* create cdev */ 1304 1304 device->cdev = cdev_alloc(); 1305 1305 if (!device->cdev) { 1306 - dev_dbg(device->dev, "allocation of cdev failed"); 1306 + dev_dbg(device->dev, "allocation of cdev failed\n"); 1307 1307 retval = -ENOMEM; 1308 1308 goto cdev_failed; 1309 1309 } ··· 1311 1311 cdev_init(device->cdev, &pi433_fops); 1312 1312 retval = cdev_add(device->cdev, device->devt, 1); 1313 1313 if (retval) { 1314 - dev_dbg(device->dev, "register of cdev failed"); 1314 + dev_dbg(device->dev, "register of cdev failed\n"); 1315 1315 goto del_cdev; 1316 1316 } 1317 1317
+26 -25
drivers/staging/pi433/rf69.c
··· 85 85 }; 86 86 87 87 if (unlikely(mode >= ARRAY_SIZE(mode_map))) { 88 - dev_dbg(&spi->dev, "set: illegal mode %u", mode); 88 + dev_dbg(&spi->dev, "set: illegal mode %u\n", mode); 89 89 return -EINVAL; 90 90 } 91 91 ··· 115 115 }; 116 116 117 117 if (unlikely(modulation >= ARRAY_SIZE(modulation_map))) { 118 - dev_dbg(&spi->dev, "set: illegal modulation %u", modulation); 118 + dev_dbg(&spi->dev, "set: illegal modulation %u\n", modulation); 119 119 return -EINVAL; 120 120 } 121 121 ··· 163 163 MASK_DATAMODUL_MODULATION_SHAPE, 164 164 DATAMODUL_MODULATION_SHAPE_0_3); 165 165 default: 166 - dev_dbg(&spi->dev, "set: illegal mod shaping for FSK %u", mod_shaping); 166 + dev_dbg(&spi->dev, "set: illegal mod shaping for FSK %u\n", mod_shaping); 167 167 return -EINVAL; 168 168 } 169 169 case OOK: ··· 181 181 MASK_DATAMODUL_MODULATION_SHAPE, 182 182 DATAMODUL_MODULATION_SHAPE_2BR); 183 183 default: 184 - dev_dbg(&spi->dev, "set: illegal mod shaping for OOK %u", mod_shaping); 184 + dev_dbg(&spi->dev, "set: illegal mod shaping for OOK %u\n", mod_shaping); 185 185 return -EINVAL; 186 186 } 187 187 default: 188 - dev_dbg(&spi->dev, "set: modulation undefined"); 188 + dev_dbg(&spi->dev, "set: modulation undefined\n"); 189 189 return -EINVAL; 190 190 } 191 191 } ··· 201 201 // check if modulation is configured 202 202 mod = rf69_get_modulation(spi); 203 203 if (mod == UNDEF) { 204 - dev_dbg(&spi->dev, "setBitRate: modulation is undefined"); 204 + dev_dbg(&spi->dev, "setBitRate: modulation is undefined\n"); 205 205 return -EINVAL; 206 206 } 207 207 208 208 // check input value 209 209 if (bit_rate < 1200 || (mod == OOK && bit_rate > 32768)) { 210 - dev_dbg(&spi->dev, "setBitRate: illegal input param"); 210 + dev_dbg(&spi->dev, "setBitRate: illegal input param\n"); 211 211 return -EINVAL; 212 212 } 213 213 ··· 251 251 */ 252 252 if (deviation < 600 || (deviation + (bit_rate / 2)) > 500000) { 253 253 dev_dbg(&spi->dev, 254 - "set_deviation: illegal input param: %u", deviation); 254 + "set_deviation: illegal input param: %u\n", deviation); 255 255 return -EINVAL; 256 256 } 257 257 ··· 268 268 269 269 // check msb 270 270 if (msb & ~FDEVMASB_MASK) { 271 - dev_dbg(&spi->dev, "set_deviation: err in calc of msb"); 271 + dev_dbg(&spi->dev, "set_deviation: err in calc of msb\n"); 272 272 return -EINVAL; 273 273 } 274 274 ··· 301 301 // check input value 302 302 f_max = div_u64(f_step * 8388608, factor); 303 303 if (frequency > f_max) { 304 - dev_dbg(&spi->dev, "setFrequency: illegal input param"); 304 + dev_dbg(&spi->dev, "setFrequency: illegal input param\n"); 305 305 return -EINVAL; 306 306 } 307 307 ··· 382 382 return rf69_read_mod_write(spi, REG_PALEVEL, MASK_PALEVEL_OUTPUT_POWER, 383 383 power_level); 384 384 failed: 385 - dev_dbg(&spi->dev, "set: illegal power level %u", power_level); 385 + dev_dbg(&spi->dev, "set: illegal power level %u\n", power_level); 386 386 return -EINVAL; 387 387 } 388 388 ··· 407 407 }; 408 408 409 409 if (unlikely(pa_ramp >= ARRAY_SIZE(pa_ramp_map))) { 410 - dev_dbg(&spi->dev, "set: illegal pa_ramp %u", pa_ramp); 410 + dev_dbg(&spi->dev, "set: illegal pa_ramp %u\n", pa_ramp); 411 411 return -EINVAL; 412 412 } 413 413 ··· 423 423 case two_hundred_ohm: 424 424 return rf69_set_bit(spi, REG_LNA, MASK_LNA_ZIN); 425 425 default: 426 - dev_dbg(&spi->dev, "set: illegal antenna impedance %u", antenna_impedance); 426 + dev_dbg(&spi->dev, "set: illegal antenna impedance %u\n", antenna_impedance); 427 427 return -EINVAL; 428 428 } 429 429 } ··· 441 441 }; 442 442 443 443 if (unlikely(lna_gain >= ARRAY_SIZE(lna_gain_map))) { 444 - dev_dbg(&spi->dev, "set: illegal lna gain %u", lna_gain); 444 + dev_dbg(&spi->dev, "set: illegal lna gain %u\n", lna_gain); 445 445 return -EINVAL; 446 446 } 447 447 ··· 456 456 457 457 // check value for mantisse and exponent 458 458 if (exponent > 7) { 459 - dev_dbg(&spi->dev, "set: illegal bandwidth exponent %u", exponent); 459 + dev_dbg(&spi->dev, "set: illegal bandwidth exponent %u\n", exponent); 460 460 return -EINVAL; 461 461 } 462 462 463 463 if (mantisse != mantisse16 && 464 464 mantisse != mantisse20 && 465 465 mantisse != mantisse24) { 466 - dev_dbg(&spi->dev, "set: illegal bandwidth mantisse %u", mantisse); 466 + dev_dbg(&spi->dev, "set: illegal bandwidth mantisse %u\n", mantisse); 467 467 return -EINVAL; 468 468 } 469 469 ··· 521 521 }; 522 522 523 523 if (unlikely(threshold_decrement >= ARRAY_SIZE(td_map))) { 524 - dev_dbg(&spi->dev, "set: illegal OOK threshold decrement %u", threshold_decrement); 524 + dev_dbg(&spi->dev, "set: illegal OOK threshold decrement %u\n", 525 + threshold_decrement); 525 526 return -EINVAL; 526 527 } 527 528 ··· 569 568 dio_addr = REG_DIOMAPPING2; 570 569 break; 571 570 default: 572 - dev_dbg(&spi->dev, "set: illegal dio number %u", dio_number); 571 + dev_dbg(&spi->dev, "set: illegal dio number %u\n", dio_number); 573 572 return -EINVAL; 574 573 } 575 574 ··· 673 672 return rf69_clear_bit(spi, REG_SYNC_CONFIG, 674 673 MASK_SYNC_CONFIG_FIFO_FILL_CONDITION); 675 674 default: 676 - dev_dbg(&spi->dev, "set: illegal fifo fill condition %u", fifo_fill_condition); 675 + dev_dbg(&spi->dev, "set: illegal fifo fill condition %u\n", fifo_fill_condition); 677 676 return -EINVAL; 678 677 } 679 678 } ··· 682 681 { 683 682 // check input value 684 683 if (sync_size > 0x07) { 685 - dev_dbg(&spi->dev, "set: illegal sync size %u", sync_size); 684 + dev_dbg(&spi->dev, "set: illegal sync size %u\n", sync_size); 686 685 return -EINVAL; 687 686 } 688 687 ··· 719 718 return rf69_clear_bit(spi, REG_PACKETCONFIG1, 720 719 MASK_PACKETCONFIG1_PACKET_FORMAT_VARIABLE); 721 720 default: 722 - dev_dbg(&spi->dev, "set: illegal packet format %u", packet_format); 721 + dev_dbg(&spi->dev, "set: illegal packet format %u\n", packet_format); 723 722 return -EINVAL; 724 723 } 725 724 } ··· 745 744 }; 746 745 747 746 if (unlikely(address_filtering >= ARRAY_SIZE(af_map))) { 748 - dev_dbg(&spi->dev, "set: illegal address filtering %u", address_filtering); 747 + dev_dbg(&spi->dev, "set: illegal address filtering %u\n", address_filtering); 749 748 return -EINVAL; 750 749 } 751 750 ··· 780 779 return rf69_set_bit(spi, REG_FIFO_THRESH, 781 780 MASK_FIFO_THRESH_TXSTART); 782 781 default: 783 - dev_dbg(&spi->dev, "set: illegal tx start condition %u", tx_start_condition); 782 + dev_dbg(&spi->dev, "set: illegal tx start condition %u\n", tx_start_condition); 784 783 return -EINVAL; 785 784 } 786 785 } ··· 791 790 792 791 /* check input value */ 793 792 if (threshold & 0x80) { 794 - dev_dbg(&spi->dev, "set: illegal fifo threshold %u", threshold); 793 + dev_dbg(&spi->dev, "set: illegal fifo threshold %u\n", threshold); 795 794 return -EINVAL; 796 795 } 797 796 ··· 818 817 }; 819 818 820 819 if (unlikely(dagc >= ARRAY_SIZE(dagc_map))) { 821 - dev_dbg(&spi->dev, "set: illegal dagc %u", dagc); 820 + dev_dbg(&spi->dev, "set: illegal dagc %u\n", dagc); 822 821 return -EINVAL; 823 822 } 824 823