aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-pxa
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2015-04-15 19:18:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 19:35:25 -0400
commitcd2b2937c6ae7f8d562d7e08e06da70e778d0323 (patch)
treeb69eadf52eaebbd2f733019afd18cd2516423203 /arch/arm/plat-pxa
parent4122669e5266a2af8a84a499cf7821786ed7d2cf (diff)
ARM: plat-pxa: remove use of seq_printf return value
The seq_printf return value, because it's frequently misused, (as it is here, it doesn't return # of chars emitted) 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: Russell King <linux@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/arm/plat-pxa')
-rw-r--r--arch/arm/plat-pxa/dma.c111
1 files changed, 53 insertions, 58 deletions
diff --git a/arch/arm/plat-pxa/dma.c b/arch/arm/plat-pxa/dma.c
index 054fc5a1a11c..d92f07f6ecfb 100644
--- a/arch/arm/plat-pxa/dma.c
+++ b/arch/arm/plat-pxa/dma.c
@@ -51,19 +51,19 @@ static struct dentry *dbgfs_root, *dbgfs_state, **dbgfs_chan;
51 51
52static int dbg_show_requester_chan(struct seq_file *s, void *p) 52static int dbg_show_requester_chan(struct seq_file *s, void *p)
53{ 53{
54 int pos = 0;
55 int chan = (int)s->private; 54 int chan = (int)s->private;
56 int i; 55 int i;
57 u32 drcmr; 56 u32 drcmr;
58 57
59 pos += seq_printf(s, "DMA channel %d requesters list :\n", chan); 58 seq_printf(s, "DMA channel %d requesters list :\n", chan);
60 for (i = 0; i < DMA_MAX_REQUESTERS; i++) { 59 for (i = 0; i < DMA_MAX_REQUESTERS; i++) {
61 drcmr = DRCMR(i); 60 drcmr = DRCMR(i);
62 if ((drcmr & DRCMR_CHLNUM) == chan) 61 if ((drcmr & DRCMR_CHLNUM) == chan)
63 pos += seq_printf(s, "\tRequester %d (MAPVLD=%d)\n", i, 62 seq_printf(s, "\tRequester %d (MAPVLD=%d)\n",
64 !!(drcmr & DRCMR_MAPVLD)); 63 i, !!(drcmr & DRCMR_MAPVLD));
65 } 64 }
66 return pos; 65
66 return 0;
67} 67}
68 68
69static inline int dbg_burst_from_dcmd(u32 dcmd) 69static inline int dbg_burst_from_dcmd(u32 dcmd)
@@ -83,7 +83,6 @@ static int is_phys_valid(unsigned long addr)
83 83
84static int dbg_show_descriptors(struct seq_file *s, void *p) 84static int dbg_show_descriptors(struct seq_file *s, void *p)
85{ 85{
86 int pos = 0;
87 int chan = (int)s->private; 86 int chan = (int)s->private;
88 int i, max_show = 20, burst, width; 87 int i, max_show = 20, burst, width;
89 u32 dcmd; 88 u32 dcmd;
@@ -94,44 +93,43 @@ static int dbg_show_descriptors(struct seq_file *s, void *p)
94 spin_lock_irqsave(&dma_channels[chan].lock, flags); 93 spin_lock_irqsave(&dma_channels[chan].lock, flags);
95 phys_desc = DDADR(chan); 94 phys_desc = DDADR(chan);
96 95
97 pos += seq_printf(s, "DMA channel %d descriptors :\n", chan); 96 seq_printf(s, "DMA channel %d descriptors :\n", chan);
98 pos += seq_printf(s, "[%03d] First descriptor unknown\n", 0); 97 seq_printf(s, "[%03d] First descriptor unknown\n", 0);
99 for (i = 1; i < max_show && is_phys_valid(phys_desc); i++) { 98 for (i = 1; i < max_show && is_phys_valid(phys_desc); i++) {
100 desc = phys_to_virt(phys_desc); 99 desc = phys_to_virt(phys_desc);
101 dcmd = desc->dcmd; 100 dcmd = desc->dcmd;
102 burst = dbg_burst_from_dcmd(dcmd); 101 burst = dbg_burst_from_dcmd(dcmd);
103 width = (1 << ((dcmd >> 14) & 0x3)) >> 1; 102 width = (1 << ((dcmd >> 14) & 0x3)) >> 1;
104 103
105 pos += seq_printf(s, "[%03d] Desc at %08lx(virt %p)\n", 104 seq_printf(s, "[%03d] Desc at %08lx(virt %p)\n",
106 i, phys_desc, desc); 105 i, phys_desc, desc);
107 pos += seq_printf(s, "\tDDADR = %08x\n", desc->ddadr); 106 seq_printf(s, "\tDDADR = %08x\n", desc->ddadr);
108 pos += seq_printf(s, "\tDSADR = %08x\n", desc->dsadr); 107 seq_printf(s, "\tDSADR = %08x\n", desc->dsadr);
109 pos += seq_printf(s, "\tDTADR = %08x\n", desc->dtadr); 108 seq_printf(s, "\tDTADR = %08x\n", desc->dtadr);
110 pos += seq_printf(s, "\tDCMD = %08x (%s%s%s%s%s%s%sburst=%d" 109 seq_printf(s, "\tDCMD = %08x (%s%s%s%s%s%s%sburst=%d width=%d len=%d)\n",
111 " width=%d len=%d)\n", 110 dcmd,
112 dcmd, 111 DCMD_STR(INCSRCADDR), DCMD_STR(INCTRGADDR),
113 DCMD_STR(INCSRCADDR), DCMD_STR(INCTRGADDR), 112 DCMD_STR(FLOWSRC), DCMD_STR(FLOWTRG),
114 DCMD_STR(FLOWSRC), DCMD_STR(FLOWTRG), 113 DCMD_STR(STARTIRQEN), DCMD_STR(ENDIRQEN),
115 DCMD_STR(STARTIRQEN), DCMD_STR(ENDIRQEN), 114 DCMD_STR(ENDIAN), burst, width,
116 DCMD_STR(ENDIAN), burst, width, 115 dcmd & DCMD_LENGTH);
117 dcmd & DCMD_LENGTH);
118 phys_desc = desc->ddadr; 116 phys_desc = desc->ddadr;
119 } 117 }
120 if (i == max_show) 118 if (i == max_show)
121 pos += seq_printf(s, "[%03d] Desc at %08lx ... max display reached\n", 119 seq_printf(s, "[%03d] Desc at %08lx ... max display reached\n",
122 i, phys_desc); 120 i, phys_desc);
123 else 121 else
124 pos += seq_printf(s, "[%03d] Desc at %08lx is %s\n", 122 seq_printf(s, "[%03d] Desc at %08lx is %s\n",
125 i, phys_desc, phys_desc == DDADR_STOP ? 123 i, phys_desc, phys_desc == DDADR_STOP ?
126 "DDADR_STOP" : "invalid"); 124 "DDADR_STOP" : "invalid");
127 125
128 spin_unlock_irqrestore(&dma_channels[chan].lock, flags); 126 spin_unlock_irqrestore(&dma_channels[chan].lock, flags);
129 return pos; 127
128 return 0;
130} 129}
131 130
132static int dbg_show_chan_state(struct seq_file *s, void *p) 131static int dbg_show_chan_state(struct seq_file *s, void *p)
133{ 132{
134 int pos = 0;
135 int chan = (int)s->private; 133 int chan = (int)s->private;
136 u32 dcsr, dcmd; 134 u32 dcsr, dcmd;
137 int burst, width; 135 int burst, width;
@@ -142,42 +140,39 @@ static int dbg_show_chan_state(struct seq_file *s, void *p)
142 burst = dbg_burst_from_dcmd(dcmd); 140 burst = dbg_burst_from_dcmd(dcmd);
143 width = (1 << ((dcmd >> 14) & 0x3)) >> 1; 141 width = (1 << ((dcmd >> 14) & 0x3)) >> 1;
144 142
145 pos += seq_printf(s, "DMA channel %d\n", chan); 143 seq_printf(s, "DMA channel %d\n", chan);
146 pos += seq_printf(s, "\tPriority : %s\n", 144 seq_printf(s, "\tPriority : %s\n", str_prio[dma_channels[chan].prio]);
147 str_prio[dma_channels[chan].prio]); 145 seq_printf(s, "\tUnaligned transfer bit: %s\n",
148 pos += seq_printf(s, "\tUnaligned transfer bit: %s\n", 146 DALGN & (1 << chan) ? "yes" : "no");
149 DALGN & (1 << chan) ? "yes" : "no"); 147 seq_printf(s, "\tDCSR = %08x (%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s)\n",
150 pos += seq_printf(s, "\tDCSR = %08x (%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s)\n", 148 dcsr, DCSR_STR(RUN), DCSR_STR(NODESC),
151 dcsr, DCSR_STR(RUN), DCSR_STR(NODESC), 149 DCSR_STR(STOPIRQEN), DCSR_STR(EORIRQEN),
152 DCSR_STR(STOPIRQEN), DCSR_STR(EORIRQEN), 150 DCSR_STR(EORJMPEN), DCSR_STR(EORSTOPEN),
153 DCSR_STR(EORJMPEN), DCSR_STR(EORSTOPEN), 151 DCSR_STR(SETCMPST), DCSR_STR(CLRCMPST),
154 DCSR_STR(SETCMPST), DCSR_STR(CLRCMPST), 152 DCSR_STR(CMPST), DCSR_STR(EORINTR), DCSR_STR(REQPEND),
155 DCSR_STR(CMPST), DCSR_STR(EORINTR), DCSR_STR(REQPEND), 153 DCSR_STR(STOPSTATE), DCSR_STR(ENDINTR),
156 DCSR_STR(STOPSTATE), DCSR_STR(ENDINTR), 154 DCSR_STR(STARTINTR), DCSR_STR(BUSERR));
157 DCSR_STR(STARTINTR), DCSR_STR(BUSERR)); 155
158 156 seq_printf(s, "\tDCMD = %08x (%s%s%s%s%s%s%sburst=%d width=%d len=%d)\n",
159 pos += seq_printf(s, "\tDCMD = %08x (%s%s%s%s%s%s%sburst=%d width=%d" 157 dcmd,
160 " len=%d)\n", 158 DCMD_STR(INCSRCADDR), DCMD_STR(INCTRGADDR),
161 dcmd, 159 DCMD_STR(FLOWSRC), DCMD_STR(FLOWTRG),
162 DCMD_STR(INCSRCADDR), DCMD_STR(INCTRGADDR), 160 DCMD_STR(STARTIRQEN), DCMD_STR(ENDIRQEN),
163 DCMD_STR(FLOWSRC), DCMD_STR(FLOWTRG), 161 DCMD_STR(ENDIAN), burst, width, dcmd & DCMD_LENGTH);
164 DCMD_STR(STARTIRQEN), DCMD_STR(ENDIRQEN), 162 seq_printf(s, "\tDSADR = %08x\n", DSADR(chan));
165 DCMD_STR(ENDIAN), burst, width, dcmd & DCMD_LENGTH); 163 seq_printf(s, "\tDTADR = %08x\n", DTADR(chan));
166 pos += seq_printf(s, "\tDSADR = %08x\n", DSADR(chan)); 164 seq_printf(s, "\tDDADR = %08x\n", DDADR(chan));
167 pos += seq_printf(s, "\tDTADR = %08x\n", DTADR(chan)); 165
168 pos += seq_printf(s, "\tDDADR = %08x\n", DDADR(chan)); 166 return 0;
169 return pos;
170} 167}
171 168
172static int dbg_show_state(struct seq_file *s, void *p) 169static int dbg_show_state(struct seq_file *s, void *p)
173{ 170{
174 int pos = 0;
175
176 /* basic device status */ 171 /* basic device status */
177 pos += seq_printf(s, "DMA engine status\n"); 172 seq_puts(s, "DMA engine status\n");
178 pos += seq_printf(s, "\tChannel number: %d\n", num_dma_channels); 173 seq_printf(s, "\tChannel number: %d\n", num_dma_channels);
179 174
180 return pos; 175 return 0;
181} 176}
182 177
183#define DBGFS_FUNC_DECL(name) \ 178#define DBGFS_FUNC_DECL(name) \