diff options
author | Joe Perches <joe@perches.com> | 2012-05-16 13:50:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-17 05:00:04 -0400 |
commit | f342cda7789381236a6c94926a9ca177a9098867 (patch) | |
tree | aa13a4555ba9be67cffedebfeec9834aff1ae142 /net | |
parent | dc6b9b78234fecdc6d2ca5e1629185718202bcf5 (diff) |
pktgen: Use pr_debug
Convert printk(KERN_DEBUG to pr_debug which can
enable dynamic debugging.
Remove embedded prefixes from the conversions as
pr_fmt adds them.
Align arguments.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/pktgen.c | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 70236db0fb4f..30eb768cd677 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -891,8 +891,8 @@ static ssize_t pktgen_if_write(struct file *file, | |||
891 | if (copy_from_user(tb, user_buffer, copy)) | 891 | if (copy_from_user(tb, user_buffer, copy)) |
892 | return -EFAULT; | 892 | return -EFAULT; |
893 | tb[copy] = 0; | 893 | tb[copy] = 0; |
894 | printk(KERN_DEBUG "pktgen: %s,%lu buffer -:%s:-\n", name, | 894 | pr_debug("%s,%lu buffer -:%s:-\n", |
895 | (unsigned long)count, tb); | 895 | name, (unsigned long)count, tb); |
896 | } | 896 | } |
897 | 897 | ||
898 | if (!strcmp(name, "min_pkt_size")) { | 898 | if (!strcmp(name, "min_pkt_size")) { |
@@ -1261,8 +1261,7 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1261 | pkt_dev->cur_daddr = pkt_dev->daddr_min; | 1261 | pkt_dev->cur_daddr = pkt_dev->daddr_min; |
1262 | } | 1262 | } |
1263 | if (debug) | 1263 | if (debug) |
1264 | printk(KERN_DEBUG "pktgen: dst_min set to: %s\n", | 1264 | pr_debug("dst_min set to: %s\n", pkt_dev->dst_min); |
1265 | pkt_dev->dst_min); | ||
1266 | i += len; | 1265 | i += len; |
1267 | sprintf(pg_result, "OK: dst_min=%s", pkt_dev->dst_min); | 1266 | sprintf(pg_result, "OK: dst_min=%s", pkt_dev->dst_min); |
1268 | return count; | 1267 | return count; |
@@ -1284,8 +1283,7 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1284 | pkt_dev->cur_daddr = pkt_dev->daddr_max; | 1283 | pkt_dev->cur_daddr = pkt_dev->daddr_max; |
1285 | } | 1284 | } |
1286 | if (debug) | 1285 | if (debug) |
1287 | printk(KERN_DEBUG "pktgen: dst_max set to: %s\n", | 1286 | pr_debug("dst_max set to: %s\n", pkt_dev->dst_max); |
1288 | pkt_dev->dst_max); | ||
1289 | i += len; | 1287 | i += len; |
1290 | sprintf(pg_result, "OK: dst_max=%s", pkt_dev->dst_max); | 1288 | sprintf(pg_result, "OK: dst_max=%s", pkt_dev->dst_max); |
1291 | return count; | 1289 | return count; |
@@ -1307,7 +1305,7 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1307 | pkt_dev->cur_in6_daddr = pkt_dev->in6_daddr; | 1305 | pkt_dev->cur_in6_daddr = pkt_dev->in6_daddr; |
1308 | 1306 | ||
1309 | if (debug) | 1307 | if (debug) |
1310 | printk(KERN_DEBUG "pktgen: dst6 set to: %s\n", buf); | 1308 | pr_debug("dst6 set to: %s\n", buf); |
1311 | 1309 | ||
1312 | i += len; | 1310 | i += len; |
1313 | sprintf(pg_result, "OK: dst6=%s", buf); | 1311 | sprintf(pg_result, "OK: dst6=%s", buf); |
@@ -1329,7 +1327,7 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1329 | 1327 | ||
1330 | pkt_dev->cur_in6_daddr = pkt_dev->min_in6_daddr; | 1328 | pkt_dev->cur_in6_daddr = pkt_dev->min_in6_daddr; |
1331 | if (debug) | 1329 | if (debug) |
1332 | printk(KERN_DEBUG "pktgen: dst6_min set to: %s\n", buf); | 1330 | pr_debug("dst6_min set to: %s\n", buf); |
1333 | 1331 | ||
1334 | i += len; | 1332 | i += len; |
1335 | sprintf(pg_result, "OK: dst6_min=%s", buf); | 1333 | sprintf(pg_result, "OK: dst6_min=%s", buf); |
@@ -1350,7 +1348,7 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1350 | snprintf(buf, sizeof(buf), "%pI6c", &pkt_dev->max_in6_daddr); | 1348 | snprintf(buf, sizeof(buf), "%pI6c", &pkt_dev->max_in6_daddr); |
1351 | 1349 | ||
1352 | if (debug) | 1350 | if (debug) |
1353 | printk(KERN_DEBUG "pktgen: dst6_max set to: %s\n", buf); | 1351 | pr_debug("dst6_max set to: %s\n", buf); |
1354 | 1352 | ||
1355 | i += len; | 1353 | i += len; |
1356 | sprintf(pg_result, "OK: dst6_max=%s", buf); | 1354 | sprintf(pg_result, "OK: dst6_max=%s", buf); |
@@ -1373,7 +1371,7 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1373 | pkt_dev->cur_in6_saddr = pkt_dev->in6_saddr; | 1371 | pkt_dev->cur_in6_saddr = pkt_dev->in6_saddr; |
1374 | 1372 | ||
1375 | if (debug) | 1373 | if (debug) |
1376 | printk(KERN_DEBUG "pktgen: src6 set to: %s\n", buf); | 1374 | pr_debug("src6 set to: %s\n", buf); |
1377 | 1375 | ||
1378 | i += len; | 1376 | i += len; |
1379 | sprintf(pg_result, "OK: src6=%s", buf); | 1377 | sprintf(pg_result, "OK: src6=%s", buf); |
@@ -1394,8 +1392,7 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1394 | pkt_dev->cur_saddr = pkt_dev->saddr_min; | 1392 | pkt_dev->cur_saddr = pkt_dev->saddr_min; |
1395 | } | 1393 | } |
1396 | if (debug) | 1394 | if (debug) |
1397 | printk(KERN_DEBUG "pktgen: src_min set to: %s\n", | 1395 | pr_debug("src_min set to: %s\n", pkt_dev->src_min); |
1398 | pkt_dev->src_min); | ||
1399 | i += len; | 1396 | i += len; |
1400 | sprintf(pg_result, "OK: src_min=%s", pkt_dev->src_min); | 1397 | sprintf(pg_result, "OK: src_min=%s", pkt_dev->src_min); |
1401 | return count; | 1398 | return count; |
@@ -1415,8 +1412,7 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1415 | pkt_dev->cur_saddr = pkt_dev->saddr_max; | 1412 | pkt_dev->cur_saddr = pkt_dev->saddr_max; |
1416 | } | 1413 | } |
1417 | if (debug) | 1414 | if (debug) |
1418 | printk(KERN_DEBUG "pktgen: src_max set to: %s\n", | 1415 | pr_debug("src_max set to: %s\n", pkt_dev->src_max); |
1419 | pkt_dev->src_max); | ||
1420 | i += len; | 1416 | i += len; |
1421 | sprintf(pg_result, "OK: src_max=%s", pkt_dev->src_max); | 1417 | sprintf(pg_result, "OK: src_max=%s", pkt_dev->src_max); |
1422 | return count; | 1418 | return count; |
@@ -1527,7 +1523,7 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1527 | pkt_dev->svlan_id = 0xffff; | 1523 | pkt_dev->svlan_id = 0xffff; |
1528 | 1524 | ||
1529 | if (debug) | 1525 | if (debug) |
1530 | printk(KERN_DEBUG "pktgen: VLAN/SVLAN auto turned off\n"); | 1526 | pr_debug("VLAN/SVLAN auto turned off\n"); |
1531 | } | 1527 | } |
1532 | return count; | 1528 | return count; |
1533 | } | 1529 | } |
@@ -1542,10 +1538,10 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1542 | pkt_dev->vlan_id = value; /* turn on VLAN */ | 1538 | pkt_dev->vlan_id = value; /* turn on VLAN */ |
1543 | 1539 | ||
1544 | if (debug) | 1540 | if (debug) |
1545 | printk(KERN_DEBUG "pktgen: VLAN turned on\n"); | 1541 | pr_debug("VLAN turned on\n"); |
1546 | 1542 | ||
1547 | if (debug && pkt_dev->nr_labels) | 1543 | if (debug && pkt_dev->nr_labels) |
1548 | printk(KERN_DEBUG "pktgen: MPLS auto turned off\n"); | 1544 | pr_debug("MPLS auto turned off\n"); |
1549 | 1545 | ||
1550 | pkt_dev->nr_labels = 0; /* turn off MPLS */ | 1546 | pkt_dev->nr_labels = 0; /* turn off MPLS */ |
1551 | sprintf(pg_result, "OK: vlan_id=%u", pkt_dev->vlan_id); | 1547 | sprintf(pg_result, "OK: vlan_id=%u", pkt_dev->vlan_id); |
@@ -1554,7 +1550,7 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1554 | pkt_dev->svlan_id = 0xffff; | 1550 | pkt_dev->svlan_id = 0xffff; |
1555 | 1551 | ||
1556 | if (debug) | 1552 | if (debug) |
1557 | printk(KERN_DEBUG "pktgen: VLAN/SVLAN turned off\n"); | 1553 | pr_debug("VLAN/SVLAN turned off\n"); |
1558 | } | 1554 | } |
1559 | return count; | 1555 | return count; |
1560 | } | 1556 | } |
@@ -1599,10 +1595,10 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1599 | pkt_dev->svlan_id = value; /* turn on SVLAN */ | 1595 | pkt_dev->svlan_id = value; /* turn on SVLAN */ |
1600 | 1596 | ||
1601 | if (debug) | 1597 | if (debug) |
1602 | printk(KERN_DEBUG "pktgen: SVLAN turned on\n"); | 1598 | pr_debug("SVLAN turned on\n"); |
1603 | 1599 | ||
1604 | if (debug && pkt_dev->nr_labels) | 1600 | if (debug && pkt_dev->nr_labels) |
1605 | printk(KERN_DEBUG "pktgen: MPLS auto turned off\n"); | 1601 | pr_debug("MPLS auto turned off\n"); |
1606 | 1602 | ||
1607 | pkt_dev->nr_labels = 0; /* turn off MPLS */ | 1603 | pkt_dev->nr_labels = 0; /* turn off MPLS */ |
1608 | sprintf(pg_result, "OK: svlan_id=%u", pkt_dev->svlan_id); | 1604 | sprintf(pg_result, "OK: svlan_id=%u", pkt_dev->svlan_id); |
@@ -1611,7 +1607,7 @@ static ssize_t pktgen_if_write(struct file *file, | |||
1611 | pkt_dev->svlan_id = 0xffff; | 1607 | pkt_dev->svlan_id = 0xffff; |
1612 | 1608 | ||
1613 | if (debug) | 1609 | if (debug) |
1614 | printk(KERN_DEBUG "pktgen: VLAN/SVLAN turned off\n"); | 1610 | pr_debug("VLAN/SVLAN turned off\n"); |
1615 | } | 1611 | } |
1616 | return count; | 1612 | return count; |
1617 | } | 1613 | } |
@@ -1779,8 +1775,7 @@ static ssize_t pktgen_thread_write(struct file *file, | |||
1779 | i += len; | 1775 | i += len; |
1780 | 1776 | ||
1781 | if (debug) | 1777 | if (debug) |
1782 | printk(KERN_DEBUG "pktgen: t=%s, count=%lu\n", | 1778 | pr_debug("t=%s, count=%lu\n", name, (unsigned long)count); |
1783 | name, (unsigned long)count); | ||
1784 | 1779 | ||
1785 | if (!t) { | 1780 | if (!t) { |
1786 | pr_err("ERROR: No thread\n"); | 1781 | pr_err("ERROR: No thread\n"); |