break;
}
- if (*(string_buf+needed-1) != '\n')
+ if (*(string_buf + needed - 1) != '\n') {
printk(KERN_INFO "format at %s:%d:%s doesn't end in "
"newline\n", file, msgdata->msg_line, msgdata->msg_fn);
+ } else if (mask & D_TTY) {
+ /* TTY needs '\r\n' to move carriage to leftmost position */
+ if (needed < 2 || *(string_buf + needed - 2) != '\r')
+ printk(KERN_INFO "format at %s:%d:%s doesn't end in "
+ "'\\r\\n'\n", file, msgdata->msg_line,
+ msgdata->msg_fn);
+ }
header.ph_len = known_size + needed;
debug_buf = (char *)page_address(tage->page) + tage->used;
if (cdls != NULL) {
if (libcfs_console_ratelimit &&
cdls->cdls_next != 0 && /* not first time ever */
- time_after(jiffies, cdls->cdls_next)) {
+ time_before(jiffies, cdls->cdls_next)) {
/* skipping a console message */
cdls->cdls_count++;
if (tcd != NULL)
cdls->cdls_count,
(cdls->cdls_count > 1) ? "s" : "");
- cfs_print_to_console(&header, mask,
- string_buf, needed, file, msgdata->msg_fn);
+ /* Do not allow print this to TTY */
+ cfs_print_to_console(&header, mask & ~D_TTY, string_buf,
+ needed, file, msgdata->msg_fn);
put_cpu();
cdls->cdls_count = 0;