Commit cd2b2937 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

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 1f33c41c ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4122669e
...@@ -51,19 +51,19 @@ static struct dentry *dbgfs_root, *dbgfs_state, **dbgfs_chan; ...@@ -51,19 +51,19 @@ static struct dentry *dbgfs_root, *dbgfs_state, **dbgfs_chan;
static int dbg_show_requester_chan(struct seq_file *s, void *p) static int dbg_show_requester_chan(struct seq_file *s, void *p)
{ {
int pos = 0;
int chan = (int)s->private; int chan = (int)s->private;
int i; int i;
u32 drcmr; u32 drcmr;
pos += seq_printf(s, "DMA channel %d requesters list :\n", chan); seq_printf(s, "DMA channel %d requesters list :\n", chan);
for (i = 0; i < DMA_MAX_REQUESTERS; i++) { for (i = 0; i < DMA_MAX_REQUESTERS; i++) {
drcmr = DRCMR(i); drcmr = DRCMR(i);
if ((drcmr & DRCMR_CHLNUM) == chan) if ((drcmr & DRCMR_CHLNUM) == chan)
pos += seq_printf(s, "\tRequester %d (MAPVLD=%d)\n", i, seq_printf(s, "\tRequester %d (MAPVLD=%d)\n",
!!(drcmr & DRCMR_MAPVLD)); i, !!(drcmr & DRCMR_MAPVLD));
} }
return pos;
return 0;
} }
static inline int dbg_burst_from_dcmd(u32 dcmd) static inline int dbg_burst_from_dcmd(u32 dcmd)
...@@ -83,7 +83,6 @@ static int is_phys_valid(unsigned long addr) ...@@ -83,7 +83,6 @@ static int is_phys_valid(unsigned long addr)
static int dbg_show_descriptors(struct seq_file *s, void *p) static int dbg_show_descriptors(struct seq_file *s, void *p)
{ {
int pos = 0;
int chan = (int)s->private; int chan = (int)s->private;
int i, max_show = 20, burst, width; int i, max_show = 20, burst, width;
u32 dcmd; u32 dcmd;
...@@ -94,21 +93,20 @@ static int dbg_show_descriptors(struct seq_file *s, void *p) ...@@ -94,21 +93,20 @@ static int dbg_show_descriptors(struct seq_file *s, void *p)
spin_lock_irqsave(&dma_channels[chan].lock, flags); spin_lock_irqsave(&dma_channels[chan].lock, flags);
phys_desc = DDADR(chan); phys_desc = DDADR(chan);
pos += seq_printf(s, "DMA channel %d descriptors :\n", chan); seq_printf(s, "DMA channel %d descriptors :\n", chan);
pos += seq_printf(s, "[%03d] First descriptor unknown\n", 0); seq_printf(s, "[%03d] First descriptor unknown\n", 0);
for (i = 1; i < max_show && is_phys_valid(phys_desc); i++) { for (i = 1; i < max_show && is_phys_valid(phys_desc); i++) {
desc = phys_to_virt(phys_desc); desc = phys_to_virt(phys_desc);
dcmd = desc->dcmd; dcmd = desc->dcmd;
burst = dbg_burst_from_dcmd(dcmd); burst = dbg_burst_from_dcmd(dcmd);
width = (1 << ((dcmd >> 14) & 0x3)) >> 1; width = (1 << ((dcmd >> 14) & 0x3)) >> 1;
pos += seq_printf(s, "[%03d] Desc at %08lx(virt %p)\n", seq_printf(s, "[%03d] Desc at %08lx(virt %p)\n",
i, phys_desc, desc); i, phys_desc, desc);
pos += seq_printf(s, "\tDDADR = %08x\n", desc->ddadr); seq_printf(s, "\tDDADR = %08x\n", desc->ddadr);
pos += seq_printf(s, "\tDSADR = %08x\n", desc->dsadr); seq_printf(s, "\tDSADR = %08x\n", desc->dsadr);
pos += seq_printf(s, "\tDTADR = %08x\n", desc->dtadr); seq_printf(s, "\tDTADR = %08x\n", desc->dtadr);
pos += seq_printf(s, "\tDCMD = %08x (%s%s%s%s%s%s%sburst=%d" seq_printf(s, "\tDCMD = %08x (%s%s%s%s%s%s%sburst=%d width=%d len=%d)\n",
" width=%d len=%d)\n",
dcmd, dcmd,
DCMD_STR(INCSRCADDR), DCMD_STR(INCTRGADDR), DCMD_STR(INCSRCADDR), DCMD_STR(INCTRGADDR),
DCMD_STR(FLOWSRC), DCMD_STR(FLOWTRG), DCMD_STR(FLOWSRC), DCMD_STR(FLOWTRG),
...@@ -118,20 +116,20 @@ static int dbg_show_descriptors(struct seq_file *s, void *p) ...@@ -118,20 +116,20 @@ static int dbg_show_descriptors(struct seq_file *s, void *p)
phys_desc = desc->ddadr; phys_desc = desc->ddadr;
} }
if (i == max_show) if (i == max_show)
pos += seq_printf(s, "[%03d] Desc at %08lx ... max display reached\n", seq_printf(s, "[%03d] Desc at %08lx ... max display reached\n",
i, phys_desc); i, phys_desc);
else else
pos += seq_printf(s, "[%03d] Desc at %08lx is %s\n", seq_printf(s, "[%03d] Desc at %08lx is %s\n",
i, phys_desc, phys_desc == DDADR_STOP ? i, phys_desc, phys_desc == DDADR_STOP ?
"DDADR_STOP" : "invalid"); "DDADR_STOP" : "invalid");
spin_unlock_irqrestore(&dma_channels[chan].lock, flags); spin_unlock_irqrestore(&dma_channels[chan].lock, flags);
return pos;
return 0;
} }
static int dbg_show_chan_state(struct seq_file *s, void *p) static int dbg_show_chan_state(struct seq_file *s, void *p)
{ {
int pos = 0;
int chan = (int)s->private; int chan = (int)s->private;
u32 dcsr, dcmd; u32 dcsr, dcmd;
int burst, width; int burst, width;
...@@ -142,12 +140,11 @@ static int dbg_show_chan_state(struct seq_file *s, void *p) ...@@ -142,12 +140,11 @@ static int dbg_show_chan_state(struct seq_file *s, void *p)
burst = dbg_burst_from_dcmd(dcmd); burst = dbg_burst_from_dcmd(dcmd);
width = (1 << ((dcmd >> 14) & 0x3)) >> 1; width = (1 << ((dcmd >> 14) & 0x3)) >> 1;
pos += seq_printf(s, "DMA channel %d\n", chan); seq_printf(s, "DMA channel %d\n", chan);
pos += seq_printf(s, "\tPriority : %s\n", seq_printf(s, "\tPriority : %s\n", str_prio[dma_channels[chan].prio]);
str_prio[dma_channels[chan].prio]); seq_printf(s, "\tUnaligned transfer bit: %s\n",
pos += seq_printf(s, "\tUnaligned transfer bit: %s\n",
DALGN & (1 << chan) ? "yes" : "no"); DALGN & (1 << chan) ? "yes" : "no");
pos += seq_printf(s, "\tDCSR = %08x (%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s)\n", seq_printf(s, "\tDCSR = %08x (%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s)\n",
dcsr, DCSR_STR(RUN), DCSR_STR(NODESC), dcsr, DCSR_STR(RUN), DCSR_STR(NODESC),
DCSR_STR(STOPIRQEN), DCSR_STR(EORIRQEN), DCSR_STR(STOPIRQEN), DCSR_STR(EORIRQEN),
DCSR_STR(EORJMPEN), DCSR_STR(EORSTOPEN), DCSR_STR(EORJMPEN), DCSR_STR(EORSTOPEN),
...@@ -156,28 +153,26 @@ static int dbg_show_chan_state(struct seq_file *s, void *p) ...@@ -156,28 +153,26 @@ static int dbg_show_chan_state(struct seq_file *s, void *p)
DCSR_STR(STOPSTATE), DCSR_STR(ENDINTR), DCSR_STR(STOPSTATE), DCSR_STR(ENDINTR),
DCSR_STR(STARTINTR), DCSR_STR(BUSERR)); DCSR_STR(STARTINTR), DCSR_STR(BUSERR));
pos += seq_printf(s, "\tDCMD = %08x (%s%s%s%s%s%s%sburst=%d width=%d" seq_printf(s, "\tDCMD = %08x (%s%s%s%s%s%s%sburst=%d width=%d len=%d)\n",
" len=%d)\n",
dcmd, dcmd,
DCMD_STR(INCSRCADDR), DCMD_STR(INCTRGADDR), DCMD_STR(INCSRCADDR), DCMD_STR(INCTRGADDR),
DCMD_STR(FLOWSRC), DCMD_STR(FLOWTRG), DCMD_STR(FLOWSRC), DCMD_STR(FLOWTRG),
DCMD_STR(STARTIRQEN), DCMD_STR(ENDIRQEN), DCMD_STR(STARTIRQEN), DCMD_STR(ENDIRQEN),
DCMD_STR(ENDIAN), burst, width, dcmd & DCMD_LENGTH); DCMD_STR(ENDIAN), burst, width, dcmd & DCMD_LENGTH);
pos += seq_printf(s, "\tDSADR = %08x\n", DSADR(chan)); seq_printf(s, "\tDSADR = %08x\n", DSADR(chan));
pos += seq_printf(s, "\tDTADR = %08x\n", DTADR(chan)); seq_printf(s, "\tDTADR = %08x\n", DTADR(chan));
pos += seq_printf(s, "\tDDADR = %08x\n", DDADR(chan)); seq_printf(s, "\tDDADR = %08x\n", DDADR(chan));
return pos;
return 0;
} }
static int dbg_show_state(struct seq_file *s, void *p) static int dbg_show_state(struct seq_file *s, void *p)
{ {
int pos = 0;
/* basic device status */ /* basic device status */
pos += seq_printf(s, "DMA engine status\n"); seq_puts(s, "DMA engine status\n");
pos += seq_printf(s, "\tChannel number: %d\n", num_dma_channels); seq_printf(s, "\tChannel number: %d\n", num_dma_channels);
return pos; return 0;
} }
#define DBGFS_FUNC_DECL(name) \ #define DBGFS_FUNC_DECL(name) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment