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

cris fasttimer: 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 1f33c41c ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")

Miscellanea:

o Coalesce formats, realign arguments
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1336d422
...@@ -527,7 +527,8 @@ static int proc_fasttimer_show(struct seq_file *m, void *v) ...@@ -527,7 +527,8 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
i = debug_log_cnt; i = debug_log_cnt;
while (i != end_i || debug_log_cnt_wrapped) { while (i != end_i || debug_log_cnt_wrapped) {
if (seq_printf(m, debug_log_string[i], debug_log_value[i]) < 0) seq_printf(m, debug_log_string[i], debug_log_value[i]);
if (seq_has_overflowed(m))
return 0; return 0;
i = (i+1) % DEBUG_LOG_MAX; i = (i+1) % DEBUG_LOG_MAX;
} }
...@@ -542,24 +543,22 @@ static int proc_fasttimer_show(struct seq_file *m, void *v) ...@@ -542,24 +543,22 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
int cur = (fast_timers_started - i - 1) % NUM_TIMER_STATS; int cur = (fast_timers_started - i - 1) % NUM_TIMER_STATS;
#if 1 //ndef FAST_TIMER_LOG #if 1 //ndef FAST_TIMER_LOG
seq_printf(m, "div: %i freq: %i delay: %i" seq_printf(m, "div: %i freq: %i delay: %i\n",
"\n",
timer_div_settings[cur], timer_div_settings[cur],
timer_freq_settings[cur], timer_freq_settings[cur],
timer_delay_settings[cur]); timer_delay_settings[cur]);
#endif #endif
#ifdef FAST_TIMER_LOG #ifdef FAST_TIMER_LOG
t = &timer_started_log[cur]; t = &timer_started_log[cur];
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu " seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
"d: %6li us data: 0x%08lX" t->name,
"\n", (unsigned long)t->tv_set.tv_jiff,
t->name, (unsigned long)t->tv_set.tv_usec,
(unsigned long)t->tv_set.tv_jiff, (unsigned long)t->tv_expires.tv_jiff,
(unsigned long)t->tv_set.tv_usec, (unsigned long)t->tv_expires.tv_usec,
(unsigned long)t->tv_expires.tv_jiff, t->delay_us,
(unsigned long)t->tv_expires.tv_usec, t->data);
t->delay_us, if (seq_has_overflowed(m))
t->data) < 0)
return 0; return 0;
#endif #endif
} }
...@@ -571,16 +570,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v) ...@@ -571,16 +570,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
seq_printf(m, "Timers added: %i\n", fast_timers_added); seq_printf(m, "Timers added: %i\n", fast_timers_added);
for (i = 0; i < num_to_show; i++) { for (i = 0; i < num_to_show; i++) {
t = &timer_added_log[(fast_timers_added - i - 1) % NUM_TIMER_STATS]; t = &timer_added_log[(fast_timers_added - i - 1) % NUM_TIMER_STATS];
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu " seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
"d: %6li us data: 0x%08lX" t->name,
"\n", (unsigned long)t->tv_set.tv_jiff,
t->name, (unsigned long)t->tv_set.tv_usec,
(unsigned long)t->tv_set.tv_jiff, (unsigned long)t->tv_expires.tv_jiff,
(unsigned long)t->tv_set.tv_usec, (unsigned long)t->tv_expires.tv_usec,
(unsigned long)t->tv_expires.tv_jiff, t->delay_us,
(unsigned long)t->tv_expires.tv_usec, t->data);
t->delay_us, if (seq_has_overflowed(m))
t->data) < 0)
return 0; return 0;
} }
seq_putc(m, '\n'); seq_putc(m, '\n');
...@@ -590,16 +588,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v) ...@@ -590,16 +588,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
seq_printf(m, "Timers expired: %i\n", fast_timers_expired); seq_printf(m, "Timers expired: %i\n", fast_timers_expired);
for (i = 0; i < num_to_show; i++) { for (i = 0; i < num_to_show; i++) {
t = &timer_expired_log[(fast_timers_expired - i - 1) % NUM_TIMER_STATS]; t = &timer_expired_log[(fast_timers_expired - i - 1) % NUM_TIMER_STATS];
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu " seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
"d: %6li us data: 0x%08lX" t->name,
"\n", (unsigned long)t->tv_set.tv_jiff,
t->name, (unsigned long)t->tv_set.tv_usec,
(unsigned long)t->tv_set.tv_jiff, (unsigned long)t->tv_expires.tv_jiff,
(unsigned long)t->tv_set.tv_usec, (unsigned long)t->tv_expires.tv_usec,
(unsigned long)t->tv_expires.tv_jiff, t->delay_us,
(unsigned long)t->tv_expires.tv_usec, t->data);
t->delay_us, if (seq_has_overflowed(m))
t->data) < 0)
return 0; return 0;
} }
seq_putc(m, '\n'); seq_putc(m, '\n');
...@@ -611,19 +608,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v) ...@@ -611,19 +608,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
while (t) { while (t) {
nextt = t->next; nextt = t->next;
local_irq_restore(flags); local_irq_restore(flags);
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu " seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
"d: %6li us data: 0x%08lX" t->name,
/* " func: 0x%08lX" */ (unsigned long)t->tv_set.tv_jiff,
"\n", (unsigned long)t->tv_set.tv_usec,
t->name, (unsigned long)t->tv_expires.tv_jiff,
(unsigned long)t->tv_set.tv_jiff, (unsigned long)t->tv_expires.tv_usec,
(unsigned long)t->tv_set.tv_usec, t->delay_us,
(unsigned long)t->tv_expires.tv_jiff, t->data);
(unsigned long)t->tv_expires.tv_usec, if (seq_has_overflowed(m))
t->delay_us,
t->data
/* , t->function */
) < 0)
return 0; return 0;
local_irq_save(flags); local_irq_save(flags);
if (t->next != nextt) if (t->next != nextt)
......
...@@ -501,7 +501,8 @@ static int proc_fasttimer_show(struct seq_file *m, void *v) ...@@ -501,7 +501,8 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
i = debug_log_cnt; i = debug_log_cnt;
while ((i != end_i || debug_log_cnt_wrapped)) { while ((i != end_i || debug_log_cnt_wrapped)) {
if (seq_printf(m, debug_log_string[i], debug_log_value[i]) < 0) seq_printf(m, debug_log_string[i], debug_log_value[i]);
if (seq_has_overflowed(m))
return 0; return 0;
i = (i+1) % DEBUG_LOG_MAX; i = (i+1) % DEBUG_LOG_MAX;
} }
...@@ -516,23 +517,21 @@ static int proc_fasttimer_show(struct seq_file *m, void *v) ...@@ -516,23 +517,21 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
int cur = (fast_timers_started - i - 1) % NUM_TIMER_STATS; int cur = (fast_timers_started - i - 1) % NUM_TIMER_STATS;
#if 1 //ndef FAST_TIMER_LOG #if 1 //ndef FAST_TIMER_LOG
seq_printf(m, "div: %i delay: %i" seq_printf(m, "div: %i delay: %i\n",
"\n",
timer_div_settings[cur], timer_div_settings[cur],
timer_delay_settings[cur]); timer_delay_settings[cur]);
#endif #endif
#ifdef FAST_TIMER_LOG #ifdef FAST_TIMER_LOG
t = &timer_started_log[cur]; t = &timer_started_log[cur];
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu " seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
"d: %6li us data: 0x%08lX" t->name,
"\n", (unsigned long)t->tv_set.tv_jiff,
t->name, (unsigned long)t->tv_set.tv_usec,
(unsigned long)t->tv_set.tv_jiff, (unsigned long)t->tv_expires.tv_jiff,
(unsigned long)t->tv_set.tv_usec, (unsigned long)t->tv_expires.tv_usec,
(unsigned long)t->tv_expires.tv_jiff, t->delay_us,
(unsigned long)t->tv_expires.tv_usec, t->data);
t->delay_us, if (seq_has_overflowed(m))
t->data) < 0)
return 0; return 0;
#endif #endif
} }
...@@ -544,16 +543,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v) ...@@ -544,16 +543,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
seq_printf(m, "Timers added: %i\n", fast_timers_added); seq_printf(m, "Timers added: %i\n", fast_timers_added);
for (i = 0; i < num_to_show; i++) { for (i = 0; i < num_to_show; i++) {
t = &timer_added_log[(fast_timers_added - i - 1) % NUM_TIMER_STATS]; t = &timer_added_log[(fast_timers_added - i - 1) % NUM_TIMER_STATS];
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu " seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
"d: %6li us data: 0x%08lX" t->name,
"\n", (unsigned long)t->tv_set.tv_jiff,
t->name, (unsigned long)t->tv_set.tv_usec,
(unsigned long)t->tv_set.tv_jiff, (unsigned long)t->tv_expires.tv_jiff,
(unsigned long)t->tv_set.tv_usec, (unsigned long)t->tv_expires.tv_usec,
(unsigned long)t->tv_expires.tv_jiff, t->delay_us,
(unsigned long)t->tv_expires.tv_usec, t->data);
t->delay_us, if (seq_has_overflowed(m))
t->data) < 0)
return 0; return 0;
} }
seq_putc(m, '\n'); seq_putc(m, '\n');
...@@ -563,16 +561,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v) ...@@ -563,16 +561,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
seq_printf(m, "Timers expired: %i\n", fast_timers_expired); seq_printf(m, "Timers expired: %i\n", fast_timers_expired);
for (i = 0; i < num_to_show; i++){ for (i = 0; i < num_to_show; i++){
t = &timer_expired_log[(fast_timers_expired - i - 1) % NUM_TIMER_STATS]; t = &timer_expired_log[(fast_timers_expired - i - 1) % NUM_TIMER_STATS];
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu " seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
"d: %6li us data: 0x%08lX" t->name,
"\n", (unsigned long)t->tv_set.tv_jiff,
t->name, (unsigned long)t->tv_set.tv_usec,
(unsigned long)t->tv_set.tv_jiff, (unsigned long)t->tv_expires.tv_jiff,
(unsigned long)t->tv_set.tv_usec, (unsigned long)t->tv_expires.tv_usec,
(unsigned long)t->tv_expires.tv_jiff, t->delay_us,
(unsigned long)t->tv_expires.tv_usec, t->data);
t->delay_us, if (seq_has_overflowed(m))
t->data) < 0)
return 0; return 0;
} }
seq_putc(m, '\n'); seq_putc(m, '\n');
...@@ -584,19 +581,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v) ...@@ -584,19 +581,15 @@ static int proc_fasttimer_show(struct seq_file *m, void *v)
while (t != NULL){ while (t != NULL){
nextt = t->next; nextt = t->next;
local_irq_restore(flags); local_irq_restore(flags);
if (seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu " seq_printf(m, "%-14s s: %6lu.%06lu e: %6lu.%06lu d: %6li us data: 0x%08lX\n",
"d: %6li us data: 0x%08lX" t->name,
/* " func: 0x%08lX" */ (unsigned long)t->tv_set.tv_jiff,
"\n", (unsigned long)t->tv_set.tv_usec,
t->name, (unsigned long)t->tv_expires.tv_jiff,
(unsigned long)t->tv_set.tv_jiff, (unsigned long)t->tv_expires.tv_usec,
(unsigned long)t->tv_set.tv_usec, t->delay_us,
(unsigned long)t->tv_expires.tv_jiff, t->data);
(unsigned long)t->tv_expires.tv_usec, if (seq_has_overflowed(m))
t->delay_us,
t->data
/* , t->function */
) < 0)
return 0; return 0;
local_irq_save(flags); local_irq_save(flags);
if (t->next != nextt) if (t->next != nextt)
......
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