static void linedisp_scroll()

in line-display.c [31:57]


static void linedisp_scroll(struct timer_list *t)
{
	struct linedisp *linedisp = from_timer(linedisp, t, timer);
	unsigned int i, ch = linedisp->scroll_pos;
	unsigned int num_chars = linedisp->num_chars;

	/* update the current message string */
	for (i = 0; i < num_chars;) {
		/* copy as many characters from the string as possible */
		for (; i < num_chars && ch < linedisp->message_len; i++, ch++)
			linedisp->buf[i] = linedisp->message[ch];

		/* wrap around to the start of the string */
		ch = 0;
	}

	/* update the display */
	linedisp->update(linedisp);

	/* move on to the next character */
	linedisp->scroll_pos++;
	linedisp->scroll_pos %= linedisp->message_len;

	/* rearm the timer */
	if (linedisp->message_len > num_chars && linedisp->scroll_rate)
		mod_timer(&linedisp->timer, jiffies + linedisp->scroll_rate);
}