Skip to content

Commit e693d73

Browse files
JoePerchestorvalds
authored andcommitted
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 1f33c41 ("seq_file: Rename seq_overflow() to seq_has_overflowed() and make public") Signed-off-by: Joe Perches <[email protected]> Cc: "James E.J. Bottomley" <[email protected]> Cc: Helge Deller <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent d50f8f8 commit e693d73

File tree

2 files changed

+68
-72
lines changed

2 files changed

+68
-72
lines changed

drivers/parisc/ccio-dma.c

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,6 @@ static struct hppa_dma_ops ccio_ops = {
10211021
#ifdef CONFIG_PROC_FS
10221022
static int ccio_proc_info(struct seq_file *m, void *p)
10231023
{
1024-
int len = 0;
10251024
struct ioc *ioc = ioc_list;
10261025

10271026
while (ioc != NULL) {
@@ -1031,22 +1030,22 @@ static int ccio_proc_info(struct seq_file *m, void *p)
10311030
int j;
10321031
#endif
10331032

1034-
len += seq_printf(m, "%s\n", ioc->name);
1033+
seq_printf(m, "%s\n", ioc->name);
10351034

1036-
len += seq_printf(m, "Cujo 2.0 bug : %s\n",
1037-
(ioc->cujo20_bug ? "yes" : "no"));
1035+
seq_printf(m, "Cujo 2.0 bug : %s\n",
1036+
(ioc->cujo20_bug ? "yes" : "no"));
10381037

1039-
len += seq_printf(m, "IO PDIR size : %d bytes (%d entries)\n",
1040-
total_pages * 8, total_pages);
1038+
seq_printf(m, "IO PDIR size : %d bytes (%d entries)\n",
1039+
total_pages * 8, total_pages);
10411040

10421041
#ifdef CCIO_COLLECT_STATS
1043-
len += seq_printf(m, "IO PDIR entries : %ld free %ld used (%d%%)\n",
1044-
total_pages - ioc->used_pages, ioc->used_pages,
1045-
(int)(ioc->used_pages * 100 / total_pages));
1042+
seq_printf(m, "IO PDIR entries : %ld free %ld used (%d%%)\n",
1043+
total_pages - ioc->used_pages, ioc->used_pages,
1044+
(int)(ioc->used_pages * 100 / total_pages));
10461045
#endif
10471046

1048-
len += seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n",
1049-
ioc->res_size, total_pages);
1047+
seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n",
1048+
ioc->res_size, total_pages);
10501049

10511050
#ifdef CCIO_COLLECT_STATS
10521051
min = max = ioc->avg_search[0];
@@ -1058,26 +1057,26 @@ static int ccio_proc_info(struct seq_file *m, void *p)
10581057
min = ioc->avg_search[j];
10591058
}
10601059
avg /= CCIO_SEARCH_SAMPLE;
1061-
len += seq_printf(m, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n",
1062-
min, avg, max);
1060+
seq_printf(m, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n",
1061+
min, avg, max);
10631062

1064-
len += seq_printf(m, "pci_map_single(): %8ld calls %8ld pages (avg %d/1000)\n",
1065-
ioc->msingle_calls, ioc->msingle_pages,
1066-
(int)((ioc->msingle_pages * 1000)/ioc->msingle_calls));
1063+
seq_printf(m, "pci_map_single(): %8ld calls %8ld pages (avg %d/1000)\n",
1064+
ioc->msingle_calls, ioc->msingle_pages,
1065+
(int)((ioc->msingle_pages * 1000)/ioc->msingle_calls));
10671066

10681067
/* KLUGE - unmap_sg calls unmap_single for each mapped page */
10691068
min = ioc->usingle_calls - ioc->usg_calls;
10701069
max = ioc->usingle_pages - ioc->usg_pages;
1071-
len += seq_printf(m, "pci_unmap_single: %8ld calls %8ld pages (avg %d/1000)\n",
1072-
min, max, (int)((max * 1000)/min));
1070+
seq_printf(m, "pci_unmap_single: %8ld calls %8ld pages (avg %d/1000)\n",
1071+
min, max, (int)((max * 1000)/min));
10731072

1074-
len += seq_printf(m, "pci_map_sg() : %8ld calls %8ld pages (avg %d/1000)\n",
1075-
ioc->msg_calls, ioc->msg_pages,
1076-
(int)((ioc->msg_pages * 1000)/ioc->msg_calls));
1073+
seq_printf(m, "pci_map_sg() : %8ld calls %8ld pages (avg %d/1000)\n",
1074+
ioc->msg_calls, ioc->msg_pages,
1075+
(int)((ioc->msg_pages * 1000)/ioc->msg_calls));
10771076

1078-
len += seq_printf(m, "pci_unmap_sg() : %8ld calls %8ld pages (avg %d/1000)\n\n\n",
1079-
ioc->usg_calls, ioc->usg_pages,
1080-
(int)((ioc->usg_pages * 1000)/ioc->usg_calls));
1077+
seq_printf(m, "pci_unmap_sg() : %8ld calls %8ld pages (avg %d/1000)\n\n\n",
1078+
ioc->usg_calls, ioc->usg_pages,
1079+
(int)((ioc->usg_pages * 1000)/ioc->usg_calls));
10811080
#endif /* CCIO_COLLECT_STATS */
10821081

10831082
ioc = ioc->next;
@@ -1101,7 +1100,6 @@ static const struct file_operations ccio_proc_info_fops = {
11011100

11021101
static int ccio_proc_bitmap_info(struct seq_file *m, void *p)
11031102
{
1104-
int len = 0;
11051103
struct ioc *ioc = ioc_list;
11061104

11071105
while (ioc != NULL) {
@@ -1110,11 +1108,11 @@ static int ccio_proc_bitmap_info(struct seq_file *m, void *p)
11101108

11111109
for (j = 0; j < (ioc->res_size / sizeof(u32)); j++) {
11121110
if ((j & 7) == 0)
1113-
len += seq_puts(m, "\n ");
1114-
len += seq_printf(m, "%08x", *res_ptr);
1111+
seq_puts(m, "\n ");
1112+
seq_printf(m, "%08x", *res_ptr);
11151113
res_ptr++;
11161114
}
1117-
len += seq_puts(m, "\n\n");
1115+
seq_puts(m, "\n\n");
11181116
ioc = ioc->next;
11191117
break; /* XXX - remove me */
11201118
}

drivers/parisc/sba_iommu.c

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,37 +1774,35 @@ static int sba_proc_info(struct seq_file *m, void *p)
17741774
#ifdef SBA_COLLECT_STATS
17751775
unsigned long avg = 0, min, max;
17761776
#endif
1777-
int i, len = 0;
1778-
1779-
len += seq_printf(m, "%s rev %d.%d\n",
1780-
sba_dev->name,
1781-
(sba_dev->hw_rev & 0x7) + 1,
1782-
(sba_dev->hw_rev & 0x18) >> 3
1783-
);
1784-
len += seq_printf(m, "IO PDIR size : %d bytes (%d entries)\n",
1785-
(int) ((ioc->res_size << 3) * sizeof(u64)), /* 8 bits/byte */
1786-
total_pages);
1787-
1788-
len += seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n",
1789-
ioc->res_size, ioc->res_size << 3); /* 8 bits per byte */
1790-
1791-
len += seq_printf(m, "LMMIO_BASE/MASK/ROUTE %08x %08x %08x\n",
1792-
READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_BASE),
1793-
READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_MASK),
1794-
READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_ROUTE)
1795-
);
1777+
int i;
1778+
1779+
seq_printf(m, "%s rev %d.%d\n",
1780+
sba_dev->name,
1781+
(sba_dev->hw_rev & 0x7) + 1,
1782+
(sba_dev->hw_rev & 0x18) >> 3);
1783+
seq_printf(m, "IO PDIR size : %d bytes (%d entries)\n",
1784+
(int)((ioc->res_size << 3) * sizeof(u64)), /* 8 bits/byte */
1785+
total_pages);
1786+
1787+
seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n",
1788+
ioc->res_size, ioc->res_size << 3); /* 8 bits per byte */
1789+
1790+
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_MASK),
1793+
READ_REG32(sba_dev->sba_hpa + LMMIO_DIST_ROUTE));
17961794

17971795
for (i=0; i<4; i++)
1798-
len += seq_printf(m, "DIR%d_BASE/MASK/ROUTE %08x %08x %08x\n", i,
1799-
READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_BASE + i*0x18),
1800-
READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_MASK + i*0x18),
1801-
READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_ROUTE + i*0x18)
1802-
);
1796+
seq_printf(m, "DIR%d_BASE/MASK/ROUTE %08x %08x %08x\n",
1797+
i,
1798+
READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_BASE + i*0x18),
1799+
READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_MASK + i*0x18),
1800+
READ_REG32(sba_dev->sba_hpa + LMMIO_DIRECT0_ROUTE + i*0x18));
18031801

18041802
#ifdef SBA_COLLECT_STATS
1805-
len += seq_printf(m, "IO PDIR entries : %ld free %ld used (%d%%)\n",
1806-
total_pages - ioc->used_pages, ioc->used_pages,
1807-
(int) (ioc->used_pages * 100 / total_pages));
1803+
seq_printf(m, "IO PDIR entries : %ld free %ld used (%d%%)\n",
1804+
total_pages - ioc->used_pages, ioc->used_pages,
1805+
(int)(ioc->used_pages * 100 / total_pages));
18081806

18091807
min = max = ioc->avg_search[0];
18101808
for (i = 0; i < SBA_SEARCH_SAMPLE; i++) {
@@ -1813,26 +1811,26 @@ static int sba_proc_info(struct seq_file *m, void *p)
18131811
if (ioc->avg_search[i] < min) min = ioc->avg_search[i];
18141812
}
18151813
avg /= SBA_SEARCH_SAMPLE;
1816-
len += seq_printf(m, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n",
1817-
min, avg, max);
1814+
seq_printf(m, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n",
1815+
min, avg, max);
18181816

1819-
len += seq_printf(m, "pci_map_single(): %12ld calls %12ld pages (avg %d/1000)\n",
1820-
ioc->msingle_calls, ioc->msingle_pages,
1821-
(int) ((ioc->msingle_pages * 1000)/ioc->msingle_calls));
1817+
seq_printf(m, "pci_map_single(): %12ld calls %12ld pages (avg %d/1000)\n",
1818+
ioc->msingle_calls, ioc->msingle_pages,
1819+
(int)((ioc->msingle_pages * 1000)/ioc->msingle_calls));
18221820

18231821
/* KLUGE - unmap_sg calls unmap_single for each mapped page */
18241822
min = ioc->usingle_calls;
18251823
max = ioc->usingle_pages - ioc->usg_pages;
1826-
len += seq_printf(m, "pci_unmap_single: %12ld calls %12ld pages (avg %d/1000)\n",
1827-
min, max, (int) ((max * 1000)/min));
1824+
seq_printf(m, "pci_unmap_single: %12ld calls %12ld pages (avg %d/1000)\n",
1825+
min, max, (int)((max * 1000)/min));
18281826

1829-
len += seq_printf(m, "pci_map_sg() : %12ld calls %12ld pages (avg %d/1000)\n",
1830-
ioc->msg_calls, ioc->msg_pages,
1831-
(int) ((ioc->msg_pages * 1000)/ioc->msg_calls));
1827+
seq_printf(m, "pci_map_sg() : %12ld calls %12ld pages (avg %d/1000)\n",
1828+
ioc->msg_calls, ioc->msg_pages,
1829+
(int)((ioc->msg_pages * 1000)/ioc->msg_calls));
18321830

1833-
len += seq_printf(m, "pci_unmap_sg() : %12ld calls %12ld pages (avg %d/1000)\n",
1834-
ioc->usg_calls, ioc->usg_pages,
1835-
(int) ((ioc->usg_pages * 1000)/ioc->usg_calls));
1831+
seq_printf(m, "pci_unmap_sg() : %12ld calls %12ld pages (avg %d/1000)\n",
1832+
ioc->usg_calls, ioc->usg_pages,
1833+
(int)((ioc->usg_pages * 1000)/ioc->usg_calls));
18361834
#endif
18371835

18381836
return 0;
@@ -1858,14 +1856,14 @@ sba_proc_bitmap_info(struct seq_file *m, void *p)
18581856
struct sba_device *sba_dev = sba_list;
18591857
struct ioc *ioc = &sba_dev->ioc[0]; /* FIXME: Multi-IOC support! */
18601858
unsigned int *res_ptr = (unsigned int *)ioc->res_map;
1861-
int i, len = 0;
1859+
int i;
18621860

18631861
for (i = 0; i < (ioc->res_size/sizeof(unsigned int)); ++i, ++res_ptr) {
18641862
if ((i & 7) == 0)
1865-
len += seq_printf(m, "\n ");
1866-
len += seq_printf(m, " %08x", *res_ptr);
1863+
seq_puts(m, "\n ");
1864+
seq_printf(m, " %08x", *res_ptr);
18671865
}
1868-
len += seq_printf(m, "\n");
1866+
seq_putc(m, '\n');
18691867

18701868
return 0;
18711869
}

0 commit comments

Comments
 (0)