diff options
| author | Joe Perches <joe@perches.com> | 2015-04-15 19:18:28 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-15 19:35:25 -0400 |
| commit | e693d73c20ffdb06840c9378f367bad849ac0d5d (patch) | |
| tree | e24a03541e2e321df60e81ca97cedaaf67e3c270 | |
| parent | d50f8f8d91a7dcb6110c4600072c62fc44b65572 (diff) | |
parisc: remove use of seq_printf return value
The seq_printf return value, because it's frequently misused,
will eventually be converted to void.
See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
seq_has_overflowed() and make public")
Signed-off-by: Joe Perches <joe@perches.com>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| -rw-r--r-- | drivers/parisc/ccio-dma.c | 54 | ||||
| -rw-r--r-- | drivers/parisc/sba_iommu.c | 86 |
2 files changed, 68 insertions, 72 deletions
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c index 8b490d77054f..6bc16809c504 100644 --- a/drivers/parisc/ccio-dma.c +++ b/drivers/parisc/ccio-dma.c | |||
| @@ -1021,7 +1021,6 @@ static struct hppa_dma_ops ccio_ops = { | |||
| 1021 | #ifdef CONFIG_PROC_FS | 1021 | #ifdef CONFIG_PROC_FS |
| 1022 | static int ccio_proc_info(struct seq_file *m, void *p) | 1022 | static int ccio_proc_info(struct seq_file *m, void *p) |
| 1023 | { | 1023 | { |
| 1024 | int len = 0; | ||
| 1025 | struct ioc *ioc = ioc_list; | 1024 | struct ioc *ioc = ioc_list; |
| 1026 | 1025 | ||
| 1027 | while (ioc != NULL) { | 1026 | while (ioc != NULL) { |
| @@ -1031,22 +1030,22 @@ static int ccio_proc_info(struct seq_file *m, void *p) | |||
| 1031 | int j; | 1030 | int j; |
| 1032 | #endif | 1031 | #endif |
| 1033 | 1032 | ||
| 1034 | len += seq_printf(m, "%s\n", ioc->name); | 1033 | seq_printf(m, "%s\n", ioc->name); |
| 1035 | 1034 | ||
| 1036 | len += seq_printf(m, "Cujo 2.0 bug : %s\n", | 1035 | seq_printf(m, "Cujo 2.0 bug : %s\n", |
| 1037 | (ioc->cujo20_bug ? "yes" : "no")); | 1036 | (ioc->cujo20_bug ? "yes" : "no")); |
| 1038 | 1037 | ||
| 1039 | len += seq_printf(m, "IO PDIR size : %d bytes (%d entries)\n", | 1038 | seq_printf(m, "IO PDIR size : %d bytes (%d entries)\n", |
| 1040 | total_pages * 8, total_pages); | 1039 | total_pages * 8, total_pages); |
| 1041 | 1040 | ||
| 1042 | #ifdef CCIO_COLLECT_STATS | 1041 | #ifdef CCIO_COLLECT_STATS |
| 1043 | len += seq_printf(m, "IO PDIR entries : %ld free %ld used (%d%%)\n", | 1042 | seq_printf(m, "IO PDIR entries : %ld free %ld used (%d%%)\n", |
| 1044 | total_pages - ioc->used_pages, ioc->used_pages, | 1043 | total_pages - ioc->used_pages, ioc->used_pages, |
| 1045 | (int)(ioc->used_pages * 100 / total_pages)); | 1044 | (int)(ioc->used_pages * 100 / total_pages)); |
| 1046 | #endif | 1045 | #endif |
| 1047 | 1046 | ||
| 1048 | len += seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n", | 1047 | seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n", |
| 1049 | ioc->res_size, total_pages); | 1048 | ioc->res_size, total_pages); |
| 1050 | 1049 | ||
| 1051 | #ifdef CCIO_COLLECT_STATS | 1050 | #ifdef CCIO_COLLECT_STATS |
| 1052 | min = max = ioc->avg_search[0]; | 1051 | min = max = ioc->avg_search[0]; |
| @@ -1058,26 +1057,26 @@ static int ccio_proc_info(struct seq_file *m, void *p) | |||
| 1058 | min = ioc->avg_search[j]; | 1057 | min = ioc->avg_search[j]; |
| 1059 | } | 1058 | } |
| 1060 | avg /= CCIO_SEARCH_SAMPLE; | 1059 | avg /= CCIO_SEARCH_SAMPLE; |
| 1061 | len += seq_printf(m, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n", | 1060 | seq_printf(m, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n", |
| 1062 | min, avg, max); | 1061 | min, avg, max); |
| 1063 | 1062 | ||
| 1064 | len += seq_printf(m, "pci_map_single(): %8ld calls %8ld pages (avg %d/1000)\n", | 1063 | seq_printf(m, "pci_map_single(): %8ld calls %8ld pages (avg %d/1000)\n", |
| 1065 | ioc->msingle_calls, ioc->msingle_pages, | 1064 | ioc->msingle_calls, ioc->msingle_pages, |
| 1066 | (int)((ioc->msingle_pages * 1000)/ioc->msingle_calls)); | 1065 | (int)((ioc->msingle_pages * 1000)/ioc->msingle_calls)); |
| 1067 | 1066 | ||
| 1068 | /* KLUGE - unmap_sg calls unmap_single for each mapped page */ | 1067 | /* KLUGE - unmap_sg calls unmap_single for each mapped page */ |
| 1069 | min = ioc->usingle_calls - ioc->usg_calls; | 1068 | min = ioc->usingle_calls - ioc->usg_calls; |
| 1070 | max = ioc->usingle_pages - ioc->usg_pages; | 1069 | max = ioc->usingle_pages - ioc->usg_pages; |
| 1071 | len += seq_printf(m, "pci_unmap_single: %8ld calls %8ld pages (avg %d/1000)\n", | 1070 | seq_printf(m, "pci_unmap_single: %8ld calls %8ld pages (avg %d/1000)\n", |
| 1072 | min, max, (int)((max * 1000)/min)); | 1071 | min, max, (int)((max * 1000)/min)); |
| 1073 | 1072 | ||
| 1074 | len += seq_printf(m, "pci_map_sg() : %8ld calls %8ld pages (avg %d/1000)\n", | 1073 | seq_printf(m, "pci_map_sg() : %8ld calls %8ld pages (avg %d/1000)\n", |
| 1075 | ioc->msg_calls, ioc->msg_pages, | 1074 | ioc->msg_calls, ioc->msg_pages, |
| 1076 | (int)((ioc->msg_pages * 1000)/ioc->msg_calls)); | 1075 | (int)((ioc->msg_pages * 1000)/ioc->msg_calls)); |
| 1077 | 1076 | ||
| 1078 | len += seq_printf(m, "pci_unmap_sg() : %8ld calls %8ld pages (avg %d/1000)\n\n\n", | 1077 | seq_printf(m, "pci_unmap_sg() : %8ld calls %8ld pages (avg %d/1000)\n\n\n", |
| 1079 | ioc->usg_calls, ioc->usg_pages, | 1078 | ioc->usg_calls, ioc->usg_pages, |
| 1080 | (int)((ioc->usg_pages * 1000)/ioc->usg_calls)); | 1079 | (int)((ioc->usg_pages * 1000)/ioc->usg_calls)); |
| 1081 | #endif /* CCIO_COLLECT_STATS */ | 1080 | #endif /* CCIO_COLLECT_STATS */ |
| 1082 | 1081 | ||
| 1083 | ioc = ioc->next; | 1082 | ioc = ioc->next; |
| @@ -1101,7 +1100,6 @@ static const struct file_operations ccio_proc_info_fops = { | |||
| 1101 | 1100 | ||
| 1102 | static int ccio_proc_bitmap_info(struct seq_file *m, void *p) | 1101 | static int ccio_proc_bitmap_info(struct seq_file *m, void *p) |
| 1103 | { | 1102 | { |
| 1104 | int len = 0; | ||
| 1105 | struct ioc *ioc = ioc_list; | 1103 | struct ioc *ioc = ioc_list; |
| 1106 | 1104 | ||
| 1107 | while (ioc != NULL) { | 1105 | while (ioc != NULL) { |
| @@ -1110,11 +1108,11 @@ static int ccio_proc_bitmap_info(struct seq_file *m, void *p) | |||
| 1110 | 1108 | ||
| 1111 | for (j = 0; j < (ioc->res_size / sizeof(u32)); j++) { | 1109 | for (j = 0; j < (ioc->res_size / sizeof(u32)); j++) { |
| 1112 | if ((j & 7) == 0) | 1110 | if ((j & 7) == 0) |
| 1113 | len += seq_puts(m, "\n "); | 1111 | seq_puts(m, "\n "); |
| 1114 | len += seq_printf(m, "%08x", *res_ptr); | 1112 | seq_printf(m, "%08x", *res_ptr); |
| 1115 | res_ptr++; | 1113 | res_ptr++; |
| 1116 | } | 1114 | } |
| 1117 | len += seq_puts(m, "\n\n"); | 1115 | seq_puts(m, "\n\n"); |
| 1118 | ioc = ioc->next; | 1116 | ioc = ioc->next; |
| 1119 | break; /* XXX - remove me */ | 1117 | break; /* XXX - remove me */ |
| 1120 | } | 1118 | } |
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index 1ff1b67e8b27..f07471264689 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c | |||
| @@ -1774,37 +1774,35 @@ static int sba_proc_info(struct seq_file *m, void *p) | |||
| 1774 | #ifdef SBA_COLLECT_STATS | 1774 | #ifdef SBA_COLLECT_STATS |
| 1775 | unsigned long avg = 0, min, max; | 1775 | unsigned long avg = 0, min, max; |
| 1776 | #endif | 1776 | #endif |
| 1777 | int i, len = 0; | 1777 | int i; |
| 1778 | 1778 | ||
| 1779 | len += seq_printf(m, "%s rev %d.%d\n", | 1779 | seq_printf(m, "%s rev %d.%d\n", |
| 1780 | sba_dev->name, | 1780 | sba_dev->name, |
| 1781 | (sba_dev->hw_rev & 0x7) + 1, | 1781 | (sba_dev->hw_rev & 0x7) + 1, |
| 1782 | (sba_dev->hw_rev & 0x18) >> 3 | 1782 | (sba_dev->hw_rev & 0x18) >> 3); |
| 1783 | ); | 1783 | seq_printf(m, "IO PDIR size : %d bytes (%d entries)\n", |
| 1784 | len += seq_printf(m, "IO PDIR size : %d bytes (%d entries)\n", | 1784 | (int)((ioc->res_size << 3) * sizeof(u64)), /* 8 bits/byte */ |
| 1785 | (int) ((ioc->res_size << 3) * sizeof(u64)), /* 8 bits/byte */ | 1785 | total_pages); |
| 1786 | total_pages); | 1786 | |
| 1787 | 1787 | seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n", | |
| 1788 | len += seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n", | 1788 | ioc->res_size, ioc->res_size << 3); /* 8 bits per byte */ |
| 1789 | ioc->res_size, ioc->res_size << 3); /* 8 bits per byte */ | 1789 | |
| 1790 | 1790 | seq_printf(m, "LMMIO_BASE/MASK/ROUTE %08x %08x %08x\n", | |
| 1791 | len += seq_printf(m, "LMMIO_BASE/MASK/ROUTE %08x %08x %08x\n", | 1791 | READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_BASE), |
| 1792 | READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_BASE), | 1792 | READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_MASK), |
| 1793 | READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_MASK), | 1793 | READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_ROUTE)); |
| 1794 | READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_ROUTE) | ||
| 1795 | ); | ||
| 1796 | 1794 | ||
| 1797 | for (i=0; i<4; i++) | 1795 | for (i=0; i<4; i++) |
| 1798 | len += seq_printf(m, "DIR%d_BASE/MASK/ROUTE %08x %08x %08x\n", i, | 1796 | seq_printf(m, "DIR%d_BASE/MASK/ROUTE %08x %08x %08x\n", |
| 1799 | READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_BASE + i*0x18), | 1797 | i, |
| 1800 | READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_MASK + i*0x18), | 1798 | READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_BASE + i*0x18), |
| 1801 | READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_ROUTE + i*0x18) | 1799 | READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_MASK + i*0x18), |
| 1802 | ); | 1800 | READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_ROUTE + i*0x18)); |
| 1803 | 1801 | ||
| 1804 | #ifdef SBA_COLLECT_STATS | 1802 | #ifdef SBA_COLLECT_STATS |
| 1805 | len += seq_printf(m, "IO PDIR entries : %ld free %ld used (%d%%)\n", | 1803 | seq_printf(m, "IO PDIR entries : %ld free %ld used (%d%%)\n", |
| 1806 | total_pages - ioc->used_pages, ioc->used_pages, | 1804 | total_pages - ioc->used_pages, ioc->used_pages, |
| 1807 | (int) (ioc->used_pages * 100 / total_pages)); | 1805 | (int)(ioc->used_pages * 100 / total_pages)); |
| 1808 | 1806 | ||
| 1809 | min = max = ioc->avg_search[0]; | 1807 | min = max = ioc->avg_search[0]; |
| 1810 | for (i = 0; i < SBA_SEARCH_SAMPLE; i++) { | 1808 | for (i = 0; i < SBA_SEARCH_SAMPLE; i++) { |
| @@ -1813,26 +1811,26 @@ static int sba_proc_info(struct seq_file *m, void *p) | |||
| 1813 | if (ioc->avg_search[i] < min) min = ioc->avg_search[i]; | 1811 | if (ioc->avg_search[i] < min) min = ioc->avg_search[i]; |
| 1814 | } | 1812 | } |
| 1815 | avg /= SBA_SEARCH_SAMPLE; | 1813 | avg /= SBA_SEARCH_SAMPLE; |
| 1816 | len += seq_printf(m, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n", | 1814 | seq_printf(m, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n", |
| 1817 | min, avg, max); | 1815 | min, avg, max); |
| 1818 | 1816 | ||
| 1819 | len += seq_printf(m, "pci_map_single(): %12ld calls %12ld pages (avg %d/1000)\n", | 1817 | seq_printf(m, "pci_map_single(): %12ld calls %12ld pages (avg %d/1000)\n", |
| 1820 | ioc->msingle_calls, ioc->msingle_pages, | 1818 | ioc->msingle_calls, ioc->msingle_pages, |
| 1821 | (int) ((ioc->msingle_pages * 1000)/ioc->msingle_calls)); | 1819 | (int)((ioc->msingle_pages * 1000)/ioc->msingle_calls)); |
| 1822 | 1820 | ||
| 1823 | /* KLUGE - unmap_sg calls unmap_single for each mapped page */ | 1821 | /* KLUGE - unmap_sg calls unmap_single for each mapped page */ |
| 1824 | min = ioc->usingle_calls; | 1822 | min = ioc->usingle_calls; |
| 1825 | max = ioc->usingle_pages - ioc->usg_pages; | 1823 | max = ioc->usingle_pages - ioc->usg_pages; |
| 1826 | len += seq_printf(m, "pci_unmap_single: %12ld calls %12ld pages (avg %d/1000)\n", | 1824 | seq_printf(m, "pci_unmap_single: %12ld calls %12ld pages (avg %d/1000)\n", |
| 1827 | min, max, (int) ((max * 1000)/min)); | 1825 | min, max, (int)((max * 1000)/min)); |
| 1828 | 1826 | ||
| 1829 | len += seq_printf(m, "pci_map_sg() : %12ld calls %12ld pages (avg %d/1000)\n", | 1827 | seq_printf(m, "pci_map_sg() : %12ld calls %12ld pages (avg %d/1000)\n", |
| 1830 | ioc->msg_calls, ioc->msg_pages, | 1828 | ioc->msg_calls, ioc->msg_pages, |
| 1831 | (int) ((ioc->msg_pages * 1000)/ioc->msg_calls)); | 1829 | (int)((ioc->msg_pages * 1000)/ioc->msg_calls)); |
| 1832 | 1830 | ||
| 1833 | len += seq_printf(m, "pci_unmap_sg() : %12ld calls %12ld pages (avg %d/1000)\n", | 1831 | seq_printf(m, "pci_unmap_sg() : %12ld calls %12ld pages (avg %d/1000)\n", |
| 1834 | ioc->usg_calls, ioc->usg_pages, | 1832 | ioc->usg_calls, ioc->usg_pages, |
| 1835 | (int) ((ioc->usg_pages * 1000)/ioc->usg_calls)); | 1833 | (int)((ioc->usg_pages * 1000)/ioc->usg_calls)); |
| 1836 | #endif | 1834 | #endif |
| 1837 | 1835 | ||
| 1838 | return 0; | 1836 | return 0; |
| @@ -1858,14 +1856,14 @@ sba_proc_bitmap_info(struct seq_file *m, void *p) | |||
| 1858 | struct sba_device *sba_dev = sba_list; | 1856 | struct sba_device *sba_dev = sba_list; |
| 1859 | struct ioc *ioc = &sba_dev->ioc[0]; /* FIXME: Multi-IOC support! */ | 1857 | struct ioc *ioc = &sba_dev->ioc[0]; /* FIXME: Multi-IOC support! */ |
| 1860 | unsigned int *res_ptr = (unsigned int *)ioc->res_map; | 1858 | unsigned int *res_ptr = (unsigned int *)ioc->res_map; |
| 1861 | int i, len = 0; | 1859 | int i; |
| 1862 | 1860 | ||
| 1863 | for (i = 0; i < (ioc->res_size/sizeof(unsigned int)); ++i, ++res_ptr) { | 1861 | for (i = 0; i < (ioc->res_size/sizeof(unsigned int)); ++i, ++res_ptr) { |
| 1864 | if ((i & 7) == 0) | 1862 | if ((i & 7) == 0) |
| 1865 | len += seq_printf(m, "\n "); | 1863 | seq_puts(m, "\n "); |
| 1866 | len += seq_printf(m, " %08x", *res_ptr); | 1864 | seq_printf(m, " %08x", *res_ptr); |
| 1867 | } | 1865 | } |
| 1868 | len += seq_printf(m, "\n"); | 1866 | seq_putc(m, '\n'); |
| 1869 | 1867 | ||
| 1870 | return 0; | 1868 | return 0; |
| 1871 | } | 1869 | } |
