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

Char: rocket, printk cleanup

- add KERN_ level to each print
- change some levels appropriately
- add \n at the ends where missing
- change two complex printks into dev_info, where the original info is
printed automatically

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jiri Slaby and committed by
Linus Torvalds
68562b79 48a67f5d

+51 -44
+48 -41
drivers/char/rocket.c
··· 305 305 if (!info) 306 306 return 1; 307 307 if (info->magic != RPORT_MAGIC) { 308 - printk(KERN_INFO "Warning: bad magic number for rocketport struct in %s\n", 309 - routine); 308 + printk(KERN_WARNING "Warning: bad magic number for rocketport " 309 + "struct in %s\n", routine); 310 310 return 1; 311 311 } 312 312 #endif ··· 328 328 329 329 ToRecv = sGetRxCnt(cp); 330 330 #ifdef ROCKET_DEBUG_INTR 331 - printk(KERN_INFO "rp_do_receive(%d)...", ToRecv); 331 + printk(KERN_INFO "rp_do_receive(%d)...\n", ToRecv); 332 332 #endif 333 333 if (ToRecv == 0) 334 334 return; ··· 341 341 if (ChanStatus & (RXFOVERFL | RXBREAK | RXFRAME | RXPARITY)) { 342 342 if (!(ChanStatus & STATMODE)) { 343 343 #ifdef ROCKET_DEBUG_RECEIVE 344 - printk(KERN_INFO "Entering STATMODE..."); 344 + printk(KERN_INFO "Entering STATMODE...\n"); 345 345 #endif 346 346 ChanStatus |= STATMODE; 347 347 sEnRxStatusMode(cp); ··· 355 355 */ 356 356 if (ChanStatus & STATMODE) { 357 357 #ifdef ROCKET_DEBUG_RECEIVE 358 - printk(KERN_INFO "Ignore %x, read %x...", info->ignore_status_mask, 359 - info->read_status_mask); 358 + printk(KERN_INFO "Ignore %x, read %x...\n", 359 + info->ignore_status_mask, info->read_status_mask); 360 360 #endif 361 361 while (ToRecv) { 362 362 char flag; 363 363 364 364 CharNStat = sInW(sGetTxRxDataIO(cp)); 365 365 #ifdef ROCKET_DEBUG_RECEIVE 366 - printk(KERN_INFO "%x...", CharNStat); 366 + printk(KERN_INFO "%x...\n", CharNStat); 367 367 #endif 368 368 if (CharNStat & STMBREAKH) 369 369 CharNStat &= ~(STMFRAMEH | STMPARITYH); ··· 435 435 unsigned long flags; 436 436 437 437 #ifdef ROCKET_DEBUG_INTR 438 - printk(KERN_INFO "rp_do_transmit "); 438 + printk(KERN_DEBUG "%s\n", __func__); 439 439 #endif 440 440 if (!info) 441 441 return; 442 442 if (!info->tty) { 443 - printk(KERN_INFO "rp: WARNING rp_do_transmit called with info->tty==NULL\n"); 443 + printk(KERN_WARNING "rp: WARNING %s called with " 444 + "info->tty==NULL\n", __func__); 444 445 clear_bit((info->aiop * 8) + info->chan, (void *) &xmit_flags[info->board]); 445 446 return; 446 447 } ··· 465 464 info->xmit_cnt -= c; 466 465 info->xmit_fifo_room -= c; 467 466 #ifdef ROCKET_DEBUG_INTR 468 - printk(KERN_INFO "tx %d chars...", c); 467 + printk(KERN_INFO "tx %d chars...\n", c); 469 468 #endif 470 469 } 471 470 ··· 482 481 spin_unlock_irqrestore(&info->slock, flags); 483 482 484 483 #ifdef ROCKET_DEBUG_INTR 485 - printk(KERN_INFO "(%d,%d,%d,%d)...", info->xmit_cnt, info->xmit_head, 484 + printk(KERN_DEBUG "(%d,%d,%d,%d)...\n", info->xmit_cnt, info->xmit_head, 486 485 info->xmit_tail, info->xmit_fifo_room); 487 486 #endif 488 487 } ··· 502 501 return; 503 502 504 503 if ((info->flags & ROCKET_INITIALIZED) == 0) { 505 - printk(KERN_INFO "rp: WARNING: rp_handle_port called with info->flags & NOT_INIT\n"); 504 + printk(KERN_WARNING "rp: WARNING: rp_handle_port called with " 505 + "info->flags & NOT_INIT\n"); 506 506 return; 507 507 } 508 508 if (!info->tty) { 509 - printk(KERN_INFO "rp: WARNING: rp_handle_port called with info->tty==NULL\n"); 509 + printk(KERN_WARNING "rp: WARNING: rp_handle_port called with " 510 + "info->tty==NULL\n"); 510 511 return; 511 512 } 512 513 cp = &info->channel; ··· 516 513 517 514 IntMask = sGetChanIntID(cp) & info->intmask; 518 515 #ifdef ROCKET_DEBUG_INTR 519 - printk(KERN_INFO "rp_interrupt %02x...", IntMask); 516 + printk(KERN_INFO "rp_interrupt %02x...\n", IntMask); 520 517 #endif 521 518 ChanStatus = sGetChanStatus(cp); 522 519 if (IntMask & RXF_TRIG) { /* Rx FIFO trigger level */ ··· 524 521 } 525 522 if (IntMask & DELTA_CD) { /* CD change */ 526 523 #if (defined(ROCKET_DEBUG_OPEN) || defined(ROCKET_DEBUG_INTR) || defined(ROCKET_DEBUG_HANGUP)) 527 - printk(KERN_INFO "ttyR%d CD now %s...", info->line, 524 + printk(KERN_INFO "ttyR%d CD now %s...\n", info->line, 528 525 (ChanStatus & CD_ACT) ? "on" : "off"); 529 526 #endif 530 527 if (!(ChanStatus & CD_ACT) && info->cd_status) { ··· 641 638 /* Get a r_port struct for the port, fill it in and save it globally, indexed by line number */ 642 639 info = kzalloc(sizeof (struct r_port), GFP_KERNEL); 643 640 if (!info) { 644 - printk(KERN_INFO "Couldn't allocate info struct for line #%d\n", line); 641 + printk(KERN_ERR "Couldn't allocate info struct for line #%d\n", 642 + line); 645 643 return; 646 644 } 647 645 ··· 672 668 673 669 info->intmask = RXF_TRIG | TXFIFO_MT | SRC_INT | DELTA_CD | DELTA_CTS | DELTA_DSR; 674 670 if (sInitChan(ctlp, &info->channel, aiop, chan) == 0) { 675 - printk(KERN_INFO "RocketPort sInitChan(%d, %d, %d) failed!\n", board, aiop, chan); 671 + printk(KERN_ERR "RocketPort sInitChan(%d, %d, %d) failed!\n", 672 + board, aiop, chan); 676 673 kfree(info); 677 674 return; 678 675 } ··· 1012 1007 atomic_inc(&rp_num_ports_open); 1013 1008 1014 1009 #ifdef ROCKET_DEBUG_OPEN 1015 - printk(KERN_INFO "rocket mod++ = %d...", atomic_read(&rp_num_ports_open)); 1010 + printk(KERN_INFO "rocket mod++ = %d...\n", 1011 + atomic_read(&rp_num_ports_open)); 1016 1012 #endif 1017 1013 } 1018 1014 #ifdef ROCKET_DEBUG_OPEN ··· 1109 1103 * one, we've got real problems, since it means the 1110 1104 * serial port won't be shutdown. 1111 1105 */ 1112 - printk(KERN_INFO "rp_close: bad serial port count; tty->count is 1, " 1113 - "info->count is %d\n", info->count); 1106 + printk(KERN_WARNING "rp_close: bad serial port count; " 1107 + "tty->count is 1, info->count is %d\n", info->count); 1114 1108 info->count = 1; 1115 1109 } 1116 1110 if (--info->count < 0) { 1117 - printk(KERN_INFO "rp_close: bad serial port count for ttyR%d: %d\n", 1118 - info->line, info->count); 1111 + printk(KERN_WARNING "rp_close: bad serial port count for " 1112 + "ttyR%d: %d\n", info->line, info->count); 1119 1113 info->count = 0; 1120 1114 } 1121 1115 if (info->count) { ··· 1190 1184 atomic_dec(&rp_num_ports_open); 1191 1185 1192 1186 #ifdef ROCKET_DEBUG_OPEN 1193 - printk(KERN_INFO "rocket mod-- = %d...", atomic_read(&rp_num_ports_open)); 1187 + printk(KERN_INFO "rocket mod-- = %d...\n", 1188 + atomic_read(&rp_num_ports_open)); 1194 1189 printk(KERN_INFO "rp_close ttyR%d complete shutdown\n", info->line); 1195 1190 #endif 1196 1191 ··· 1576 1569 1577 1570 orig_jiffies = jiffies; 1578 1571 #ifdef ROCKET_DEBUG_WAIT_UNTIL_SENT 1579 - printk(KERN_INFO "In RP_wait_until_sent(%d) (jiff=%lu)...", timeout, 1572 + printk(KERN_INFO "In RP_wait_until_sent(%d) (jiff=%lu)...\n", timeout, 1580 1573 jiffies); 1581 - printk(KERN_INFO "cps=%d...", info->cps); 1574 + printk(KERN_INFO "cps=%d...\n", info->cps); 1582 1575 #endif 1583 1576 while (1) { 1584 1577 txcnt = sGetTxCnt(cp); ··· 1599 1592 if (check_time == 0) 1600 1593 check_time = 1; 1601 1594 #ifdef ROCKET_DEBUG_WAIT_UNTIL_SENT 1602 - printk(KERN_INFO "txcnt = %d (jiff=%lu,check=%d)...", txcnt, jiffies, check_time); 1595 + printk(KERN_INFO "txcnt = %d (jiff=%lu,check=%d)...\n", txcnt, 1596 + jiffies, check_time); 1603 1597 #endif 1604 1598 msleep_interruptible(jiffies_to_msecs(check_time)); 1605 1599 if (signal_pending(current)) ··· 1624 1616 return; 1625 1617 1626 1618 #if (defined(ROCKET_DEBUG_OPEN) || defined(ROCKET_DEBUG_HANGUP)) 1627 - printk(KERN_INFO "rp_hangup of ttyR%d...", info->line); 1619 + printk(KERN_INFO "rp_hangup of ttyR%d...\n", info->line); 1628 1620 #endif 1629 1621 rp_flush_buffer(tty); 1630 1622 if (info->flags & ROCKET_CLOSING) ··· 1672 1664 mutex_lock(&info->write_mtx); 1673 1665 1674 1666 #ifdef ROCKET_DEBUG_WRITE 1675 - printk(KERN_INFO "rp_put_char %c...", ch); 1667 + printk(KERN_INFO "rp_put_char %c...\n", ch); 1676 1668 #endif 1677 1669 1678 1670 spin_lock_irqsave(&info->slock, flags); ··· 1717 1709 return -ERESTARTSYS; 1718 1710 1719 1711 #ifdef ROCKET_DEBUG_WRITE 1720 - printk(KERN_INFO "rp_write %d chars...", count); 1712 + printk(KERN_INFO "rp_write %d chars...\n", count); 1721 1713 #endif 1722 1714 cp = &info->channel; 1723 1715 ··· 1806 1798 if (ret < 0) 1807 1799 ret = 0; 1808 1800 #ifdef ROCKET_DEBUG_WRITE 1809 - printk(KERN_INFO "rp_write_room returns %d...", ret); 1801 + printk(KERN_INFO "rp_write_room returns %d...\n", ret); 1810 1802 #endif 1811 1803 return ret; 1812 1804 } ··· 1826 1818 cp = &info->channel; 1827 1819 1828 1820 #ifdef ROCKET_DEBUG_WRITE 1829 - printk(KERN_INFO "rp_chars_in_buffer returns %d...", info->xmit_cnt); 1821 + printk(KERN_INFO "rp_chars_in_buffer returns %d...\n", info->xmit_cnt); 1830 1822 #endif 1831 1823 return info->xmit_cnt; 1832 1824 } ··· 2169 2161 for (aiop = 0; aiop < max_num_aiops; aiop++) 2170 2162 ctlp->AiopNumChan[aiop] = ports_per_aiop; 2171 2163 2172 - printk("Comtrol PCI controller #%d ID 0x%x found in bus:slot:fn %s at address %04lx, " 2173 - "%d AIOP(s) (%s)\n", i, dev->device, pci_name(dev), 2174 - rcktpt_io_addr[i], num_aiops, rocketModel[i].modelString); 2175 - printk(KERN_INFO "Installing %s, creating /dev/ttyR%d - %ld\n", 2176 - rocketModel[i].modelString, 2177 - rocketModel[i].startingPortNumber, 2178 - rocketModel[i].startingPortNumber + 2179 - rocketModel[i].numPorts - 1); 2164 + dev_info(&dev->dev, "comtrol PCI controller #%d found at " 2165 + "address %04lx, %d AIOP(s) (%s), creating ttyR%d - %ld\n", 2166 + i, rcktpt_io_addr[i], num_aiops, rocketModel[i].modelString, 2167 + rocketModel[i].startingPortNumber, 2168 + rocketModel[i].startingPortNumber + rocketModel[i].numPorts-1); 2180 2169 2181 2170 if (num_aiops <= 0) { 2182 2171 rcktpt_io_addr[i] = 0; ··· 2245 2240 2246 2241 /* Reserve the IO region */ 2247 2242 if (!request_region(rcktpt_io_addr[i], 64, "Comtrol RocketPort")) { 2248 - printk(KERN_INFO "Unable to reserve IO region for configured ISA RocketPort at address 0x%lx, board not installed...\n", rcktpt_io_addr[i]); 2243 + printk(KERN_ERR "Unable to reserve IO region for configured " 2244 + "ISA RocketPort at address 0x%lx, board not " 2245 + "installed...\n", rcktpt_io_addr[i]); 2249 2246 rcktpt_io_addr[i] = 0; 2250 2247 return (0); 2251 2248 } ··· 2487 2480 2488 2481 retval = tty_unregister_driver(rocket_driver); 2489 2482 if (retval) 2490 - printk(KERN_INFO "Error %d while trying to unregister " 2483 + printk(KERN_ERR "Error %d while trying to unregister " 2491 2484 "rocketport driver\n", -retval); 2492 2485 2493 2486 for (i = 0; i < MAX_RP_PORTS; i++)
+3 -3
drivers/char/rocket_int.h
··· 42 42 static inline void sOutB(unsigned short port, unsigned char value) 43 43 { 44 44 #ifdef ROCKET_DEBUG_IO 45 - printk("sOutB(%x, %x)...", port, value); 45 + printk(KERN_DEBUG "sOutB(%x, %x)...\n", port, value); 46 46 #endif 47 47 outb_p(value, port); 48 48 } ··· 50 50 static inline void sOutW(unsigned short port, unsigned short value) 51 51 { 52 52 #ifdef ROCKET_DEBUG_IO 53 - printk("sOutW(%x, %x)...", port, value); 53 + printk(KERN_DEBUG "sOutW(%x, %x)...\n", port, value); 54 54 #endif 55 55 outw_p(value, port); 56 56 } ··· 58 58 static inline void sOutDW(unsigned short port, unsigned long value) 59 59 { 60 60 #ifdef ROCKET_DEBUG_IO 61 - printk("sOutDW(%x, %lx)...", port, value); 61 + printk(KERN_DEBUG "sOutDW(%x, %lx)...\n", port, value); 62 62 #endif 63 63 outl_p(cpu_to_le32(value), port); 64 64 }