aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/debug.c
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2010-11-08 13:50:03 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:26:37 -0500
commit5d882c97e2c958df9f8b78832fa1ecbecef6ea1d (patch)
treefc6e7ee71576ec9b2476f15508e4321511234743 /drivers/net/wireless/ath/ath5k/debug.c
parent8c5765fda4b382acce4ff386e18ec11790dff893 (diff)
ath5k: Print stats as unsigned ints.
The debugfs code for ath5k was printing some unsigned int stats with %d instead of %u. This meant that you could see negative numbers instead of a clean wrap. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/debug.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/debug.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index acda56ee521b..54dcf77e9646 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -554,63 +554,63 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf,
554 554
555 len += snprintf(buf+len, sizeof(buf)-len, 555 len += snprintf(buf+len, sizeof(buf)-len,
556 "RX\n---------------------\n"); 556 "RX\n---------------------\n");
557 len += snprintf(buf+len, sizeof(buf)-len, "CRC\t%d\t(%d%%)\n", 557 len += snprintf(buf+len, sizeof(buf)-len, "CRC\t%u\t(%u%%)\n",
558 st->rxerr_crc, 558 st->rxerr_crc,
559 st->rx_all_count > 0 ? 559 st->rx_all_count > 0 ?
560 st->rxerr_crc*100/st->rx_all_count : 0); 560 st->rxerr_crc*100/st->rx_all_count : 0);
561 len += snprintf(buf+len, sizeof(buf)-len, "PHY\t%d\t(%d%%)\n", 561 len += snprintf(buf+len, sizeof(buf)-len, "PHY\t%u\t(%u%%)\n",
562 st->rxerr_phy, 562 st->rxerr_phy,
563 st->rx_all_count > 0 ? 563 st->rx_all_count > 0 ?
564 st->rxerr_phy*100/st->rx_all_count : 0); 564 st->rxerr_phy*100/st->rx_all_count : 0);
565 for (i = 0; i < 32; i++) { 565 for (i = 0; i < 32; i++) {
566 if (st->rxerr_phy_code[i]) 566 if (st->rxerr_phy_code[i])
567 len += snprintf(buf+len, sizeof(buf)-len, 567 len += snprintf(buf+len, sizeof(buf)-len,
568 " phy_err[%d]\t%d\n", 568 " phy_err[%u]\t%u\n",
569 i, st->rxerr_phy_code[i]); 569 i, st->rxerr_phy_code[i]);
570 } 570 }
571 571
572 len += snprintf(buf+len, sizeof(buf)-len, "FIFO\t%d\t(%d%%)\n", 572 len += snprintf(buf+len, sizeof(buf)-len, "FIFO\t%u\t(%u%%)\n",
573 st->rxerr_fifo, 573 st->rxerr_fifo,
574 st->rx_all_count > 0 ? 574 st->rx_all_count > 0 ?
575 st->rxerr_fifo*100/st->rx_all_count : 0); 575 st->rxerr_fifo*100/st->rx_all_count : 0);
576 len += snprintf(buf+len, sizeof(buf)-len, "decrypt\t%d\t(%d%%)\n", 576 len += snprintf(buf+len, sizeof(buf)-len, "decrypt\t%u\t(%u%%)\n",
577 st->rxerr_decrypt, 577 st->rxerr_decrypt,
578 st->rx_all_count > 0 ? 578 st->rx_all_count > 0 ?
579 st->rxerr_decrypt*100/st->rx_all_count : 0); 579 st->rxerr_decrypt*100/st->rx_all_count : 0);
580 len += snprintf(buf+len, sizeof(buf)-len, "MIC\t%d\t(%d%%)\n", 580 len += snprintf(buf+len, sizeof(buf)-len, "MIC\t%u\t(%u%%)\n",
581 st->rxerr_mic, 581 st->rxerr_mic,
582 st->rx_all_count > 0 ? 582 st->rx_all_count > 0 ?
583 st->rxerr_mic*100/st->rx_all_count : 0); 583 st->rxerr_mic*100/st->rx_all_count : 0);
584 len += snprintf(buf+len, sizeof(buf)-len, "process\t%d\t(%d%%)\n", 584 len += snprintf(buf+len, sizeof(buf)-len, "process\t%u\t(%u%%)\n",
585 st->rxerr_proc, 585 st->rxerr_proc,
586 st->rx_all_count > 0 ? 586 st->rx_all_count > 0 ?
587 st->rxerr_proc*100/st->rx_all_count : 0); 587 st->rxerr_proc*100/st->rx_all_count : 0);
588 len += snprintf(buf+len, sizeof(buf)-len, "jumbo\t%d\t(%d%%)\n", 588 len += snprintf(buf+len, sizeof(buf)-len, "jumbo\t%u\t(%u%%)\n",
589 st->rxerr_jumbo, 589 st->rxerr_jumbo,
590 st->rx_all_count > 0 ? 590 st->rx_all_count > 0 ?
591 st->rxerr_jumbo*100/st->rx_all_count : 0); 591 st->rxerr_jumbo*100/st->rx_all_count : 0);
592 len += snprintf(buf+len, sizeof(buf)-len, "[RX all\t%d]\n", 592 len += snprintf(buf+len, sizeof(buf)-len, "[RX all\t%u]\n",
593 st->rx_all_count); 593 st->rx_all_count);
594 len += snprintf(buf+len, sizeof(buf)-len, "RX-all-bytes\t%d\n", 594 len += snprintf(buf+len, sizeof(buf)-len, "RX-all-bytes\t%u\n",
595 st->rx_bytes_count); 595 st->rx_bytes_count);
596 596
597 len += snprintf(buf+len, sizeof(buf)-len, 597 len += snprintf(buf+len, sizeof(buf)-len,
598 "\nTX\n---------------------\n"); 598 "\nTX\n---------------------\n");
599 len += snprintf(buf+len, sizeof(buf)-len, "retry\t%d\t(%d%%)\n", 599 len += snprintf(buf+len, sizeof(buf)-len, "retry\t%u\t(%u%%)\n",
600 st->txerr_retry, 600 st->txerr_retry,
601 st->tx_all_count > 0 ? 601 st->tx_all_count > 0 ?
602 st->txerr_retry*100/st->tx_all_count : 0); 602 st->txerr_retry*100/st->tx_all_count : 0);
603 len += snprintf(buf+len, sizeof(buf)-len, "FIFO\t%d\t(%d%%)\n", 603 len += snprintf(buf+len, sizeof(buf)-len, "FIFO\t%u\t(%u%%)\n",
604 st->txerr_fifo, 604 st->txerr_fifo,
605 st->tx_all_count > 0 ? 605 st->tx_all_count > 0 ?
606 st->txerr_fifo*100/st->tx_all_count : 0); 606 st->txerr_fifo*100/st->tx_all_count : 0);
607 len += snprintf(buf+len, sizeof(buf)-len, "filter\t%d\t(%d%%)\n", 607 len += snprintf(buf+len, sizeof(buf)-len, "filter\t%u\t(%u%%)\n",
608 st->txerr_filt, 608 st->txerr_filt,
609 st->tx_all_count > 0 ? 609 st->tx_all_count > 0 ?
610 st->txerr_filt*100/st->tx_all_count : 0); 610 st->txerr_filt*100/st->tx_all_count : 0);
611 len += snprintf(buf+len, sizeof(buf)-len, "[TX all\t%d]\n", 611 len += snprintf(buf+len, sizeof(buf)-len, "[TX all\t%u]\n",
612 st->tx_all_count); 612 st->tx_all_count);
613 len += snprintf(buf+len, sizeof(buf)-len, "TX-all-bytes\t%d\n", 613 len += snprintf(buf+len, sizeof(buf)-len, "TX-all-bytes\t%u\n",
614 st->tx_bytes_count); 614 st->tx_bytes_count);
615 615
616 if (len > sizeof(buf)) 616 if (len > sizeof(buf))